v0.8.4
Public Member Functions | Private Attributes | List of all members
FTensor::Christof< T *, Tensor_Dim0, Tensor_Dim12 > Class Template Reference

#include <src/ftensor/src/FTensor/Christof/Christof_pointer.hpp>

Public Member Functions

template<class... U>
 Christof (U *... d)
 
 Christof ()
 
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 Dim0, int Dim12>
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)
 
template<char i, char j, char k, int Dim0, int Dim12>
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
 
template<char i, char j, int Dim0, int Dim12>
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
 
template<char i, char j, int Dim02, int Dim1>
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
 
template<char i, char j, int Dim01, int Dim2>
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
 
template<char i, char j, int Dim0, int Dim12>
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)
 
template<char i, char j, int Dim02, int Dim1>
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)
 
template<char i, char j, int Dim01, int Dim2>
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)
 
template<char i, char j, int N, int Dim12>
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
 
template<char i, char j, int Dim0, int Dim2>
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
 
template<char i, char j, int Dim0, int Dim2>
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
 
const Christof< T *, Tensor_Dim0, Tensor_Dim12 > & operator++ () const
 

Private Attributes

T *restrict data [Tensor_Dim0][(Tensor_Dim12 *(Tensor_Dim12+1))/2]
 

Detailed Description

template<class T, int Tensor_Dim0, int Tensor_Dim12>
class FTensor::Christof< T *, Tensor_Dim0, Tensor_Dim12 >

Definition at line 10 of file Christof_pointer.hpp.

Constructor & Destructor Documentation

◆ Christof() [1/2]

template<class T , int Tensor_Dim0, int Tensor_Dim12>
template<class... U>
FTensor::Christof< T *, Tensor_Dim0, Tensor_Dim12 >::Christof ( U *...  d)

Definition at line 16 of file Christof_pointer.hpp.

16  : data{d...}
17  {
18  static_assert(sizeof...(d) == sizeof(data) / sizeof(T),
19  "Incorrect number of Arguments. Constructor should "
20  "initialize the entire Tensor");
21  }
T *restrict data[Tensor_Dim0][(Tensor_Dim12 *(Tensor_Dim12+1))/2]
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

◆ Christof() [2/2]

template<class T , int Tensor_Dim0, int Tensor_Dim12>
FTensor::Christof< T *, Tensor_Dim0, Tensor_Dim12 >::Christof ( )

Definition at line 23 of file Christof_pointer.hpp.

23 {}

Member Function Documentation

◆ operator()() [1/13]

template<class T , int Tensor_Dim0, int Tensor_Dim12>
T& FTensor::Christof< T *, Tensor_Dim0, Tensor_Dim12 >::operator() ( const int  N1,
const int  N2,
const int  N3 
)

Definition at line 28 of file Christof_pointer.hpp.

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

◆ operator()() [2/13]

template<class T , int Tensor_Dim0, int Tensor_Dim12>
T FTensor::Christof< T *, Tensor_Dim0, Tensor_Dim12 >::operator() ( const int  N1,
const int  N2,
const int  N3 
) const

Definition at line 45 of file Christof_pointer.hpp.

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

◆ operator()() [3/13]

template<class T , int Tensor_Dim0, int Tensor_Dim12>
template<char i, char j, char k, int Dim0, int Dim12>
Dg_Expr<Christof<T *, Tensor_Dim0, Tensor_Dim12>, T, Dim12, Dim0, i, j, k> FTensor::Christof< T *, Tensor_Dim0, Tensor_Dim12 >::operator() ( const Index< k, Dim0 >  index1,
const Index< i, Dim12 >  index2,
const Index< j, Dim12 >  index3 
)

Definition at line 86 of file Christof_pointer.hpp.

88  {
89  return Dg_Expr<Christof<T *, Tensor_Dim0, Tensor_Dim12>, T, Dim12, Dim0,
90  i, j, k>(*this);
91  }

◆ operator()() [4/13]

template<class T , int Tensor_Dim0, int Tensor_Dim12>
template<char i, char j, char k, int Dim0, int Dim12>
Dg_Expr<const Christof<T *, Tensor_Dim0, Tensor_Dim12>, T, Dim12, Dim0, i, j, k> FTensor::Christof< T *, Tensor_Dim0, Tensor_Dim12 >::operator() ( const Index< k, Dim0 >  index1,
const Index< i, Dim12 >  index2,
const Index< j, Dim12 >  index3 
) const

