v0.13.2
Searching...
No Matches
Dg_or_Dg.hpp
Go to the documentation of this file.
1/* Adds two Dg's to make a Dg, but with different
2 symmetries. */
3
4#pragma once
5
6namespace FTensor
7{
8 /* A(i,j,k)+B(i,k,j) -> Dg(j,k,i) */
9
10 template <class A, class B, class T, class U, int Dim, char i, char j, char k>
12 {
15
16 public:
17 typename promote<T, U>::V
18 operator()(const int N1, const int N2, const int N3) const
19 {
20 return iterA(N3, N1, N2) + iterB(N3, N2, N1);
21 }
22
25 : iterA(a), iterB(b)
26 {}
27 };
28
29 template <class A, class B, class T, class U, int Dim, char i, char j, char k>
30 Dg_Expr<Dg_or_Dg_12<A, B, T, U, Dim, i, j, k>, typename promote<T, U>::V,
31 Dim, Dim, j, k, i>
34 {
37 TensorExpr(a, b));
38 }
39
40 /* A(j,i,k)+B(k,i,j) -> Dg(j,k,i) */
41
42 template <class A, class B, class T, class U, int Dim, char i, char j, char k>
44 {
47
48 public:
49 typename promote<T, U>::V
50 operator()(const int N1, const int N2, const int N3) const
51 {
52 return iterA(N1, N3, N2) + iterB(N2, N3, N1);
53 }
54
57 : iterA(a), iterB(b)
58 {}
59 };
60
61 template <class A, class B, class T, class U, int Dim, char i, char j, char k>
62 Dg_Expr<Dg_or_Dg_02<A, B, T, U, Dim, i, j, k>, typename promote<T, U>::V,
63 Dim, Dim, j, k, i>
66 {
69 TensorExpr(a, b));
70 }
71}
static Number< 2 > N2
static Number< 1 > N1
constexpr double a
Dg_or_Dg_02(const Dg_Expr< A, T, Dim, Dim, j, i, k > &a, const Dg_Expr< B, U, Dim, Dim, k, i, j > &b)
Definition: Dg_or_Dg.hpp:55
Dg_Expr< B, U, Dim, Dim, k, i, j > iterB
Definition: Dg_or_Dg.hpp:46
promote< T, U >::V operator()(const int N1, const int N2, const int N3) const
Definition: Dg_or_Dg.hpp:50
Dg_Expr< A, T, Dim, Dim, j, i, k > iterA
Definition: Dg_or_Dg.hpp:45
promote< T, U >::V operator()(const int N1, const int N2, const int N3) const
Definition: Dg_or_Dg.hpp:18
Dg_or_Dg_12(const Dg_Expr< A, T, Dim, Dim, i, j, k > &a, const Dg_Expr< B, U, Dim, Dim, i, k, j > &b)
Definition: Dg_or_Dg.hpp:23
Dg_Expr< A, T, Dim, Dim, i, j, k > iterA
Definition: Dg_or_Dg.hpp:13
Dg_Expr< B, U, Dim, Dim, i, k, j > iterB
Definition: Dg_or_Dg.hpp:14
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
Tensors class implemented by Walter Landry.
Definition: FTensor.hpp:51
Ddg_Expr< Ddg_or_Ddg< A, B, T, U, Dim, i, j, k, l >, typename promote< T, U >::V, Dim, Dim, i, k, j, l > operator||(const Ddg_Expr< A, T, Dim, Dim, i, j, k, l > &a, const Ddg_Expr< B, U, Dim, Dim, i, l, k, j > &b)
Definition: Ddg_or_Ddg.hpp:33