v0.13.2
Searching...
No Matches
Tensor2_symmetric_and_Tensor2_symmetric.hpp
Go to the documentation of this file.
1/* Multiply a Tensor2_symmetric and a Tensor2_symmetric together but
2 don't contract, yielding a Tensor2_symmetric. */
3
4/* A(i,j) & B(i,j) -> Tensor2_symmetric */
5
6#pragma once
7
8namespace FTensor
9{
10 /* Base Template */
11 template <class A, class B, class T, class U, int Dim_0, int Dim_1, char i0,
12 char j0, char i1, char j1>
14 {};
15
16 template <class A, class B, class T, class U, int Dim, char i, char j>
17 class Tensor2_symmetric_and_Tensor2_symmetric<A, B, T, U, Dim, Dim, i, j, i,
18 j>
19 {
22
23 public:
24 typename promote<T, U>::V operator()(const int N1, const int N2) const
25 {
26 return iterA(N1, N2) * iterB(N1, N2);
27 }
28
32 : iterA(a), iterB(b)
33 {}
34 };
35
36 /* A(i,j) & B(j,i) -> Tensor2_symmetric */
37
38 template <class A, class B, class T, class U, int Dim, char i, char j>
39 class Tensor2_symmetric_and_Tensor2_symmetric<A, B, T, U, Dim, Dim, i, j, j,
40 i>
41 {
44
45 public:
46 typename promote<T, U>::V operator()(const int N1, const int N2) const
47 {
48 return iterA(N1, N2) * iterB(N2, N1);
49 }
50
54 : iterA(a), iterB(b)
55 {}
56 };
57
58 template <class A, class B, class T, class U, int Dim_0, int Dim_1, char i0,
59 char j0, char i1, char j1>
60 Tensor2_symmetric_Expr<Tensor2_symmetric_and_Tensor2_symmetric<
61 A, B, T, U, Dim_0, Dim_1, i0, j0, i1, j1>,
62 typename promote<T, U>::V, Dim_0, i0, j0>
65 {
66 using TensorExpr
67 = Tensor2_symmetric_and_Tensor2_symmetric<A, B, T, U, Dim_0, Dim_1, i0,
68 j0, i1, j1>;
69 static_assert(
70 !std::is_empty<TensorExpr>::value,
71 "Indexes or Dimensions are not compatible with the & operator");
73 i0, j0>(TensorExpr(a, b));
74 }
75}
static Number< 2 > N2
static Number< 1 > N1
constexpr double a
Tensor2_symmetric_and_Tensor2_symmetric(const Tensor2_symmetric_Expr< A, T, Dim, i, j > &a, const Tensor2_symmetric_Expr< B, U, Dim, j, i > &b)
Tensor2_symmetric_and_Tensor2_symmetric(const Tensor2_symmetric_Expr< A, T, Dim, i, j > &a, const Tensor2_symmetric_Expr< B, U, Dim, i, j > &b)
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'j', 3 > j
const double T
Tensors class implemented by Walter Landry.
Definition: FTensor.hpp:51
Ddg_Expr< Ddg_and_Tensor2_symmetric< A, B, T, U, Dim01_0, Dim23_0, Dim_1, i0, j0, k0, l0, i1, j1 >, typename promote< T, U >::V, Dim01_0, Dim23_0, i0, j0, k0, l0 > operator&(const Ddg_Expr< A, T, Dim01_0, Dim23_0, i0, j0, k0, l0 > &a, const Tensor2_symmetric_Expr< B, U, Dim_1, i1, j1 > &b)
constexpr AssemblyType A