Definition at line 96 of file Christof_pointer.hpp.

98  {
99  return Dg_Expr<const Christof<T *, Tensor_Dim0, Tensor_Dim12>, T, Dim12,
100  Dim0, i, j, k>(*this);
101  }

◆ operator()() [5/13]

template<class T , int Tensor_Dim0, int Tensor_Dim12>
template<char i, char j, int Dim0, int Dim12>
Tensor1_Expr<const Tensor3_contracted_12< const Christof<T *, Tensor_Dim0, Tensor_Dim12>, T, Dim12>, T, Dim0, i> FTensor::Christof< T *, Tensor_Dim0, Tensor_Dim12 >::operator() ( const Index< i, Dim0 >  index1,
const Index< j, Dim12 >  index2,
const Index< j, Dim12 >  index3 
) const

Definition at line 111 of file Christof_pointer.hpp.

113  {
114  using TensorExpr
115  = Tensor3_contracted_12<const Christof<T *, Tensor_Dim0, Tensor_Dim12>,
116  T, Dim12>;
117  return Tensor1_Expr<TensorExpr, T, Dim0, i>(TensorExpr(*this));
118  }

◆ operator()() [6/13]

template<class T , int Tensor_Dim0, int Tensor_Dim12>
template<char i, char j, int Dim02, int Dim1>
Tensor1_Expr<const Tensor3_contracted_02< const Christof<T *, Tensor_Dim0, Tensor_Dim12>, T, Dim02>, T, Dim1, i> FTensor::Christof< T *, Tensor_Dim0, Tensor_Dim12 >::operator() ( const Index< j, Dim02 >  index1,
const Index< i, Dim1 >  index2,
const Index< j, Dim02 >  index3 
) const

Definition at line 124 of file Christof_pointer.hpp.

126  {
127  using TensorExpr
128  = Tensor3_contracted_02<const Christof<T *, Tensor_Dim0, Tensor_Dim12>,
129  T, Dim02>;
130  return Tensor1_Expr<TensorExpr, T, Dim1, i>(TensorExpr(*this));
131  }

◆ operator()() [7/13]

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

Definition at line 137 of file Christof_pointer.hpp.

139  {
140  using TensorExpr
141  = Tensor3_contracted_01<const Christof<T *, Tensor_Dim0, Tensor_Dim12>,
142  T, Dim01>;
143  return Tensor1_Expr<TensorExpr, T, Dim2, i>(TensorExpr(*this));
144  }

◆ operator()() [8/13]

template<class T , int Tensor_Dim0, int Tensor_Dim12>
template<char i, char j, int Dim0, int Dim12>
Tensor1_Expr<const Tensor3_contracted_12< const Christof<T *, Tensor_Dim0, Tensor_Dim12>, T, Dim12>, T, Dim0, i> FTensor::Christof< T *, Tensor_Dim0, Tensor_Dim12 >::operator() ( const Index< i, Dim0 >  index1,
const Index< j, Dim12 >  index2,
const Index< j, Dim12 >  index3 
)

Definition at line 152 of file Christof_pointer.hpp.

154  {
155  using TensorExpr
156  = Tensor3_contracted_12<const Christof<T *, Tensor_Dim0, Tensor_Dim12>,
157  T, Dim12>;
158  return Tensor1_Expr<TensorExpr, T, Dim0, i>(TensorExpr(*this));
159  }

◆ operator()() [9/13]

template<class T , int Tensor_Dim0, int Tensor_Dim12>
template<char i, char j, int Dim02, int Dim1>
Tensor1_Expr<const Tensor3_contracted_02< const Christof<T *, Tensor_Dim0, Tensor_Dim12>, T, Dim02>, T, Dim1, i> FTensor::Christof< T *, Tensor_Dim0, Tensor_Dim12 >::operator() ( const Index< j, Dim02 >  index1,
const Index< i, Dim1 >  index2,
const Index< j, Dim02 >  index3 
)

Definition at line 165 of file Christof_pointer.hpp.

167  {
168  using TensorExpr
169  = Tensor3_contracted_02<const Christof<T *, Tensor_Dim0, Tensor_Dim12>,
170  T, Dim02>;
171  return Tensor1_Expr<TensorExpr, T, Dim1, i>(TensorExpr(*this));
172  }

◆ operator()() [10/13]

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

Definition at line 178 of file Christof_pointer.hpp.

