v0.8.4
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 
7 #pragma once
8 
12 // #include "Tensor3_antisymmetric_mod_Tensor1.hpp"
14 
15 namespace FTensor
16 {
17  template <class A, class T, int Dim0, int Dim12, char i, char j, char k>
19  {
20  A iter;
21 
22  public:
23  Tensor3_antisymmetric_Expr(const A &a) : iter(a) {}
24  T operator()(const int N1, const int N2, const int N3) const
25  {
26  return iter(N1, N2, N3);
27  }
28  };
29 
30  template <class A, class T, int Dim0, int Dim12, char i, char j, char k>
32  Dim0, Dim12, i, j, k>
33  {
35 
36  public:
38  : iter(a)
39  {}
40  T operator()(const int N1, const int N2, const int N3) const
41  {
42  return iter(N1, N2, N3);
43  }
44 
45  /* Various assignment operators. I have to explicitly declare the
46  second operator= because otherwise the compiler will generate its
47  own and not use the template code. */
48 
49  template <class B, class U>
51  Dim12, i, j, k> &
52  operator=(
54 
56  Dim12, i, j, k> &
57  operator=(
59  T, Dim0, Dim12, i, j, k> &result);
60 
61  /* This is for when the indices are switched (i,j,k) -> (i,k,j). */
62 
63  template <class B, class U>
65  Dim12, i, j, k> &
66  operator=(
68  };
69 }
70 
Fully Antisymmetric Levi-Civita Tensor.
T operator()(const int N1, const int N2, const int N3) const