v0.8.4
Tensor1_constructor.hpp
Go to the documentation of this file.
1 /* A helper class that allows simple initialization of the Tensor1,
2  but only if it has the correct number of elements. */
3 
4 #pragma once
5 
6 namespace FTensor
7 {
8  template <class T, int Tensor_Dim> class Tensor1_constructor;
9 
10  template <class T> class Tensor1_constructor<T, 1>
11  {
12  public:
13  Tensor1_constructor(T data[], T d0) { data[0] = d0; }
14  };
15 
16  template <class T> class Tensor1_constructor<T, 2>
17  {
18  public:
19  Tensor1_constructor(T data[], T d0, T d1)
20  {
21  data[0] = d0;
22  data[1] = d1;
23  }
24  };
25 
26  template <class T> class Tensor1_constructor<T, 3>
27  {
28  public:
29  Tensor1_constructor(T data[], T d0, T d1, T d2)
30  {
31  data[0] = d0;
32  data[1] = d1;
33  data[2] = d2;
34  }
35  };
36 
37  template <class T> class Tensor1_constructor<T, 4>
38  {
39  public:
40  Tensor1_constructor(T data[], T d0, T d1, T d2, T d3)
41  {
42  data[0] = d0;
43  data[1] = d1;
44  data[2] = d2;
45  data[3] = d3;
46  }
47  };
48 }
Tensor1_constructor(T data[], T d0, T d1, T d2)
Fully Antisymmetric Levi-Civita Tensor.
Tensor1_constructor(T data[], T d0, T d1, T d2, T d3)