v0.9.1
Dg_number.hpp
Go to the documentation of this file.
1 /* This is for expressions where a number is used for one or two
2  slots, and an index for the others, yielding a Tensor1_Expr,
3  Tensor2_Expr, or Tensor2_symmetric_Expr. */
4 
5 #pragma once
6 
7 namespace FTensor
8 {
9  /* First or second slot. */
10 
11  template <class A, class T, int N> class Dg_number_0
12  {
13  A iterA;
14 
15  public:
16  T operator()(const int N1, const int N2) const { return iterA(N, N1, N2); }
17  Dg_number_0(const A &a) : iterA(a) {}
18  };
19 
20  template <class A, class T, int N> class Dg_number_rhs_0
21  {};
22 
23  /* Third slot. */
24 
25  template <class A, class T, int N> class Dg_number_2
26  {
27  A iterA;
28 
29  public:
30  T operator()(const int N1, const int N2) const { return iterA(N1, N2, N); }
31  Dg_number_2(const A &a) : iterA(a) {}
32  };
33 
34  template <class A, class T, int N> class Dg_number_rhs_2
35  {};
36 
37  /* Second and third slot (or first and third slot). */
38 
39  template <class A, class T, int N1, int N2> class Dg_number_12
40  {
41  A iterA;
42 
43  public:
44  T operator()(const int N) const { return iterA(N, N1, N2); }
45  Dg_number_12(const A &a) : iterA(a) {}
46  };
47 
48  template <class A, class T, int N1, int N2> class Dg_number_rhs_12
49  {};
50 
51  /* First and second slot. */
52 
53  template <class A, class T, int N1, int N2> class Dg_number_01
54  {
55  A iterA;
56 
57  public:
58  T operator()(const int N) const { return iterA(N1, N2, N); }
59  Dg_number_01(const A &a) : iterA(a) {}
60  };
61 
62  template <class A, class T, int N1, int N2> class Dg_number_rhs_01
63  {};
64 }
Dg_number_01(const A &a)
Definition: Dg_number.hpp:59
Dg_number_2(const A &a)
Definition: Dg_number.hpp:31
Dg_number_0(const A &a)
Definition: Dg_number.hpp:17
T operator()(const int N) const
Definition: Dg_number.hpp:44
Fully Antisymmetric Levi-Civita Tensor.
T operator()(const int N) const
Definition: Dg_number.hpp:58
Dg_number_12(const A &a)
Definition: Dg_number.hpp:45
T operator()(const int N1, const int N2) const
Definition: Dg_number.hpp:16
const int N
Definition: speed_test.cpp:3
T operator()(const int N1, const int N2) const
Definition: Dg_number.hpp:30