v0.8.7
Public Member Functions | Private Attributes | List of all members
FTensor::Dg< T *, Tensor_Dim01, Tensor_Dim2 > Class Template Reference

#include <src/ftensor/src/FTensor/Dg/Dg_pointer.hpp>

Public Member Functions

template<class... U>
 Dg (U *... d)
 
 Dg ()
 
T & operator() (const int N1, const int N2, const int N3)
 
operator() (const int N1, const int N2, const int N3) const
 
T * ptr (const int N1, const int N2, const int N3) const
 
template<char i, char j, char k, int Dim01, int Dim2>
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)
 
template<char i, char j, char k, int Dim01, int Dim2>
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
 
template<char i, char j, int Dim>
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
 
template<char i, char j, int Dim>
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
 
template<char i, char j, int Dim01, int Dim2>
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
 
template<char i, char j, int N, int Dim1, int Dim2>
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)
 
template<char i, char j, int N, int Dim1, int Dim2>
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
 
template<char i, char j, int N, int Dim0, int Dim2>
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)
 
template<char i, char j, int N, int Dim0, int Dim2>
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
 
template<char i, char j, int N, int Dim>
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)
 
template<char i, char j, int N, int Dim>
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
 
template<char i, int N1, int N2, int Dim>
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)
 
template<char i, int N1, int N2, int Dim>
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
 
template<char i, int N1, int N2, int Dim>
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)
 
template<char i, int N1, int N2, int Dim>
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
 
template<char i, int N1, int N2, int Dim>
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)
 
template<char i, int N1, int N2, int Dim>
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
 
template<char i, char j, int Dim1, int Dim2>
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
 
template<char i, char j, int Dim0, int Dim2>
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
 
template<char i, char j, int Dim>
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
 
template<char i, int Dim>
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
 
template<char i, int Dim>
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
 
template<char i, int Dim>
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
 
const Dg< T *, Tensor_Dim01, Tensor_Dim2 > & operator++ () const
 

Private Attributes

T *restrict data [(Tensor_Dim01 *(Tensor_Dim01+1))/2][Tensor_Dim2]
 

Detailed Description

template<class T, int Tensor_Dim01, int Tensor_Dim2>
class FTensor::Dg< T *, Tensor_Dim01, Tensor_Dim2 >

Definition at line 8 of file Dg_pointer.hpp.

Constructor & Destructor Documentation

◆ Dg() [1/2]

template<class T , int Tensor_Dim01, int Tensor_Dim2>
template<class... U>
FTensor::Dg< T *, Tensor_Dim01, Tensor_Dim2 >::Dg ( U *...  d)

Definition at line 15 of file Dg_pointer.hpp.

15  : data{d...}
16  {
17  static_assert(sizeof...(d) == sizeof(data) / sizeof(T),
18  "Incorrect number of Arguments. Constructor should "
19  "initialize the entire Tensor");
20  }
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)
Definition: dTensor0.hpp:27
T *restrict data[(Tensor_Dim01 *(Tensor_Dim01+1))/2][Tensor_Dim2]
Definition: Dg_pointer.hpp:11

◆ Dg() [2/2]

template<class T , int Tensor_Dim01, int Tensor_Dim2>
FTensor::Dg< T *, Tensor_Dim01, Tensor_Dim2 >::Dg ( )

Definition at line 22 of file Dg_pointer.hpp.

22 {}

Member Function Documentation

◆ operator()() [1/25]

template<class T , int Tensor_Dim01, int Tensor_Dim2>
T& FTensor::Dg< T *, Tensor_Dim01, Tensor_Dim2 >::operator() ( const int  N1,
const int  N2,
const int  N3 
)

Definition at line 27 of file Dg_pointer.hpp.

28  {
29 #ifdef FTENSOR_DEBUG
30  if(N1 >= Tensor_Dim01 || N1 < 0 || N2 >= Tensor_Dim01 || N2 < 0
31  || N3 >= Tensor_Dim2 || N3 < 0)
32  {
33  std::stringstream s;
34  s << "Bad index in Dg<T*," << Tensor_Dim01 << "," << Tensor_Dim2
35  << ">.operator(" << N1 << "," << N2 << "," << N3 << ")"
36  << std::endl;
37  throw std::out_of_range(s.str());
38  }
39 #endif
40  return N1 > N2 ? *data[N1 + (N2 * (2 * Tensor_Dim01 - N2 - 1)) / 2][N3]
41  : *data[N2 + (N1 * (2 * Tensor_Dim01 - N1 - 1)) / 2][N3];
42  }
T *restrict data[(Tensor_Dim01 *(Tensor_Dim01+1))/2][Tensor_Dim2]
Definition: Dg_pointer.hpp:11

