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

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

Inheritance diagram for FTensor::Dg< T *, Tensor_Dim01, Tensor_Dim2 >:
[legend]
Collaboration diagram for FTensor::Dg< T *, Tensor_Dim01, Tensor_Dim2 >:
[legend]

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, koperator() (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, koperator() (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, ioperator() (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, ioperator() (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, ioperator() (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, joperator() (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, joperator() (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, joperator() (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, joperator() (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, joperator() (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, joperator() (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, ioperator() (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, ioperator() (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, ioperator() (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, ioperator() (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, ioperator() (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, ioperator() (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, joperator() (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, joperator() (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, joperator() (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, ioperator() (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, ioperator() (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, ioperator() (const int N1, const int N2, const Index< i, Dim > index) const
 
const Dg< T *, Tensor_Dim01, Tensor_Dim2 > & operator++ () const
 

Protected Attributes

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

Private Member Functions

template<int I>
 Dg (const Dg< PackPtr< T *, I >, Tensor_Dim01, Tensor_Dim2 > &)=delete
 

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/3]

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

Definition at line 18 of file Dg_pointer.hpp.

18  : data{d...}
19  {
20  static_assert(sizeof...(d) == sizeof(data) / sizeof(T),
21  "Incorrect number of Arguments. Constructor should "
22  "initialize the entire Tensor");
23  }

◆ Dg() [2/3]

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

Definition at line 25 of file Dg_pointer.hpp.

25 {}

◆ Dg() [3/3]

template<class T , int Tensor_Dim01, int Tensor_Dim2>
template<int I>
FTensor::Dg< T *, Tensor_Dim01, Tensor_Dim2 >::Dg ( const Dg< PackPtr< T *, I >, Tensor_Dim01, Tensor_Dim2 > &  )
privatedelete

Member Function Documentation

◆ operator()() [1/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
inline

Definition at line 387 of file Dg_pointer.hpp.

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

◆ operator()() [2/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 
)
inline

Definition at line 256 of file Dg_pointer.hpp.

258  {
259  using TensorExpr
260  = Dg_number_rhs_12<Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, N1, N2>;
262  }

◆ operator()() [3/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
inline

Definition at line 268 of file Dg_pointer.hpp.

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

◆ operator()() [4/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
inline

Definition at line 110 of file Dg_pointer.hpp.

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

◆ operator()() [5/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
inline

Definition at line 369 of file Dg_pointer.hpp.

371  {
372  using TensorExpr
373  = Dg_numeral_2<const Dg<T *, Tensor_Dim01, Tensor_Dim2>, T>;
374  return Tensor2_symmetric_Expr<TensorExpr, T, Dim, i, j>(
375  TensorExpr(*this, N));
376  }

◆ operator()() [6/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 
)
inline

Definition at line 225 of file Dg_pointer.hpp.

227  {
228  using TensorExpr
229  = Dg_number_rhs_2<Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, N>;
230  return Tensor2_symmetric_Expr<TensorExpr, T, Dim, i, j>(*this);
231  }

◆ operator()() [7/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
inline

Definition at line 237 of file Dg_pointer.hpp.

239  {
240  using TensorExpr
241  = Dg_number_2<const Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, N>;
242  return Tensor2_symmetric_Expr<TensorExpr, T, Dim, i, j>(
243  TensorExpr(*this));
244  }

◆ operator()() [8/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
inline

Definition at line 354 of file Dg_pointer.hpp.

356  {
357  using TensorExpr
358  = Dg_numeral_0<const Dg<T *, Tensor_Dim01, Tensor_Dim2>, T>;
359  return Tensor2_Expr<TensorExpr, T, Dim0, Dim2, i, j>(
360  TensorExpr(*this, N));
361  }

◆ operator()() [9/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 
)
inline

Definition at line 200 of file Dg_pointer.hpp.

202  {
203  using TensorExpr
204  = Dg_number_rhs_0<Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, N>;
205  return Tensor2_Expr<TensorExpr, T, Dim0, Dim2, i, j>(*this);
206  }

◆ operator()() [10/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
inline

Definition at line 212 of file Dg_pointer.hpp.

214  {
215  using TensorExpr
216  = Dg_number_0<const Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, N>;
217  return Tensor2_Expr<TensorExpr, T, Dim0, Dim2, i, j>(TensorExpr(*this));
218  }

◆ operator()() [11/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 
)
inline

Definition at line 85 of file Dg_pointer.hpp.

87  {
88  return Dg_Expr<Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, Dim01, Dim2, i, j,
89  k>(*this);
90  }

◆ operator()() [12/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
inline

Definition at line 94 of file Dg_pointer.hpp.

96  {
97  return Dg_Expr<const Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, Dim01, Dim2,
98  i, j, k>(*this);
99  }

◆ operator()() [13/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
inline

Definition at line 122 of file Dg_pointer.hpp.

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

◆ operator()() [14/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
inline

Definition at line 156 of file Dg_pointer.hpp.

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

◆ operator()() [15/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
inline

Definition at line 339 of file Dg_pointer.hpp.

341  {
342  using TensorExpr
343  = Dg_numeral_0<const Dg<T *, Tensor_Dim01, Tensor_Dim2>, T>;
344  return Tensor2_Expr<TensorExpr, T, Dim1, Dim2, i, j>(
345  TensorExpr(*this, N));
346  }

◆ operator()() [16/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
inline

Definition at line 402 of file Dg_pointer.hpp.

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

◆ operator()() [17/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
inline

Definition at line 415 of file Dg_pointer.hpp.

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

◆ operator()() [18/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 
)
inline

Definition at line 30 of file Dg_pointer.hpp.

31  {
32 #ifdef FTENSOR_DEBUG
33  if(N1 >= Tensor_Dim01 || N1 < 0 || N2 >= Tensor_Dim01 || N2 < 0
34  || N3 >= Tensor_Dim2 || N3 < 0)
35  {
36  std::stringstream s;
37  s << "Bad index in Dg<T*," << Tensor_Dim01 << "," << Tensor_Dim2
38  << ">.operator(" << N1 << "," << N2 << "," << N3 << ")"
39  << std::endl;
40  throw std::out_of_range(s.str());
41  }
42 #endif
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];
45  }

◆ operator()() [19/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
inline

Definition at line 47 of file Dg_pointer.hpp.

48  {
49 #ifdef FTENSOR_DEBUG
50  if(N1 >= Tensor_Dim01 || N1 < 0 || N2 >= Tensor_Dim01 || N2 < 0
51  || N3 >= Tensor_Dim2 || N3 < 0)
52  {
53  std::stringstream s;
54  s << "Bad index in Dg<T*," << Tensor_Dim01 << "," << Tensor_Dim2
55  << ">.operator(" << N1 << "," << N2 << "," << N3 << ") const"
56  << std::endl;
57  throw std::out_of_range(s.str());
58  }
59 #endif
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];
62  }

◆ operator()() [20/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 
)
inline

Definition at line 175 of file Dg_pointer.hpp.

177  {
178  using TensorExpr
179  = Dg_number_rhs_0<Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, N>;
180  return Tensor2_Expr<TensorExpr, T, Dim1, Dim2, i, j>(*this);
181  }

◆ operator()() [21/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
inline

Definition at line 187 of file Dg_pointer.hpp.

189  {
190  using TensorExpr
191  = Dg_number_0<const Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, N>;
192  return Tensor2_Expr<TensorExpr, T, Dim1, Dim2, i, j>(TensorExpr(*this));
193  }

◆ operator()() [22/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 
)
inline

Definition at line 283 of file Dg_pointer.hpp.

285  {
286  using TensorExpr
287  = Dg_number_rhs_12<Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, N1, N2>;
289  }

◆ operator()() [23/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
inline

Definition at line 295 of file Dg_pointer.hpp.

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

◆ operator()() [24/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 
)
inline

Definition at line 308 of file Dg_pointer.hpp.

310  {
311  using TensorExpr
312  = Dg_number_rhs_01<Dg<T *, Tensor_Dim01, Tensor_Dim2>, T, N1, N2>;
314  }

◆ operator()() [25/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
inline

Definition at line 320 of file Dg_pointer.hpp.

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

◆ 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
inline

Definition at line 425 of file Dg_pointer.hpp.

426  {
427  for(int i = 0; i < (Tensor_Dim01 * (Tensor_Dim01 + 1)) / 2; ++i)
428  for(int j = 0; j < Tensor_Dim2; ++j)
429  ++data[i][j];
430  return *this;
431  }

◆ 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
inline

Definition at line 64 of file Dg_pointer.hpp.

65  {
66 #ifdef FTENSOR_DEBUG
67  if(N1 >= Tensor_Dim01 || N1 < 0 || N2 >= Tensor_Dim01 || N2 < 0
68  || N3 >= Tensor_Dim2 || N3 < 0)
69  {
70  std::stringstream s;
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());
74  }
75 #endif
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];
78  }

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]
mutableprotected

Definition at line 14 of file Dg_pointer.hpp.


The documentation for this class was generated from the following file:
FTensor::d
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
FTensor::Dg< T *, Tensor_Dim01, Tensor_Dim2 >::data
T *restrict data[(Tensor_Dim01 *(Tensor_Dim01+1))/2][Tensor_Dim2]
Definition: Dg_pointer.hpp:14
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
N
const int N
Definition: speed_test.cpp:3
Tensor1_Expr
Definition: single.cpp:11
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20