v0.14.0
Loading...
Searching...
No Matches
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
7namespace 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}
static Number< 2 > N2
static Number< 1 > N1
constexpr double a
Dg_number_01(const A &a)
Definition: Dg_number.hpp:59
T operator()(const int N) const
Definition: Dg_number.hpp:58
T operator()(const int N1, const int N2) const
Definition: Dg_number.hpp:16
Dg_number_0(const A &a)
Definition: Dg_number.hpp:17
T operator()(const int N) const
Definition: Dg_number.hpp:44
Dg_number_12(const A &a)
Definition: Dg_number.hpp:45
Dg_number_2(const A &a)
Definition: Dg_number.hpp:31
T operator()(const int N1, const int N2) const
Definition: Dg_number.hpp:30
const double T
Tensors class implemented by Walter Landry.
Definition: FTensor.hpp:51
constexpr AssemblyType A
const int N
Definition: speed_test.cpp:3