v0.14.0
Tensor4_plus_Tensor4.hpp
Go to the documentation of this file.
1 // Adds Tensor4+Tensor4 -> Tensor4
2 
3 #pragma once
4 
5 namespace FTensor
6 {
7  template <class A, class B, class T, class U, int Dim0_0, int Dim1_0,
8  int Dim2_0, int Dim3_0, int Dim0_1, int Dim1_1, int Dim2_1,
9  int Dim3_1, char i0, char j0, char k0, char l0, char i1, char j1,
10  char k1, char l1>
12  {
15 
16  public:
17  typename promote<T, U>::V
18  operator()(const int N1, const int N2, const int N3, const int N4) const
19  {
20  return iterA(N1, N2, N3, N4) + permute(iterA, iterB, N1, N2, N3, N4);
21  }
22 
23  Tensor4_plus_Tensor4(const Tensor4_Expr<A, T, Dim0_0, Dim1_0, Dim2_0,
24  Dim3_0, i0, j0, k0, l0> &a,
25  const Tensor4_Expr<B, U, Dim0_1, Dim1_1, Dim2_1,
26  Dim3_1, i1, j1, k1, l1> &b)
27  : iterA(a), iterB(b)
28  {}
29  };
30 
31  template <class A, class B, class T, class U, int Dim0_0, int Dim1_0,
32  int Dim2_0, int Dim3_0, int Dim0_1, int Dim1_1, int Dim2_1,
33  int Dim3_1, char i0, char j0, char k0, char l0, char i1, char j1,
34  char k1, char l1>
35  auto operator+(
38  {
39  using TensorExpr
40  = Tensor4_plus_Tensor4<A, B, T, U, Dim0_0, Dim1_0, Dim2_0, Dim3_0,
41  Dim0_1, Dim1_1, Dim2_1, Dim3_1, i0, j0, k0, l0,
42  i1, j1, k1, l1>;
44  Dim2_0, Dim3_0, i0, j0, k0, l0>(TensorExpr(a, b));
45  }
46 }
FTensor
JSON compatible output.
Definition: Christof_constructor.hpp:6
A
constexpr AssemblyType A
Definition: operators_tests.cpp:30
FTensor::permute
U permute(const Tensor2_Expr< A, T, Dim0_0, Dim0_1, i0, j0 > &, const Tensor2_Expr< B, U, Dim1_0, Dim1_1, i1, j1 > &rhs, const int N0, const int N1)
Definition: permute.hpp:11
FTensor::Tensor4_Expr< A, T, Dim0_0, Dim1_0, Dim2_0, Dim3_0, i0, j0, k0, l0 >
a
constexpr double a
Definition: approx_sphere.cpp:30
FTensor::promote::V
T1 V
Definition: promote.hpp:17
FTensor::Tensor4_plus_Tensor4
Definition: Tensor4_plus_Tensor4.hpp:11
FTensor::Tensor4_plus_Tensor4::iterB
Tensor4_Expr< B, U, Dim0_1, Dim1_1, Dim2_1, Dim3_1, i1, j1, k1, l1 > iterB
Definition: Tensor4_plus_Tensor4.hpp:14
FTensor::Tensor4_plus_Tensor4::iterA
Tensor4_Expr< A, T, Dim0_0, Dim1_0, Dim2_0, Dim3_0, i0, j0, k0, l0 > iterA
Definition: Tensor4_plus_Tensor4.hpp:13
FTensor::operator+
Ddg_Expr< Ddg_plus_Ddg< A, B, T, U, Dim01_0, Dim23_0, Dim01_1, Dim23_1, i0, j0, k0, l0, i1, j1, k1, l1 >, 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 Ddg_Expr< B, U, Dim01_1, Dim23_1, i1, j1, k1, l1 > &b)
Definition: Ddg_plus_Ddg.hpp:66
FTensor::Tensor4_plus_Tensor4::operator()
promote< T, U >::V operator()(const int N1, const int N2, const int N3, const int N4) const
Definition: Tensor4_plus_Tensor4.hpp:18
FTensor::Tensor4_plus_Tensor4::Tensor4_plus_Tensor4
Tensor4_plus_Tensor4(const Tensor4_Expr< A, T, Dim0_0, Dim1_0, Dim2_0, Dim3_0, i0, j0, k0, l0 > &a, const Tensor4_Expr< B, U, Dim0_1, Dim1_1, Dim2_1, Dim3_1, i1, j1, k1, l1 > &b)
Definition: Tensor4_plus_Tensor4.hpp:23
EshelbianPlasticity::U
@ U
Definition: EshelbianContact.cpp:197