v0.14.0
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  {
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  {
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  {
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  {
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  {
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 }
FTensor::Ddg_numeral_123::N2
int N2
Definition: Ddg_numeral.hpp:84
FTensor
JSON compatible output.
Definition: Christof_constructor.hpp:6
FTensor::Ddg_numeral_123
Definition: Ddg_numeral.hpp:81
FTensor::Ddg_numeral_23::operator()
T operator()(const int N1, const int N2) const
Definition: Ddg_numeral.hpp:34
FTensor::Ddg_numeral_0::N1
int N1
Definition: Ddg_numeral.hpp:69
FTensor::Ddg_numeral_123::N1
int N1
Definition: Ddg_numeral.hpp:84
FTensor::Ddg_numeral_01::N2
int N2
Definition: Ddg_numeral.hpp:14
FTensor::Ddg_numeral_02
Definition: Ddg_numeral.hpp:45
FTensor::Ddg_numeral_0::operator()
T operator()(const int N2, const int N3, const int N4) const
Definition: Ddg_numeral.hpp:72
FTensor::Ddg_numeral_02::N1
int N1
Definition: Ddg_numeral.hpp:48
A
constexpr AssemblyType A
Definition: operators_tests.cpp:30
FTensor::Ddg_numeral_01::Ddg_numeral_01
Ddg_numeral_01(const A &a, const int NN1, const int NN2)
Definition: Ddg_numeral.hpp:21
FTensor::Ddg_numeral_0
Definition: Ddg_numeral.hpp:66
FTensor::Ddg_numeral_123::iterA
A iterA
Definition: Ddg_numeral.hpp:83
FTensor::Ddg_numeral_23
Definition: Ddg_numeral.hpp:28
FTensor::Ddg_numeral_01
Definition: Ddg_numeral.hpp:11
FTensor::Ddg_numeral_123::N3
int N3
Definition: Ddg_numeral.hpp:84
FTensor::Ddg_numeral_23::Ddg_numeral_23
Ddg_numeral_23(const A &a, const int NN3, const int NN4)
Definition: Ddg_numeral.hpp:38
a
constexpr double a
Definition: approx_sphere.cpp:30
FTensor::Ddg_numeral_0::Ddg_numeral_0
Ddg_numeral_0(const A &a, const int NN1)
Definition: Ddg_numeral.hpp:76
FTensor::Ddg_numeral_02::N3
int N3
Definition: Ddg_numeral.hpp:48
FTensor::Ddg_numeral_0::iterA
A iterA
Definition: Ddg_numeral.hpp:68
FTensor::Ddg_numeral_01::operator()
T operator()(const int N3, const int N4) const
Definition: Ddg_numeral.hpp:17
FTensor::Ddg_numeral_02::iterA
A iterA
Definition: Ddg_numeral.hpp:47
FTensor::Ddg_numeral_02::Ddg_numeral_02
Ddg_numeral_02(const A &a, const int NN1, const int NN3)
Definition: Ddg_numeral.hpp:55
FTensor::Ddg_numeral_01::N1
int N1
Definition: Ddg_numeral.hpp:14
FTensor::Ddg_numeral_01::iterA
A iterA
Definition: Ddg_numeral.hpp:13
FTensor::Ddg_numeral_23::iterA
A iterA
Definition: Ddg_numeral.hpp:30
FTensor::Ddg_numeral_123::Ddg_numeral_123
Ddg_numeral_123(const A &a, const int NN1, const int NN2, const int NN3)
Definition: Ddg_numeral.hpp:88
FTensor::Ddg_numeral_23::N3
int N3
Definition: Ddg_numeral.hpp:31
FTensor::Ddg_numeral_123::operator()
T operator()(const int N0) const
Definition: Ddg_numeral.hpp:87
FTensor::Ddg_numeral_23::N4
int N4
Definition: Ddg_numeral.hpp:31
FTensor::Ddg_numeral_02::operator()
T operator()(const int N2, const int N4) const
Definition: Ddg_numeral.hpp:51