◆ operator()() [2/25]

template<class T , int Tensor_Dim01, int Tensor_Dim2>
T FTensor::Dg< T *, Tensor_Dim01, Tensor_Dim2 >::operator() ( const int  N1,
const int  N2,
const int  N3 
) const

Definition at line 44 of file Dg_pointer.hpp.

45  {
46 #ifdef FTENSOR_DEBUG
47  if(N1 >= Tensor_Dim01 || N1 < 0 || N2 >= Tensor_Dim01 || N2 < 0
48  || N3 >= Tensor_Dim2 || N3 < 0)
49  {
50  std::stringstream s;
51  s << "Bad index in Dg<T*," << Tensor_Dim01 << "," << Tensor_Dim2
52  << ">.operator(" << N1 << "," << N2 << "," << N3 << ") const"
53  << std::endl;
54  throw std::out_of_range(s.str());
55  }
56 #endif
57  return N1 > N2 ? *data[N1 + (N2 * (2 * Tensor_Dim01 - N2 - 1)) / 2][N3]
58  : *data[N2 + (N1 * (2 * Tensor_Dim01 - N1 - 1)) / 2][N3];
59  }
T *restrict data[(Tensor_Dim01 *(Tensor_Dim01+1))/2][Tensor_Dim2]
Definition: Dg_pointer.hpp:11

◆ operator()() [3/25]

template<class T , int Tensor_Dim01, int Tensor_Dim2>
template<char i, char j, char k, int Dim01, int Dim2>
Dg_Expr<Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, Dim01, Dim2, i, j, k> FTensor::Dg< T *, Tensor_Dim01, Tensor_Dim2 >::operator() ( const Index< i, Dim01 >  index1,
const Index< j, Dim01 >  index2,
const Index< k, Dim2 >  index3 
)

Definition at line 82 of file Dg_pointer.hpp.

84  {
85  return Dg_Expr<Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, Dim01, Dim2, i, j,
86  k>(*this);
87  }

◆ operator()() [4/25]

template<class T , int Tensor_Dim01, int Tensor_Dim2>
template<char i, char j, char k, int Dim01, int Dim2>
Dg_Expr<const Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, Dim01, Dim2, i, j, k> FTensor::Dg< T *, Tensor_Dim01, Tensor_Dim2 >::operator() ( const Index< i, Dim01 >  index1,
const Index< j, Dim01 >  index2,
const Index< k, Dim2 >  index3 
) const

Definition at line 91 of file Dg_pointer.hpp.

93  {
94  return Dg_Expr<const Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, Dim01, Dim2,
95  i, j, k>(*this);
96  }

◆ operator()() [5/25]

template<class T , int Tensor_Dim01, int Tensor_Dim2>
template<char i, char j, int Dim>
Tensor1_Expr< const Tensor3_contracted_12<Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, Dim>, T, Dim, i> FTensor::Dg< T *, Tensor_Dim01, Tensor_Dim2 >::operator() ( const Index< i, Dim >  index1,
const Index< j, Dim >  index2,
const Index< j, Dim >  index3 
) const

Definition at line 107 of file Dg_pointer.hpp.

109  {
110  using TensorExpr
111  = Tensor3_contracted_12<Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, Dim>;
112  return Tensor1_Expr<TensorExpr, T, Dim, i>(TensorExpr(*this));
113  }

◆ operator()() [6/25]

template<class T , int Tensor_Dim01, int Tensor_Dim2>
template<char i, char j, int Dim>
Tensor1_Expr< const Tensor3_contracted_02<Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, Dim>, T, Dim, i> FTensor::Dg< T *, Tensor_Dim01, Tensor_Dim2 >::operator() ( const Index< j, Dim >  index1,
const Index< i, Dim >  index2,
const Index< j, Dim >  index3 
) const

Definition at line 119 of file Dg_pointer.hpp.

