|
| v0.14.0
|
Go to the documentation of this file.
5 #include "../Tensor3.hpp"
9 template <
class T,
int Tensor_Dim0,
int Tensor_Dim12>
17 data[Tensor_Dim0][(Tensor_Dim12 * (Tensor_Dim12 + 1)) / 2];
20 template <
class...
U>
explicit Christof(
U *...
d) : inc(1), data{
d...} {
21 static_assert(
sizeof...(
d) ==
sizeof(data) /
sizeof(T),
22 "Incorrect number of Arguments. Constructor should "
23 "initialize the entire Tensor");
28 static_assert(
sizeof...(
d) ==
sizeof(data) /
sizeof(T),
29 "Incorrect number of Arguments. Constructor should "
30 "initialize the entire Tensor");
41 if(N1 >= Tensor_Dim0 || N1 < 0 || N2 >= Tensor_Dim12 || N2 < 0
42 || N3 >= Tensor_Dim12 || N3 < 0)
45 s <<
"Bad index in Christof<T*," << Tensor_Dim0 <<
","
46 << Tensor_Dim12 <<
">.operator(" << N1 <<
"," << N2 <<
"," << N3
48 throw std::out_of_range(s.str());
51 return N2 > N3 ? *data[N1][N2 + (N3 * (2 * Tensor_Dim12 - N3 - 1)) / 2]
52 : *data[N1][N3 + (N2 * (2 * Tensor_Dim12 - N2 - 1)) / 2];
55 T
operator()(
const int N1,
const int N2,
const int N3)
const
58 if(N1 >= Tensor_Dim0 || N1 < 0 || N2 >= Tensor_Dim12 || N2 < 0
59 || N3 >= Tensor_Dim12 || N3 < 0)
62 s <<
"Bad index in Christof<T*," << Tensor_Dim0 <<
","
63 << Tensor_Dim12 <<
">.operator(" << N1 <<
"," << N2 <<
"," << N3
64 <<
") const" << std::endl;
65 throw std::out_of_range(s.str());
68 return N2 > N3 ? *data[N1][N2 + (N3 * (2 * Tensor_Dim12 - N3 - 1)) / 2]
69 : *data[N1][N3 + (N2 * (2 * Tensor_Dim12 - N2 - 1)) / 2];
72 T *
ptr(
const int N1,
const int N2,
const int N3)
const
75 if(N1 >= Tensor_Dim0 || N1 < 0 || N2 >= Tensor_Dim12 || N2 < 0
76 || N3 >= Tensor_Dim12 || N3 < 0)
79 s <<
"Bad index in Christof<T*," << Tensor_Dim0 <<
","
80 << Tensor_Dim12 <<
">.ptr(" << N1 <<
"," << N2 <<
"," << N3 <<
")"
82 throw std::out_of_range(s.str());
85 return N2 > N3 ? data[N1][N2 + (N3 * (2 * Tensor_Dim12 - N3 - 1)) / 2]
86 : data[N1][N3 + (N2 * (2 * Tensor_Dim12 - N2 - 1)) / 2];
94 template <
char i,
char j,
char k,
int Dim0,
int Dim12>
103 template <
char i,
char j,
char k,
int Dim0,
int Dim12>
110 Dim0,
i,
j,
k>(*this);
117 template <
char i,
char j,
int Dim0,
int Dim12>
130 template <
char i,
char j,
int Dim02,
int Dim1>
143 template <
char i,
char j,
int Dim01,
int Dim2>
158 template <
char i,
char j,
int Dim0,
int Dim12>
171 template <
char i,
char j,
int Dim02,
int Dim1>
184 template <
char i,
char j,
int Dim01,
int Dim2>
200 template <
char i,
char j,
int N,
int Dim12>
219 template <
char i,
char j,
int Dim0,
int Dim2>
229 TensorExpr(*
this,
N));
232 template <
char i,
char j,
int Dim0,
int Dim2>
242 TensorExpr(*
this,
N));
250 for(
int i = 0;
i < Tensor_Dim0; ++
i)
251 for(
int j = 0;
j < (Tensor_Dim12 * (Tensor_Dim12 + 1)) / 2; ++
j)
262 template <
class T,
int Tensor_Dim0,
int Tensor_Dim12,
int I>
268 template <
class...
U>
278 for (
int i = 0;
i < Tensor_Dim0; ++
i)
279 for (
int j = 0;
j < (Tensor_Dim12 * (Tensor_Dim12 + 1)) / 2; ++
j)
Tensor1_Expr< const Tensor3_contracted_12< const Christof< T *, Tensor_Dim0, Tensor_Dim12 >, T, Dim12 >, T, Dim0, i > operator()(const Index< i, Dim0 > index1, const Index< j, Dim12 > index2, const Index< j, Dim12 > index3)
Tensor1_Expr< const Tensor3_contracted_02< const Christof< T *, Tensor_Dim0, Tensor_Dim12 >, T, Dim02 >, T, Dim1, i > operator()(const Index< j, Dim02 > index1, const Index< i, Dim1 > index2, const Index< j, Dim02 > index3)
T operator()(const int N1, const int N2, const int N3) const
const Tensor1_Expr< const dTensor0< T, Dim, i >, typename promote< T, double >::V, Dim, i > d(const Tensor0< T * > &a, const Index< i, Dim > index, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
Tensor2_symmetric_Expr< const Christof_number_0< const Christof< T *, Tensor_Dim0, Tensor_Dim12 >, T, N >, T, Dim12, i, j > operator()(const Number< N > n1, const Index< i, Dim12 > index1, const Index< j, Dim12 > index2) const
Tensor2_Expr< const Christof_numeral_1< const Christof< T *, Tensor_Dim0, Tensor_Dim12 >, T >, T, Dim0, Dim2, i, j > operator()(const Index< i, Dim0 > index1, const Index< j, Dim2 > index2, const int N) const
Tensor1_Expr< const Tensor3_contracted_01< const Christof< T *, Tensor_Dim0, Tensor_Dim12 >, T, Dim01 >, T, Dim2, i > operator()(const Index< j, Dim01 > index1, const Index< j, Dim01 > index2, const Index< i, Dim2 > index3) const
Christof(const int i, U *... d)
constexpr IntegrationType I
Dg_Expr< const Christof< T *, Tensor_Dim0, Tensor_Dim12 >, T, Dim12, Dim0, i, j, k > operator()(const Index< k, Dim0 > index1, const Index< i, Dim12 > index2, const Index< j, Dim12 > index3) const
Tensor1_Expr< const Tensor3_contracted_02< const Christof< T *, Tensor_Dim0, Tensor_Dim12 >, T, Dim02 >, T, Dim1, i > operator()(const Index< j, Dim02 > index1, const Index< i, Dim1 > index2, const Index< j, Dim02 > index3) const
const Christof< T *, Tensor_Dim0, Tensor_Dim12 > & operator++() const
FTensor::Index< 'i', SPACE_DIM > i
Tensor2_Expr< const Christof_numeral_1< const Christof< T *, Tensor_Dim0, Tensor_Dim12 >, T >, T, Dim0, Dim2, i, j > operator()(const Index< i, Dim0 > index1, const int N, const Index< j, Dim2 > index2) const
T & operator()(const int N1, const int N2, const int N3)
Tensor1_Expr< const Tensor3_contracted_01< const Christof< T *, Tensor_Dim0, Tensor_Dim12 >, T, Dim01 >, T, Dim2, i > operator()(const Index< j, Dim01 > index1, const Index< j, Dim01 > index2, const Index< i, Dim2 > index3)
Tensor1_Expr< const Tensor3_contracted_12< const Christof< T *, Tensor_Dim0, Tensor_Dim12 >, T, Dim12 >, T, Dim0, i > operator()(const Index< i, Dim0 > index1, const Index< j, Dim12 > index2, const Index< j, Dim12 > index3) const
FTensor::Index< 'j', 3 > j
Dg_Expr< Christof< T *, Tensor_Dim0, Tensor_Dim12 >, T, Dim12, Dim0, i, j, k > operator()(const Index< k, Dim0 > index1, const Index< i, Dim12 > index2, const Index< j, Dim12 > index3)
FTensor::Index< 'k', 3 > k
const Christof< PackPtr< T *, I >, Tensor_Dim0, Tensor_Dim12 > & operator++() const
T * ptr(const int N1, const int N2, const int N3) const