v0.14.0
Dg_numeral.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> class Dg_numeral_0
12  {
14  int N;
15 
16  public:
17  T operator()(const int N1, const int N2) const { return iterA(N, N1, N2); }
18  Dg_numeral_0(const A &a, const int NN) : iterA(a), N(NN) {}
19  };
20 
21  /* Third slot. */
22 
23  template <class A, class T> class Dg_numeral_2
24  {
26  int N;
27 
28  public:
29  T operator()(const int N1, const int N2) const { return iterA(N1, N2, N); }
30  Dg_numeral_2(const A &a, const int NN) : iterA(a), N(NN) {}
31  };
32 
33  /* Second and third slot (or first and third slot). */
34 
35  template <class A, class T> class Dg_numeral_12
36  {
38  int N1, N2;
39 
40  public:
41  T operator()(const int N) const { return iterA(N, N1, N2); }
42  Dg_numeral_12(const A &a, const int NN1, const int NN2)
43  : iterA(a), N1(NN1), N2(NN2)
44  {}
45  };
46 
47  /* First and second slot. */
48 
49  template <class A, class T> class Dg_numeral_01
50  {
52  int N1, N2;
53 
54  public:
55  T operator()(const int N) const { return iterA(N1, N2, N); }
56  Dg_numeral_01(const A &a, const int NN1, const int NN2)
57  : iterA(a), N1(NN1), N2(NN2)
58  {}
59  };
60 }
FTensor::Dg_numeral_01::Dg_numeral_01
Dg_numeral_01(const A &a, const int NN1, const int NN2)
Definition: Dg_numeral.hpp:56
FTensor::Dg_numeral_2::iterA
A iterA
Definition: Dg_numeral.hpp:25
FTensor::Dg_numeral_0::operator()
T operator()(const int N1, const int N2) const
Definition: Dg_numeral.hpp:17
FTensor::Dg_numeral_0::iterA
A iterA
Definition: Dg_numeral.hpp:13
FTensor
JSON compatible output.
Definition: Christof_constructor.hpp:6
FTensor::Dg_numeral_01
Definition: Dg_numeral.hpp:49
FTensor::Dg_numeral_12::Dg_numeral_12
Dg_numeral_12(const A &a, const int NN1, const int NN2)
Definition: Dg_numeral.hpp:42
FTensor::Dg_numeral_0::N
int N
Definition: Dg_numeral.hpp:14
FTensor::Dg_numeral_2::N
int N
Definition: Dg_numeral.hpp:26
FTensor::Dg_numeral_2::Dg_numeral_2
Dg_numeral_2(const A &a, const int NN)
Definition: Dg_numeral.hpp:30
FTensor::Dg_numeral_12::operator()
T operator()(const int N) const
Definition: Dg_numeral.hpp:41
A
constexpr AssemblyType A
Definition: operators_tests.cpp:30
FTensor::Dg_numeral_12::iterA
A iterA
Definition: Dg_numeral.hpp:37
FTensor::Dg_numeral_0
Definition: Dg_numeral.hpp:11
FTensor::Dg_numeral_01::N2
int N2
Definition: Dg_numeral.hpp:52
a
constexpr double a
Definition: approx_sphere.cpp:30
FTensor::Dg_numeral_01::N1
int N1
Definition: Dg_numeral.hpp:52
FTensor::Dg_numeral_12
Definition: Dg_numeral.hpp:35
N
const int N
Definition: speed_test.cpp:3
FTensor::Dg_numeral_2::operator()
T operator()(const int N1, const int N2) const
Definition: Dg_numeral.hpp:29
FTensor::Dg_numeral_01::iterA
A iterA
Definition: Dg_numeral.hpp:51
FTensor::Dg_numeral_01::operator()
T operator()(const int N) const
Definition: Dg_numeral.hpp:55
FTensor::Dg_numeral_12::N2
int N2
Definition: Dg_numeral.hpp:38
FTensor::Dg_numeral_12::N1
int N1
Definition: Dg_numeral.hpp:38
FTensor::Dg_numeral_2
Definition: Dg_numeral.hpp:23
FTensor::Dg_numeral_0::Dg_numeral_0
Dg_numeral_0(const A &a, const int NN)
Definition: Dg_numeral.hpp:18