121  {
122  using TensorExpr
123  = Tensor3_contracted_02<Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, Dim>;
124  return Tensor1_Expr<TensorExpr, T, Dim, i>(TensorExpr(*this));
125  }

◆ operator()() [7/25]

template<class T , int Tensor_Dim01, int Tensor_Dim2>
template<char i, char j, int Dim01, int Dim2>
Tensor1_Expr< const Tensor3_contracted_01<Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, Dim01>, T, Dim2, i> FTensor::Dg< T *, Tensor_Dim01, Tensor_Dim2 >::operator() ( const Index< j, Dim01 >  index1,
const Index< j, Dim01 >  index2,
const Index< i, Dim2 >  index3 
) const

Definition at line 153 of file Dg_pointer.hpp.

155  {
156  using TensorExpr
157  = Tensor3_contracted_01<Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, Dim01>;
158  return Tensor1_Expr<TensorExpr, T, Dim2, i>(TensorExpr(*this));
159  }

◆ operator()() [8/25]

template<class T , int Tensor_Dim01, int Tensor_Dim2>
template<char i, char j, int N, int Dim1, int Dim2>
Tensor2_Expr<Dg_number_rhs_0<Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, N>, T, Dim1, Dim2, i, j> FTensor::Dg< T *, Tensor_Dim01, Tensor_Dim2 >::operator() ( const Number< N n1,
const Index< i, Dim1 >  index1,
const Index< j, Dim2 >  index2 
)

Definition at line 172 of file Dg_pointer.hpp.

174  {
175  using TensorExpr
176  = Dg_number_rhs_0<Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, N>;
177  return Tensor2_Expr<TensorExpr, T, Dim1, Dim2, i, j>(*this);
178  }
const int N
Definition: speed_test.cpp:3

◆ operator()() [9/25]

template<class T , int Tensor_Dim01, int Tensor_Dim2>
template<char i, char j, int N, int Dim1, int Dim2>
const Tensor2_Expr< const Dg_number_0<const Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, N>, T, Dim1, Dim2, i, j> FTensor::Dg< T *, Tensor_Dim01, Tensor_Dim2 >::operator() ( const Number< N n1,
const Index< i, Dim1 >  index1,
const Index< j, Dim2 >  index2 
) const

Definition at line 184 of file Dg_pointer.hpp.

186  {
187  using TensorExpr
188  = Dg_number_0<const Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, N>;
189  return Tensor2_Expr<TensorExpr, T, Dim1, Dim2, i, j>(TensorExpr(*this));
190  }
const int N
Definition: speed_test.cpp:3

◆ operator()() [10/25]

template<class T , int Tensor_Dim01, int Tensor_Dim2>
template<char i, char j, int N, int Dim0, int Dim2>
Tensor2_Expr<Dg_number_rhs_0<Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, N>, T, Dim0, Dim2, i, j> FTensor::Dg< T *, Tensor_Dim01, Tensor_Dim2 >::operator() ( const Index< i, Dim0 >  index1,
const Number< N n1,
const Index< j, Dim2 >  index2 
)

Definition at line 197 of file Dg_pointer.hpp.

199  {
200  using TensorExpr
201  = Dg_number_rhs_0<Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, N>;
202  return Tensor2_Expr<TensorExpr, T, Dim0, Dim2, i, j>(*this);
203  }
const int N
Definition: speed_test.cpp:3

◆ operator()() [11/25]

template<class T , int Tensor_Dim01, int Tensor_Dim2>
template<char i, char j, int N, int Dim0, int Dim2>
const Tensor2_Expr< const Dg_number_0<const Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, N>, T, Dim0, Dim2, i, j> FTensor::Dg< T *, Tensor_Dim01, Tensor_Dim2 >::operator() ( const Index< i, Dim0 >  index1,
const Number< N n1,
const Index< j, Dim2 >  index2 
) const

Definition at line 209 of file Dg_pointer.hpp.

211  {
212  using TensorExpr
213  = Dg_number_0<const Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, N>;
214  return Tensor2_Expr<TensorExpr, T, Dim0, Dim2, i, j>(TensorExpr(*this));
215  }
const int N
Definition: speed_test.cpp:3

◆ operator()() [12/25]

template<class T , int Tensor_Dim01, int Tensor_Dim2>
template<char i, char j, int N, int Dim>
Tensor2_symmetric_Expr< Dg_number_rhs_2<Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, N>, T, Dim, i, j> FTensor::Dg< T *, Tensor_Dim01, Tensor_Dim2 >::operator() ( const Index< i, Dim >  index1,
const Index< j, Dim >  index2,
const Number< N n1 
)

