v0.14.0
Tensor4_minus_Tensor4.hpp
Go to the documentation of this file.
1 // Subtracts 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_minus_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_minus_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
FTensor::Tensor4_minus_Tensor4
Definition: Tensor4_minus_Tensor4.hpp:11
A
constexpr AssemblyType A
Definition: operators_tests.cpp:30
FTensor::Tensor4_minus_Tensor4::operator()
promote< T, U >::V operator()(const int N1, const int N2, const int N3, const int N4) const
Definition: Tensor4_minus_Tensor4.hpp:18
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_minus_Tensor4::iterB
Tensor4_Expr< B, U, Dim0_1, Dim1_1, Dim2_1, Dim3_1, i1, j1, k1, l1 > iterB
Definition: Tensor4_minus_Tensor4.hpp:14
FTensor::Tensor4_minus_Tensor4::Tensor4_minus_Tensor4
Tensor4_minus_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_minus_Tensor4.hpp:23
FTensor::operator-
Ddg_Expr< Ddg_minus_Ddg< A, B, T, U, Dim01, Dim23, i, j, k, l >, typename promote< T, U >::V, Dim01, Dim23, i, j, k, l > operator-(const Ddg_Expr< A, T, Dim01, Dim23, i, j, k, l > &a, const Ddg_Expr< B, U, Dim01, Dim23, i, j, k, l > &b)
Definition: Ddg_minus_Ddg.hpp:33
FTensor::Tensor4_minus_Tensor4::iterA
Tensor4_Expr< A, T, Dim0_0, Dim1_0, Dim2_0, Dim3_0, i0, j0, k0, l0 > iterA
Definition: Tensor4_minus_Tensor4.hpp:13
EshelbianPlasticity::U
@ U
Definition: EshelbianContact.cpp:197