v0.14.0
Permutation3.hpp
Go to the documentation of this file.
1 #pragma once
2 
4 
5 namespace FTensor
6 {
7  template <int Dim0, int Dim1, int Dim2, char i, char j, char k>
8  struct Permutation3
9  {
10  Permutation3() = default;
11 
12  template <class B, class U>
14  const int N0, const int N1, const int N2)
15  {
16  return rhs(N0, N1, N2);
17  }
18 
19  template <class B, class U>
21  const int N0, const int N1, const int N2)
22  {
23  return rhs(N0, N2, N1);
24  }
25 
26  template <class B, class U>
28  const int N0, const int N1, const int N2)
29  {
30  return rhs(N1, N0, N2);
31  }
32 
33  template <class B, class U>
35  const int N0, const int N1, const int N2)
36  {
37  return rhs(N1, N2, N0);
38  }
39 
40  template <class B, class U>
42  const int N0, const int N1, const int N2)
43  {
44  return rhs(N2, N0, N1);
45  }
46 
47  template <class B, class U>
49  const int N0, const int N1, const int N2)
50  {
51  return rhs(N2, N1, N0);
52  }
53 
54  // Catch-all version for incompatible indices
55  template <class B, class U, int Dim1_0, int Dim1_1, int Dim1_2, char i1,
56  char j1, char k1>
58  const int N0, const int N1, const int N2)
59  {
60  static_assert(error_when_instantiated<B>(), "Incompatible indices");
61  return rhs(0, 0, 0);
62  }
63 
64  template <class B, class U>
65  U eval(const Dg_Expr<B, U, Dim0, Dim2, i, j, k> &rhs, const int N0,
66  const int N1, const int N2) {
67  static_assert(Dim0 == Dim1, "Incompatible indices");
68  return rhs(N0, N1, N2);
69  }
70 
71  template <class B, class U>
72  U eval(const Dg_Expr<B, U, Dim0, Dim2, j, i, k> &rhs, const int N0,
73  const int N1, const int N2) {
74  static_assert(Dim0 == Dim1, "Incompatible indices");
75  return rhs(N0, N1, N2);
76  }
77 
78  // Catch-all version for incompatible indices
79  template <class B, class U, int Dim1_01, int Dim1_1, int Dim1_2, char i1,
80  char j1, char k1>
82  const int N1, const int N2) {
83  static_assert(error_when_instantiated<B>(), "Incompatible indices");
84  return rhs(0, 0, 0);
85  }
86  };
87 }
FTensor::Permutation3::eval
U eval(const Dg_Expr< B, U, Dim0, Dim2, j, i, k > &rhs, const int N0, const int N1, const int N2)
Definition: Permutation3.hpp:72
FTensor
JSON compatible output.
Definition: Christof_constructor.hpp:6
FTensor::Permutation3
Definition: Permutation3.hpp:8
FTensor::Permutation3::eval
U eval(const Tensor3_Expr< B, U, Dim2, Dim1, Dim0, k, j, i > &rhs, const int N0, const int N1, const int N2)
Definition: Permutation3.hpp:48
FTensor::Permutation3::eval
U eval(const Dg_Expr< B, U, Dim0, Dim2, i, j, k > &rhs, const int N0, const int N1, const int N2)
Definition: Permutation3.hpp:65
FTensor::Permutation3::Permutation3
Permutation3()=default
FTensor::Permutation3::eval
U eval(const Tensor3_Expr< B, U, Dim0, Dim1, Dim2, i, j, k > &rhs, const int N0, const int N1, const int N2)
Definition: Permutation3.hpp:13
FTensor::Permutation3::eval
U eval(const Tensor3_Expr< B, U, Dim1_0, Dim1_1, Dim1_2, i1, j1, k1 > &rhs, const int N0, const int N1, const int N2)
Definition: Permutation3.hpp:57
FTensor::Permutation3::eval
U eval(const Tensor3_Expr< B, U, Dim0, Dim2, Dim1, i, k, j > &rhs, const int N0, const int N1, const int N2)
Definition: Permutation3.hpp:20
FTensor::Tensor3_Expr< B, U, Dim0, Dim1, Dim2, i, j, k >
FTensor::Permutation3::eval
U eval(const Tensor3_Expr< B, U, Dim2, Dim0, Dim1, k, i, j > &rhs, const int N0, const int N1, const int N2)
Definition: Permutation3.hpp:41
FTensor::Permutation3::eval
U eval(const Tensor3_Expr< B, U, Dim1, Dim2, Dim0, j, k, i > &rhs, const int N0, const int N1, const int N2)
Definition: Permutation3.hpp:34
FTensor::Permutation3::eval
U eval(const Tensor3_Expr< B, U, Dim1, Dim0, Dim2, j, i, k > &rhs, const int N0, const int N1, const int N2)
Definition: Permutation3.hpp:27
FTensor::Dg_Expr
Definition: Dg_Expr.hpp:25
error_when_instantiated.hpp
EshelbianPlasticity::U
@ U
Definition: EshelbianContact.cpp:197
FTensor::Permutation3::eval
U eval(const Dg_Expr< B, U, Dim1_01, Dim1_2, i1, j1, k1 > &rhs, const int N0, const int N1, const int N2)
Definition: Permutation3.hpp:81