Definition at line 222 of file Dg_pointer.hpp.

224  {
225  using TensorExpr
226  = Dg_number_rhs_2<Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, N>;
227  return Tensor2_symmetric_Expr<TensorExpr, T, Dim, i, j>(*this);
228  }
const int N
Definition: speed_test.cpp:3

◆ operator()() [13/25]

template<class T , int Tensor_Dim01, int Tensor_Dim2>
template<char i, char j, int N, int Dim>
const Tensor2_symmetric_Expr< const Dg_number_2<const Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, N>, T, Dim, i, j> FTensor::Dg< T *, Tensor_Dim01, Tensor_Dim2 >::operator() ( const Index< i, Dim >  index1,
const Index< j, Dim >  index2,
const Number< N n1 
) const

Definition at line 234 of file Dg_pointer.hpp.

236  {
237  using TensorExpr
238  = Dg_number_2<const Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, N>;
239  return Tensor2_symmetric_Expr<TensorExpr, T, Dim, i, j>(
240  TensorExpr(*this));
241  }
const int N
Definition: speed_test.cpp:3

◆ operator()() [14/25]

template<class T , int Tensor_Dim01, int Tensor_Dim2>
template<char i, int N1, int N2, int Dim>
Tensor1_Expr<Dg_number_rhs_12<Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, N1, N2>, T, Dim, i> FTensor::Dg< T *, Tensor_Dim01, Tensor_Dim2 >::operator() ( const Index< i, Dim >  index,
const Number< N1 >  n1,
const Number< N2 >  n2 
)

Definition at line 253 of file Dg_pointer.hpp.

255  {
256  using TensorExpr
257  = Dg_number_rhs_12<Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, N1, N2>;
259  }

◆ operator()() [15/25]

template<class T , int Tensor_Dim01, int Tensor_Dim2>
template<char i, int N1, int N2, int Dim>
const Tensor1_Expr< const Dg_number_12<const Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, N1, N2>, T, Dim, i> FTensor::Dg< T *, Tensor_Dim01, Tensor_Dim2 >::operator() ( const Index< i, Dim >  index,
const Number< N1 >  n1,
const Number< N2 >  n2 
) const

Definition at line 265 of file Dg_pointer.hpp.

267  {
268  using TensorExpr
269  = Dg_number_12<const Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, N1, N2>;
270  return Tensor1_Expr<TensorExpr, T, Dim, i>(TensorExpr(*this));
271  }

◆ operator()() [16/25]

template<class T , int Tensor_Dim01, int Tensor_Dim2>
template<char i, int N1, int N2, int Dim>
Tensor1_Expr<Dg_number_rhs_12<Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, N1, N2>, T, Dim, i> FTensor::Dg< T *, Tensor_Dim01, Tensor_Dim2 >::operator() ( const Number< N1 >  n1,
const Index< i, Dim >  index,
const Number< N2 >  n2 
)

Definition at line 280 of file Dg_pointer.hpp.

282  {
283  using TensorExpr
284  = Dg_number_rhs_12<Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, N1, N2>;
286  }

◆ operator()() [17/25]

template<class T , int Tensor_Dim01, int Tensor_Dim2>
template<char i, int N1, int N2, int Dim>
const Tensor1_Expr< const Dg_number_12<const Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, N1, N2>, T, Dim, i> FTensor::Dg< T *, Tensor_Dim01, Tensor_Dim2 >::operator() ( const Number< N1 >  n1,
const Index< i, Dim >  index,
const Number< N2 >  n2 
) const

Definition at line 292 of file Dg_pointer.hpp.

294  {
295  using TensorExpr
296  = Dg_number_12<const Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, N1, N2>;
297  return Tensor1_Expr<TensorExpr, T, Dim, i>(TensorExpr(*this));
298  }

◆ operator()() [18/25]

template<class T , int Tensor_Dim01, int Tensor_Dim2>
template<char i, int N1, int N2, int Dim>
Tensor1_Expr<Dg_number_rhs_01<Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, N1, N2>, T, Dim, i> FTensor::Dg< T *, Tensor_Dim01, Tensor_Dim2 >::operator() ( const Number< N1 >  n1,
const Number< N2 >  n2,
const Index< i, Dim >  index 
)

