Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
usadelndsoc
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
JYU Condensed Matter Theory
usadelndsoc
Commits
ee047bbe
Commit
ee047bbe
authored
2 years ago
by
patavirt
Browse files
Options
Downloads
Patches
Plain Diff
action: template type for U and Omega, to allow differentiation vs. them
parent
0f3d9698
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/action.hpp
+20
-47
20 additions, 47 deletions
src/action.hpp
with
20 additions
and
47 deletions
src/action.hpp
+
20
−
47
View file @
ee047bbe
...
...
@@ -55,10 +55,13 @@ Eigen::Matrix<typename XType::value_type,4,4> nambu_diag_mul(const LRType& L, co
return
Y
;
}
template
<
typename
ConstScalar
,
typename
Shape0
,
typename
Shape
,
typename
Shape2
,
typename
Scalar
=
typename
std
::
remove_const
<
ConstScalar
>
::
type
>
template
<
typename
ConstScalar
,
typename
ConstScalar2
,
typename
Shape0
,
typename
Shape
,
typename
Shape2
,
typename
Scalar
=
typename
std
::
remove_const
<
ConstScalar
>
::
type
,
typename
Scalar2
=
typename
std
::
remove_const
<
ConstScalar2
>::
type
>
inline
Scalar
S_2
(
const
array
::
ArrayView
<
const
Mask
,
Shape0
>&
mask
,
const
array
::
ArrayView
<
ConstScalar
,
Shape
>&
Qmat
,
const
array
::
ArrayView
<
c
onst
Complex
,
Shape2
>&
U
,
const
array
::
ArrayView
<
C
onst
Scalar2
,
Shape2
>&
U
,
const
double
&
Lx
,
const
double
&
Ly
,
const
Complex
&
D
)
...
...
@@ -109,11 +112,14 @@ inline Scalar S_2(const array::ArrayView<const Mask, Shape0>& mask,
return
(
D
*
dd
[
0
]
*
dd
[
1
]
*
2.0
/
4.0
)
*
S
;
}
template
<
typename
ConstScalar
,
typename
Shape0
,
typename
Shape
,
typename
Shape2
,
typename
Scalar
=
typename
std
::
remove_const
<
ConstScalar
>
::
type
>
template
<
typename
ConstScalar
,
typename
ConstScalar2
,
typename
Shape0
,
typename
Shape
,
typename
Shape2
,
typename
Scalar
=
typename
std
::
remove_const
<
ConstScalar
>
::
type
,
typename
Scalar2
=
typename
std
::
remove_const
<
ConstScalar
>::
type
>
inline
Scalar
S_Omega
(
const
array
::
ArrayView
<
const
Mask
,
Shape0
>&
mask
,
const
array
::
ArrayView
<
ConstScalar
,
Shape
>&
Qmat
,
const
Scalar
&
omega
,
const
array
::
ArrayView
<
c
onst
Complex
,
Shape2
>&
Omega
,
const
array
::
ArrayView
<
C
onst
Scalar2
,
Shape2
>&
Omega
,
const
double
&
Lx
,
const
double
&
Ly
)
{
...
...
@@ -140,10 +146,11 @@ inline Scalar S_Omega(const array::ArrayView<const Mask, Shape0>& mask,
return
(
dd
[
0
]
*
dd
[
1
])
*
S
;
}
template
<
typename
ConstScalar
,
typename
Shape0
,
typename
Shape
,
typename
Shape2
,
typename
Scalar
=
typename
std
::
remove_const
<
ConstScalar
>
::
type
>
template
<
typename
ConstScalar
,
typename
ConstScalar2
,
typename
Shape0
,
typename
Shape
,
typename
Shape2
,
typename
Scalar
=
typename
std
::
remove_const
<
ConstScalar
>
::
type
,
typename
Scalar2
=
typename
std
::
remove_const
<
ConstScalar2
>::
type
>
inline
Scalar
S_H
(
const
array
::
ArrayView
<
const
Mask
,
Shape0
>&
mask
,
const
array
::
ArrayView
<
ConstScalar
,
Shape
>&
Qmat
,
const
array
::
ArrayView
<
c
onst
Complex
,
Shape2
>&
U
,
const
array
::
ArrayView
<
C
onst
Scalar2
,
Shape2
>&
U
,
const
double
&
Lx
,
const
double
&
Ly
,
const
Complex
&
alpha
)
...
...
@@ -241,12 +248,16 @@ Complex flat_value(const Complex& value)
}
CPPAD_DISCRETE_FUNCTION
(
Complex
,
flat_value
);
template
<
typename
ConstScalar
,
typename
Shape0
,
typename
Shape1
,
typename
Shape2
,
typename
Shape3
,
typename
Scalar
=
typename
std
::
remove_const
<
ConstScalar
>
::
type
>
template
<
typename
ConstScalar
,
typename
ConstScalar2
,
typename
ConstScalar3
,
typename
Shape0
,
typename
Shape1
,
typename
Shape2
,
typename
Shape3
,
typename
Scalar
=
typename
std
::
remove_const
<
ConstScalar
>
::
type
,
typename
Scalar2
=
typename
std
::
remove_const
<
ConstScalar2
>::
type
,
typename
Scalar3
=
typename
std
::
remove_const
<
ConstScalar3
>::
type
>
inline
Scalar
S
(
const
array
::
ArrayView
<
const
Mask
,
Shape0
>&
mask
,
const
array
::
ArrayView
<
ConstScalar
,
Shape1
>&
Q
,
const
Scalar
&
omega
,
const
array
::
ArrayView
<
c
onst
Complex
,
Shape2
>&
U
,
const
array
::
ArrayView
<
c
onst
Complex
,
Shape3
>&
Omega
,
const
array
::
ArrayView
<
C
onst
Scalar2
,
Shape2
>&
U
,
const
array
::
ArrayView
<
C
onst
Scalar3
,
Shape3
>&
Omega
,
const
double
&
Lx
,
const
double
&
Ly
,
const
Complex
&
alpha
,
...
...
@@ -292,43 +303,5 @@ inline Scalar S(const array::ArrayView<const Mask, Shape0>& mask,
return
S
;
}
template
<
typename
Scalar
,
typename
Shape
>
inline
Scalar
laplacian
(
array
::
ArrayView
<
Scalar
,
Shape
>
Q
)
{
const
int
N_i
[
4
]
=
{
0
,
1
,
-
1
,
0
};
const
int
N_j
[
4
]
=
{
1
,
0
,
0
,
-
1
};
Scalar
S
=
Scalar
(
0
);
size_t
nx
=
Q
.
dim
(
0
);
size_t
ny
=
Q
.
dim
(
1
);
for
(
size_t
i
=
0
;
i
<
nx
;
++
i
)
{
for
(
size_t
j
=
0
;
j
<
ny
;
++
j
)
{
/* Sum over neighbors */
for
(
size_t
k
=
0
;
k
<
4
;
++
k
)
{
int
di
=
N_i
[
k
];
int
dj
=
N_j
[
k
];
if
(
i
==
0
&&
di
<
0
)
continue
;
if
(
i
==
nx
-
1
&&
di
>
0
)
continue
;
if
(
j
==
0
&&
dj
<
0
)
continue
;
if
(
j
==
ny
-
1
&&
dj
>
0
)
continue
;
size_t
i2
=
i
+
di
;
size_t
j2
=
j
+
dj
;
S
+=
(
Q
(
i
,
j
)
-
Q
(
i2
,
j2
))
*
(
Q
(
i
,
j
)
-
Q
(
i2
,
j2
));
}
}
}
return
S
;
}
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment