|
| v0.14.0
|
Go to the documentation of this file.
7 template <
class T,
int Tensor_Dim01,
int Tensor_Dim2>
8 class Dg<T *, Tensor_Dim01, Tensor_Dim2>
14 data[(Tensor_Dim01 * (Tensor_Dim01 + 1)) / 2][Tensor_Dim2];
18 template <
class...
U>
Dg(
U *...
d) : data{
d...}
20 static_assert(
sizeof...(
d) ==
sizeof(data) /
sizeof(T),
21 "Incorrect number of Arguments. Constructor should "
22 "initialize the entire Tensor");
33 if(N1 >= Tensor_Dim01 || N1 < 0 || N2 >= Tensor_Dim01 || N2 < 0
34 || N3 >= Tensor_Dim2 || N3 < 0)
37 s <<
"Bad index in Dg<T*," << Tensor_Dim01 <<
"," << Tensor_Dim2
38 <<
">.operator(" << N1 <<
"," << N2 <<
"," << N3 <<
")"
40 throw std::out_of_range(s.str());
43 return N1 > N2 ? *data[N1 + (N2 * (2 * Tensor_Dim01 - N2 - 1)) / 2][N3]
44 : *data[N2 + (N1 * (2 * Tensor_Dim01 - N1 - 1)) / 2][N3];
47 T
operator()(
const int N1,
const int N2,
const int N3)
const
50 if(N1 >= Tensor_Dim01 || N1 < 0 || N2 >= Tensor_Dim01 || N2 < 0
51 || N3 >= Tensor_Dim2 || N3 < 0)
54 s <<
"Bad index in Dg<T*," << Tensor_Dim01 <<
"," << Tensor_Dim2
55 <<
">.operator(" << N1 <<
"," << N2 <<
"," << N3 <<
") const"
57 throw std::out_of_range(s.str());
60 return N1 > N2 ? *data[N1 + (N2 * (2 * Tensor_Dim01 - N2 - 1)) / 2][N3]
61 : *data[N2 + (N1 * (2 * Tensor_Dim01 - N1 - 1)) / 2][N3];
64 T *
ptr(
const int N1,
const int N2,
const int N3)
const
67 if(N1 >= Tensor_Dim01 || N1 < 0 || N2 >= Tensor_Dim01 || N2 < 0
68 || N3 >= Tensor_Dim2 || N3 < 0)
71 s <<
"Bad index in Dg<T," << Tensor_Dim01 <<
"," << Tensor_Dim2
72 <<
">.ptr(" << N1 <<
"," << N2 <<
"," << N3 <<
")" << std::endl;
73 throw std::out_of_range(s.str());
76 return N1 > N2 ? data[N1 + (N2 * (2 * Tensor_Dim01 - N2 - 1)) / 2][N3]
77 : data[N2 + (N1 * (2 * Tensor_Dim01 - N1 - 1)) / 2][N3];
83 template <
char i,
char j,
char k,
int Dim01,
int Dim2>
92 template <
char i,
char j,
char k,
int Dim01,
int Dim2>
106 template <
char i,
char j,
int Dim>
118 template <
char i,
char j,
int Dim>
152 template <
char i,
char j,
int Dim01,
int Dim2>
172 template <
char i,
char j,
int N,
int Dim1,
int Dim2>
183 template <
char i,
char j,
int N,
int Dim1,
int Dim2>
197 template <
char i,
char j,
int N,
int Dim0,
int Dim2>
208 template <
char i,
char j,
int N,
int Dim0,
int Dim2>
222 template <
char i,
char j,
int N,
int Dim>
233 template <
char i,
char j,
int N,
int Dim>
253 template <
char i,
int N1,
int N2,
int Dim>
264 template <
char i,
int N1,
int N2,
int Dim>
280 template <
char i,
int N1,
int N2,
int Dim>
291 template <
char i,
int N1,
int N2,
int Dim>
305 template <
char i,
int N1,
int N2,
int Dim>
316 template <
char i,
int N1,
int N2,
int Dim>
335 template <
char i,
char j,
int Dim1,
int Dim2>
345 TensorExpr(*
this,
N));
350 template <
char i,
char j,
int Dim0,
int Dim2>
360 TensorExpr(*
this,
N));
365 template <
char i,
char j,
int Dim>
375 TensorExpr(*
this,
N));
383 template <
char i,
int Dim>
398 template <
char i,
int Dim>
411 template <
char i,
int Dim>
427 for(
int i = 0;
i < (Tensor_Dim01 * (Tensor_Dim01 + 1)) / 2; ++
i)
428 for(
int j = 0;
j < Tensor_Dim2; ++
j)
438 template <
class T,
int Tensor_Dim01,
int Tensor_Dim2,
int I>
443 template <
class...
U>
444 Dg(
U *...
d) :
Dg<T *, Tensor_Dim01, Tensor_Dim2>(
d...) {}
446 Dg() :
Dg<T *, Tensor_Dim01, Tensor_Dim2>() {}
452 for (
int i = 0;
i < (Tensor_Dim01 * (Tensor_Dim01 + 1)) / 2; ++
i)
453 for (
int j = 0;
j < Tensor_Dim2; ++
j)
Tensor1_Expr< Dg_number_rhs_12< Dg< T *, Tensor_Dim01, Tensor_Dim2 >, T, N1, N2 >, T, Dim, i > operator()(const Index< i, Dim > index, const Number< N1 > n1, const Number< N2 > n2)
Tensor1_Expr< const Tensor3_contracted_12< Dg< T *, Tensor_Dim01, Tensor_Dim2 >, T, Dim >, T, Dim, i > operator()(const Index< i, Dim > index1, const Index< j, Dim > index2, const Index< j, Dim > index3) const
const Tensor2_symmetric_Expr< const Dg_numeral_2< const Dg< T *, Tensor_Dim01, Tensor_Dim2 >, T >, T, Dim, i, j > operator()(const Index< i, Dim > index1, const Index< j, Dim > index2, const int N) const
const Tensor2_Expr< const Dg_numeral_0< const Dg< T *, Tensor_Dim01, Tensor_Dim2 >, T >, T, Dim1, Dim2, i, j > operator()(const int N, const Index< i, Dim1 > index1, const Index< j, Dim2 > index2) const
const Tensor2_Expr< const Dg_number_0< const Dg< T *, Tensor_Dim01, Tensor_Dim2 >, T, N >, T, Dim1, Dim2, i, j > operator()(const Number< N > n1, const Index< i, Dim1 > index1, const Index< j, Dim2 > index2) 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)
Dg_Expr< Dg< T *, Tensor_Dim01, Tensor_Dim2 >, T, Dim01, Dim2, i, j, k > operator()(const Index< i, Dim01 > index1, const Index< j, Dim01 > index2, const Index< k, Dim2 > index3)
T & operator()(const int N1, const int N2, const int N3)
constexpr IntegrationType I
const Tensor1_Expr< const Dg_numeral_12< const Dg< T *, Tensor_Dim01, Tensor_Dim2 >, T >, T, Dim, i > operator()(const Index< i, Dim > index, const int N1, const int N2) const
Tensor2_symmetric_Expr< Dg_number_rhs_2< Dg< T *, Tensor_Dim01, Tensor_Dim2 >, T, N >, T, Dim, i, j > operator()(const Index< i, Dim > index1, const Index< j, Dim > index2, const Number< N > n1)
Dg_Expr< const Dg< T *, Tensor_Dim01, Tensor_Dim2 >, T, Dim01, Dim2, i, j, k > operator()(const Index< i, Dim01 > index1, const Index< j, Dim01 > index2, const Index< k, Dim2 > index3) const
Tensor1_Expr< const Tensor3_contracted_01< Dg< T *, Tensor_Dim01, Tensor_Dim2 >, T, Dim01 >, T, Dim2, i > operator()(const Index< j, Dim01 > index1, const Index< j, Dim01 > index2, const Index< i, Dim2 > index3) const
const Dg & operator++() const
const Tensor1_Expr< const Dg_number_12< const Dg< T *, Tensor_Dim01, Tensor_Dim2 >, T, N1, N2 >, T, Dim, i > operator()(const Number< N1 > n1, const Index< i, Dim > index, const Number< N2 > n2) const
Tensor1_Expr< Dg_number_rhs_12< Dg< T *, Tensor_Dim01, Tensor_Dim2 >, T, N1, N2 >, T, Dim, i > operator()(const Number< N1 > n1, const Index< i, Dim > index, const Number< N2 > n2)
const Tensor2_Expr< const Dg_numeral_0< const Dg< T *, Tensor_Dim01, Tensor_Dim2 >, T >, T, Dim0, Dim2, i, j > operator()(const Index< i, Dim0 > index1, const int N, const Index< j, Dim2 > index2) const
const Dg< T *, Tensor_Dim01, Tensor_Dim2 > & operator++() const
Tensor1_Expr< Dg_number_rhs_01< Dg< T *, Tensor_Dim01, Tensor_Dim2 >, T, N1, N2 >, T, Dim, i > operator()(const Number< N1 > n1, const Number< N2 > n2, const Index< i, Dim > index)
FTensor::Index< 'i', SPACE_DIM > i
const Tensor1_Expr< const Dg_numeral_01< const Dg< T *, Tensor_Dim01, Tensor_Dim2 >, T >, T, Dim, i > operator()(const int N1, const int N2, const Index< i, Dim > index) const
T operator()(const int N1, const int N2, const int N3) const
Tensor2_Expr< Dg_number_rhs_0< Dg< T *, Tensor_Dim01, Tensor_Dim2 >, T, N >, T, Dim1, Dim2, i, j > operator()(const Number< N > n1, const Index< i, Dim1 > index1, const Index< j, Dim2 > index2)
const Tensor1_Expr< const Dg_numeral_12< const Dg< T *, Tensor_Dim01, Tensor_Dim2 >, T >, T, Dim, i > operator()(const int N1, const Index< i, Dim > index, const int N2) const
Tensor1_Expr< const Tensor3_contracted_02< Dg< T *, Tensor_Dim01, Tensor_Dim2 >, T, Dim >, T, Dim, i > operator()(const Index< j, Dim > index1, const Index< i, Dim > index2, const Index< j, Dim > index3) const
Tensor2_Expr< Dg_number_rhs_0< Dg< T *, Tensor_Dim01, Tensor_Dim2 >, T, N >, T, Dim0, Dim2, i, j > operator()(const Index< i, Dim0 > index1, const Number< N > n1, const Index< j, Dim2 > index2)
FTensor::Index< 'j', 3 > j
const Tensor1_Expr< const Dg_number_12< const Dg< T *, Tensor_Dim01, Tensor_Dim2 >, T, N1, N2 >, T, Dim, i > operator()(const Index< i, Dim > index, const Number< N1 > n1, const Number< N2 > n2) const
const Tensor2_symmetric_Expr< const Dg_number_2< const Dg< T *, Tensor_Dim01, Tensor_Dim2 >, T, N >, T, Dim, i, j > operator()(const Index< i, Dim > index1, const Index< j, Dim > index2, const Number< N > n1) const
const Tensor1_Expr< const Dg_number_01< const Dg< T *, Tensor_Dim01, Tensor_Dim2 >, T, N1, N2 >, T, Dim, i > operator()(const Number< N1 > n1, const Number< N2 > n2, const Index< i, Dim > index) const
const Tensor2_Expr< const Dg_number_0< const Dg< T *, Tensor_Dim01, Tensor_Dim2 >, T, N >, T, Dim0, Dim2, i, j > operator()(const Index< i, Dim0 > index1, const Number< N > n1, const Index< j, Dim2 > index2) const
T * ptr(const int N1, const int N2, const int N3) const
FTensor::Index< 'k', 3 > k