Definition at line 305 of file Dg_pointer.hpp.

307  {
308  using TensorExpr
309  = Dg_number_rhs_01<Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, N1, N2>;
311  }

◆ operator()() [19/25]

template<class T , int Tensor_Dim01, int Tensor_Dim2>
template<char i, int N1, int N2, int Dim>
const Tensor1_Expr< const Dg_number_01<const Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, N1, N2>, T, Dim, i> FTensor::Dg< T *, Tensor_Dim01, Tensor_Dim2 >::operator() ( const Number< N1 >  n1,
const Number< N2 >  n2,
const Index< i, Dim >  index 
) const

Definition at line 317 of file Dg_pointer.hpp.

319  {
320  using TensorExpr
321  = Dg_number_01<const Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, N1, N2>;
322  return Tensor1_Expr<TensorExpr, T, Dim, i>(TensorExpr(*this));
323  }

◆ operator()() [20/25]

template<class T , int Tensor_Dim01, int Tensor_Dim2>
template<char i, char j, int Dim1, int Dim2>
const Tensor2_Expr< const Dg_numeral_0<const Dg<T *, Tensor_Dim01, Tensor_Dim2>, T>, T, Dim1, Dim2, i, j> FTensor::Dg< T *, Tensor_Dim01, Tensor_Dim2 >::operator() ( const int  N,
const Index< i, Dim1 >  index1,
const Index< j, Dim2 >  index2 
) const

Definition at line 336 of file Dg_pointer.hpp.

338  {
339  using TensorExpr
340  = Dg_numeral_0<const Dg<T *, Tensor_Dim01, Tensor_Dim2>, T>;
341  return Tensor2_Expr<TensorExpr, T, Dim1, Dim2, i, j>(
342  TensorExpr(*this, N));
343  }
const int N
Definition: speed_test.cpp:3

◆ operator()() [21/25]

template<class T , int Tensor_Dim01, int Tensor_Dim2>
template<char i, char j, int Dim0, int Dim2>
const Tensor2_Expr< const Dg_numeral_0<const Dg<T *, Tensor_Dim01, Tensor_Dim2>, T>, T, Dim0, Dim2, i, j> FTensor::Dg< T *, Tensor_Dim01, Tensor_Dim2 >::operator() ( const Index< i, Dim0 >  index1,
const int  N,
const Index< j, Dim2 >  index2 
) const

Definition at line 351 of file Dg_pointer.hpp.

353  {
354  using TensorExpr
355  = Dg_numeral_0<const Dg<T *, Tensor_Dim01, Tensor_Dim2>, T>;
356  return Tensor2_Expr<TensorExpr, T, Dim0, Dim2, i, j>(
357  TensorExpr(*this, N));
358  }
const int N
Definition: speed_test.cpp:3

◆ operator()() [22/25]

template<class T , int Tensor_Dim01, int Tensor_Dim2>
template<char i, char j, int Dim>
const Tensor2_symmetric_Expr< const Dg_numeral_2<const Dg<T *, Tensor_Dim01, Tensor_Dim2>, T>, T, Dim, i, j> FTensor::Dg< T *, Tensor_Dim01, Tensor_Dim2 >::operator() ( const Index< i, Dim >  index1,
const Index< j, Dim >  index2,
const int  N 
) const

Definition at line 366 of file Dg_pointer.hpp.

368  {
369  using TensorExpr
370  = Dg_numeral_2<const Dg<T *, Tensor_Dim01, Tensor_Dim2>, T>;
371  return Tensor2_symmetric_Expr<TensorExpr, T, Dim, i, j>(
372  TensorExpr(*this, N));
373  }
const int N
Definition: speed_test.cpp:3

◆ operator()() [23/25]

template<class T , int Tensor_Dim01, int Tensor_Dim2>
template<char i, int Dim>
const Tensor1_Expr< const Dg_numeral_12<const Dg<T *, Tensor_Dim01, Tensor_Dim2>, T>, T, Dim, i> FTensor::Dg< T *, Tensor_Dim01, Tensor_Dim2 >::operator() ( const Index< i, Dim >  index,
const int  N1,
const int  N2 
) const

Definition at line 384 of file Dg_pointer.hpp.

