v0.15.0
Loading...
Searching...
No Matches
Tensor2_antisymmetric_constructor.hpp
Go to the documentation of this file.
1/* A helper class that allows simple initialization of the
2 Tensor2_antisymmetric, but only if it has the correct number of elements. */
3
4#pragma once
5
6namespace FTensor
7{
8 template <class T, int Tensor_Dim> class Tensor2_antisymmetric_constructor;
9
10 template <class T> class Tensor2_antisymmetric_constructor<T, 2>
11 {
12 public:
13 Tensor2_antisymmetric_constructor(T data[(1 * 2) / 2], T d01)
14 {
15 data[0] = d01;
16 }
17 };
18
19 template <class T> class Tensor2_antisymmetric_constructor<T, 3>
20 {
21 public:
22 Tensor2_antisymmetric_constructor(T data[(2 * 3) / 2], T d01, T d02, T d12)
23 {
24 data[0] = d01;
25 data[1] = d02;
26 data[2] = d12;
27 }
28 };
29
30 template <class T> class Tensor2_antisymmetric_constructor<T, 4>
31 {
32 public:
33 Tensor2_antisymmetric_constructor(T data[(3 * 4) / 2], T d01, T d02, T d03,
34 T d12, T d13, T d23)
35 {
36 data[0] = d01;
37 data[1] = d02;
38 data[2] = d03;
39 data[3] = d12;
40 data[4] = d13;
41 data[5] = d23;
42 }
43 };
44}
Tensor2_antisymmetric_constructor(T data[(3 *4)/2], T d01, T d02, T d03, T d12, T d13, T d23)
Tensors class implemented by Walter Landry.
Definition FTensor.hpp:51