v0.14.0
Tensor4_numeral.hpp
Go to the documentation of this file.
1 /* This is for expressions where a number is used for one. two or three
2  slots, and an index for the others, yielding a Tensor1_Expr, Tensor2_Expr or
3  Tensor3_Expr. */
4 
5 #pragma once
6 
7 namespace FTensor
8 {
9 
10  /* Third slot. */
11 
12  template <class A, class T> class Tensor4_numeral_2
13  {
15  int N;
16 
17  public:
18  T operator()(const int N0, const int N1, const int N2) const {
19  return iterA(N0, N1, N, N2);
20  }
21  Tensor4_numeral_2(const A &a, const int NN) : iterA(a), N(NN) {}
22  };
23 
24  /* Forth slot. */
25 
26  template <class A, class T> class Tensor4_numeral_3
27  {
29  int N;
30 
31  public:
32  T operator()(const int N0, const int N1, const int N2) const {
33  return iterA(N0, N1, N2, N);
34  }
35  Tensor4_numeral_3(const A &a, const int NN) : iterA(a), N(NN) {}
36  };
37 
38 
39 }
FTensor
JSON compatible output.
Definition: Christof_constructor.hpp:6
FTensor::Tensor4_numeral_3
Definition: Tensor4_numeral.hpp:26
A
constexpr AssemblyType A
Definition: operators_tests.cpp:30
FTensor::Tensor4_numeral_3::Tensor4_numeral_3
Tensor4_numeral_3(const A &a, const int NN)
Definition: Tensor4_numeral.hpp:35
FTensor::Tensor4_numeral_3::operator()
T operator()(const int N0, const int N1, const int N2) const
Definition: Tensor4_numeral.hpp:32
FTensor::Tensor4_numeral_2
Definition: Tensor4_numeral.hpp:12
a
constexpr double a
Definition: approx_sphere.cpp:30
FTensor::Tensor4_numeral_2::Tensor4_numeral_2
Tensor4_numeral_2(const A &a, const int NN)
Definition: Tensor4_numeral.hpp:21
FTensor::Tensor4_numeral_2::operator()
T operator()(const int N0, const int N1, const int N2) const
Definition: Tensor4_numeral.hpp:18
FTensor::Tensor4_numeral_3::N
int N
Definition: Tensor4_numeral.hpp:29
FTensor::Tensor4_numeral_2::N
int N
Definition: Tensor4_numeral.hpp:15
FTensor::Tensor4_numeral_3::iterA
A iterA
Definition: Tensor4_numeral.hpp:28
FTensor::Tensor4_numeral_2::iterA
A iterA
Definition: Tensor4_numeral.hpp:14