v0.8.23
Ddg_numeral.hpp
Go to the documentation of this file.
1 /* This is for expressions where a number is used for one or more
2  slots, and an index for the others, yielding a
3  Tensor2_symmetric_Expr or Dg_Expr. */
4 
5 #pragma once
6 
7 namespace FTensor
8 {
9  /* First and second slot. */
10 
11  template <class A, class T> class Ddg_numeral_01
12  {
13  A iterA;
14  int N1, N2;
15 
16  public:
17  T operator()(const int N3, const int N4) const
18  {
19  return iterA(N1, N2, N3, N4);
20  }
21  Ddg_numeral_01(const A &a, const int NN1, const int NN2)
22  : iterA(a), N1(NN1), N2(NN2)
23  {}
24  };
25 
26  /* Third and fourth slot. */
27 
28  template <class A, class T> class Ddg_numeral_23
29  {
30  A iterA;
31  int N3, N4;
32 
33  public:
34  T operator()(const int N1, const int N2) const
35  {
36  return iterA(N1, N2, N3, N4);
37  }
38  Ddg_numeral_23(const A &a, const int NN3, const int NN4)
39  : iterA(a), N3(NN3), N4(NN4)
40  {}
41  };
42 
43  /* First and third slot. */
44 
45  template <class A, class T> class Ddg_numeral_02
46  {
47  A iterA;
48  int N1, N3;
49 
50  public:
51  T operator()(const int N2, const int N4) const
52  {
53  return iterA(N1, N2, N3, N4);
54  }
55  Ddg_numeral_02(const A &a, const int NN1, const int NN3)
56  : iterA(a), N1(NN1), N3(NN3)
57  {}
58  };
59 
60  /* Only first slot */
61 
62  /* I think I have to be careful to make sure that the indices are
63  matched correctly, because the expression that calls it is a
64  Dg. */
65 
66  template <class A, class T> class Ddg_numeral_0
67  {
68  A iterA;
69  int N1;
70 
71  public:
72  T operator()(const int N2, const int N3, const int N4) const
73  {
74  return iterA(N1, N4, N2, N3);
75  }
76  Ddg_numeral_0(const A &a, const int NN1) : iterA(a), N1(NN1) {}
77  };
78 
79  /* Second, third and fourth slot. */
80 
81  template <class A, class T> class Ddg_numeral_123
82  {
83  A iterA;
84  int N1, N2, N3;
85 
86  public:
87  T operator()(const int N0) const { return iterA(N0, N1, N2, N3); }
88  Ddg_numeral_123(const A &a, const int NN1, const int NN2, const int NN3)
89  : iterA(a), N1(NN1), N2(NN2), N3(NN3)
90  {}
91  };
92 }
Ddg_numeral_123(const A &a, const int NN1, const int NN2, const int NN3)
Definition: Ddg_numeral.hpp:88
T operator()(const int N3, const int N4) const
Definition: Ddg_numeral.hpp:17
Ddg_numeral_02(const A &a, const int NN1, const int NN3)
Definition: Ddg_numeral.hpp:55
T operator()(const int N2, const int N4) const
Definition: Ddg_numeral.hpp:51
T operator()(const int N2, const int N3, const int N4) const
Definition: Ddg_numeral.hpp:72
Ddg_numeral_23(const A &a, const int NN3, const int NN4)
Definition: Ddg_numeral.hpp:38
Fully Antisymmetric Levi-Civita Tensor.
T operator()(const int N0) const
Definition: Ddg_numeral.hpp:87
T operator()(const int N1, const int N2) const
Definition: Ddg_numeral.hpp:34
Ddg_numeral_01(const A &a, const int NN1, const int NN2)
Definition: Ddg_numeral.hpp:21
Ddg_numeral_0(const A &a, const int NN1)
Definition: Ddg_numeral.hpp:76