180  {
181  using TensorExpr
182  = Tensor3_contracted_01<const Christof<T *, Tensor_Dim0, Tensor_Dim12>,
183  T, Dim01>;
184  return Tensor1_Expr<TensorExpr, T, Dim2, i>(TensorExpr(*this));
185  }

◆ operator()() [11/13]

template<class T , int Tensor_Dim0, int Tensor_Dim12>
template<char i, char j, int N, int Dim12>
Tensor2_symmetric_Expr< const Christof_number_0<const Christof<T *, Tensor_Dim0, Tensor_Dim12>, T, N>, T, Dim12, i, j> FTensor::Christof< T *, Tensor_Dim0, Tensor_Dim12 >::operator() ( const Number< N n1,
const Index< i, Dim12 >  index1,
const Index< j, Dim12 >  index2 
) const

Definition at line 195 of file Christof_pointer.hpp.

197  {
198  using TensorExpr
199  = Christof_number_0<const Christof<T *, Tensor_Dim0, Tensor_Dim12>, T,
200  N>;
201  return Tensor2_symmetric_Expr<TensorExpr, T, Dim12, i, j>(
202  TensorExpr(*this));
203  }
const int N
Definition: speed_test.cpp:3

◆ operator()() [12/13]

template<class T , int Tensor_Dim0, int Tensor_Dim12>
template<char i, char j, int Dim0, int Dim2>
Tensor2_Expr<const Christof_numeral_1< const Christof<T *, Tensor_Dim0, Tensor_Dim12>, T>, T, Dim0, Dim2, i, j> FTensor::Christof< T *, Tensor_Dim0, Tensor_Dim12 >::operator() ( const Index< i, Dim0 >  index1,
const int  N,
const Index< j, Dim2 >  index2 
) const

Definition at line 213 of file Christof_pointer.hpp.

215  {
216  using TensorExpr
217  = Christof_numeral_1<const Christof<T *, Tensor_Dim0, Tensor_Dim12>, T>;
218  return Tensor2_Expr<TensorExpr, T, Dim0, Dim2, i, j>(
219  TensorExpr(*this, N));
220  }

◆ operator()() [13/13]

template<class T , int Tensor_Dim0, int Tensor_Dim12>
template<char i, char j, int Dim0, int Dim2>
Tensor2_Expr<const Christof_numeral_1< const Christof<T *, Tensor_Dim0, Tensor_Dim12>, T>, T, Dim0, Dim2, i, j> FTensor::Christof< T *, Tensor_Dim0, Tensor_Dim12 >::operator() ( const Index< i, Dim0 >  index1,
const Index< j, Dim2 >  index2,
const int  N 
) const

Definition at line 226 of file Christof_pointer.hpp.

228  {
229  using TensorExpr
230  = Christof_numeral_1<const Christof<T *, Tensor_Dim0, Tensor_Dim12>, T>;
231  return Tensor2_Expr<TensorExpr, T, Dim0, Dim2, i, j>(
232  TensorExpr(*this, N));
233  }

◆ operator++()

template<class T , int Tensor_Dim0, int Tensor_Dim12>
const Christof<T *, Tensor_Dim0, Tensor_Dim12>& FTensor::Christof< T *, Tensor_Dim0, Tensor_Dim12 >::operator++ ( ) const

Definition at line 238 of file Christof_pointer.hpp.

239  {
240  for(int i = 0; i < Tensor_Dim0; ++i)
241  for(int j = 0; j < (Tensor_Dim12 * (Tensor_Dim12 + 1)) / 2; ++j)
242  ++data[i][j];
243  return *this;
244  }
T *restrict data[Tensor_Dim0][(Tensor_Dim12 *(Tensor_Dim12+1))/2]

◆ ptr()

template<class T , int Tensor_Dim0, int Tensor_Dim12>
T* FTensor::Christof< T *, Tensor_Dim0, Tensor_Dim12 >::ptr ( const int  N1,
const int  N2,
const int  N3 
) const

Definition at line 62 of file Christof_pointer.hpp.

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

Member Data Documentation

◆ data

template<class T , int Tensor_Dim0, int Tensor_Dim12>
T* restrict FTensor::Christof< T *, Tensor_Dim0, Tensor_Dim12 >::data[Tensor_Dim0][(Tensor_Dim12 *(Tensor_Dim12+1))/2]
mutableprivate

Definition at line 13 of file Christof_pointer.hpp.


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