v0.14.0
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  {
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  {
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  {
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  {
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 }
FTensor::Dg_number_2::Dg_number_2
Dg_number_2(const A &a)
Definition: Dg_number.hpp:31
FTensor
JSON compatible output.
Definition: Christof_constructor.hpp:6
FTensor::Dg_number_12
Definition: Dg_number.hpp:39
FTensor::Dg_number_2
Definition: Dg_number.hpp:25
FTensor::Dg_number_12::iterA
A iterA
Definition: Dg_number.hpp:41
FTensor::Dg_number_0::Dg_number_0
Dg_number_0(const A &a)
Definition: Dg_number.hpp:17
A
constexpr AssemblyType A
Definition: operators_tests.cpp:30
FTensor::Dg_number_0::operator()
T operator()(const int N1, const int N2) const
Definition: Dg_number.hpp:16
FTensor::Dg_number_2::operator()
T operator()(const int N1, const int N2) const
Definition: Dg_number.hpp:30
a
constexpr double a
Definition: approx_sphere.cpp:30
FTensor::Dg_number_rhs_2
Definition: Dg_number.hpp:34
FTensor::Dg_number_01
Definition: Dg_number.hpp:53
FTensor::Dg_number_01::iterA
A iterA
Definition: Dg_number.hpp:55
FTensor::Dg_number_2::iterA
A iterA
Definition: Dg_number.hpp:27
FTensor::Dg_number_01::Dg_number_01
Dg_number_01(const A &a)
Definition: Dg_number.hpp:59
N
const int N
Definition: speed_test.cpp:3
FTensor::Dg_number_0
Definition: Dg_number.hpp:11
FTensor::Dg_number_rhs_01
Definition: Dg_number.hpp:62
FTensor::Dg_number_rhs_12
Definition: Dg_number.hpp:48
FTensor::Dg_number_12::Dg_number_12
Dg_number_12(const A &a)
Definition: Dg_number.hpp:45
FTensor::Dg_number_12::operator()
T operator()(const int N) const
Definition: Dg_number.hpp:44
FTensor::Dg_number_rhs_0
Definition: Dg_number.hpp:20
FTensor::Dg_number_01::operator()
T operator()(const int N) const
Definition: Dg_number.hpp:58
FTensor::Dg_number_0::iterA
A iterA
Definition: Dg_number.hpp:13