385  {
386  using TensorExpr
387  = Dg_numeral_12<const Dg<T *, Tensor_Dim01, Tensor_Dim2>, T>;
388  return Tensor1_Expr<TensorExpr, T, Dim, i>(TensorExpr(*this, N1, N2));
389  }

◆ operator()() [24/25]

template<class T , int Tensor_Dim01, int Tensor_Dim2>
template<char i, int Dim>
const Tensor1_Expr< const Dg_numeral_12<const Dg<T *, Tensor_Dim01, Tensor_Dim2>, T>, T, Dim, i> FTensor::Dg< T *, Tensor_Dim01, Tensor_Dim2 >::operator() ( const int  N1,
const Index< i, Dim >  index,
const int  N2 
) const

Definition at line 399 of file Dg_pointer.hpp.

400  {
401  using TensorExpr
402  = Dg_numeral_12<const Dg<T *, Tensor_Dim01, Tensor_Dim2>, T>;
403  return Tensor1_Expr<TensorExpr, T, Dim, i>(TensorExpr(*this, N1, N2));
404  }

◆ operator()() [25/25]

template<class T , int Tensor_Dim01, int Tensor_Dim2>
template<char i, int Dim>
const Tensor1_Expr< const Dg_numeral_01<const Dg<T *, Tensor_Dim01, Tensor_Dim2>, T>, T, Dim, i> FTensor::Dg< T *, Tensor_Dim01, Tensor_Dim2 >::operator() ( const int  N1,
const int  N2,
const Index< i, Dim >  index 
) const

Definition at line 412 of file Dg_pointer.hpp.

413  {
414  using TensorExpr
415  = Dg_numeral_01<const Dg<T *, Tensor_Dim01, Tensor_Dim2>, T>;
416  return Tensor1_Expr<TensorExpr, T, Dim, i>(TensorExpr(*this, N1, N2));
417  }

◆ operator++()

template<class T , int Tensor_Dim01, int Tensor_Dim2>
const Dg<T *, Tensor_Dim01, Tensor_Dim2>& FTensor::Dg< T *, Tensor_Dim01, Tensor_Dim2 >::operator++ ( ) const

Definition at line 422 of file Dg_pointer.hpp.

423  {
424  for(int i = 0; i < (Tensor_Dim01 * (Tensor_Dim01 + 1)) / 2; ++i)
425  for(int j = 0; j < Tensor_Dim2; ++j)
426  ++data[i][j];
427  return *this;
428  }
T *restrict data[(Tensor_Dim01 *(Tensor_Dim01+1))/2][Tensor_Dim2]
Definition: Dg_pointer.hpp:11

◆ ptr()

template<class T , int Tensor_Dim01, int Tensor_Dim2>
T* FTensor::Dg< T *, Tensor_Dim01, Tensor_Dim2 >::ptr ( const int  N1,
const int  N2,
const int  N3 
) const

Definition at line 61 of file Dg_pointer.hpp.

62  {
63 #ifdef FTENSOR_DEBUG
64  if(N1 >= Tensor_Dim01 || N1 < 0 || N2 >= Tensor_Dim01 || N2 < 0
65  || N3 >= Tensor_Dim2 || N3 < 0)
66  {
67  std::stringstream s;
68  s << "Bad index in Dg<T," << Tensor_Dim01 << "," << Tensor_Dim2
69  << ">.ptr(" << N1 << "," << N2 << "," << N3 << ")" << std::endl;
70  throw std::out_of_range(s.str());
71  }
72 #endif
73  return N1 > N2 ? data[N1 + (N2 * (2 * Tensor_Dim01 - N2 - 1)) / 2][N3]
74  : data[N2 + (N1 * (2 * Tensor_Dim01 - N1 - 1)) / 2][N3];
75  }
T *restrict data[(Tensor_Dim01 *(Tensor_Dim01+1))/2][Tensor_Dim2]
Definition: Dg_pointer.hpp:11

Member Data Documentation

◆ data

template<class T , int Tensor_Dim01, int Tensor_Dim2>
T* restrict FTensor::Dg< T *, Tensor_Dim01, Tensor_Dim2 >::data[(Tensor_Dim01 *(Tensor_Dim01+1))/2][Tensor_Dim2]
mutableprivate

Definition at line 11 of file Dg_pointer.hpp.


The documentation for this class was generated from the following file: