v0.5.86
Tensor3_antisymmetric_Expr.hpp
Go to the documentation of this file.
1 /* Declare a wrapper class for rank 3 Tensor expressions,
2  antisymmetric in the last two indices. I specialize it for when I
3  wrap a simple Tensor3_antisymmetric(_ptr) so that it has a
4  reference to the Tensor3_antisymmetric(_ptr) and not a copy.
5  Otherwise assignment wouldn't work. */
6 
10 // #include "Tensor3_antisymmetric_mod_Tensor1.hpp"
12 
13 template<class A, class T, int Dim0, int Dim12, char i, char j, char k>
15 {
16  A iter;
17 public:
18  Tensor3_antisymmetric_Expr(A &a): iter(a) {}
19  T operator()(const int N1, const int N2, const int N3) const
20  {
21  return iter(N1,N2,N3);
22  }
23 };
24 
25 template<class A, class T, int Dim0, int Dim12, char i, char j, char k>
27  T,Dim0,Dim12,i,j,k>
28 {
30 public:
32  : iter(a) {}
33  T operator()(const int N1, const int N2, const int N3) const
34  {
35  return iter(N1,N2,N3);
36  }
37 
38  /* Various assignment operators. I have to explicitly declare the
39  second operator= because otherwise the compiler will generate its
40  own and not use the template code. */
41 
42  template<class B, class U>
44  T,Dim0,Dim12,i,j,k> &
45  operator=(const Tensor3_antisymmetric_Expr<B,U,Dim0,Dim12,i,j,k> &result);
46 
48  T,Dim0,Dim12,i,j,k> &
50  <A,Dim0,Dim12>,T,Dim0,Dim12,i,j,k> &result);
51 
52  /* This is for when the indices are switched (i,j,k) -> (i,k,j). */
53 
54  template<class B, class U>
56  T,Dim0,Dim12,i,j,k> &
57  operator=(const Tensor3_antisymmetric_Expr<B,U,Dim0,Dim12,i,k,j> &result);
58 };
59 
T operator()(const int N1, const int N2, const int N3) const