v0.10.0
Ddg_number.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, int N1, int N2> class Ddg_number_01
12  {
13  A iterA;
14 
15  public:
16  T operator()(const int N3, const int N4) const
17  {
18  return iterA(N1, N2, N3, N4);
19  }
20  Ddg_number_01(const A &a) : iterA(a) {}
21  };
22 
23  template <class A, class T, int N0, int N1> class Ddg_number_rhs_01
24  {};
25 
26  /* Only first slot */
27 
28  template <class A, class T, int N1> class Ddg_number_0
29  {
30  A iterA;
31 
32  public:
33  T operator()(const int N2, const int N3, const int N4) const
34  {
35  return iterA(N1, N2, N3, N4);
36  }
37  Ddg_number_0(const A &a) : iterA(a) {}
38  };
39 
40  template <class A, class T, int N0> class Ddg_number_rhs_0
41  {};
42 }
Ddg_number_01(const A &a)
Definition: Ddg_number.hpp:20
JSON compatible output.
static Number< 2 > N2
static Number< 1 > N1
T operator()(const int N2, const int N3, const int N4) const
Definition: Ddg_number.hpp:33
Ddg_number_0(const A &a)
Definition: Ddg_number.hpp:37
T operator()(const int N3, const int N4) const
Definition: Ddg_number.hpp:16