v0.14.0
Public Member Functions | Protected Attributes | Private 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>

Inheritance diagram for FTensor::Christof< T *, Tensor_Dim0, Tensor_Dim12 >:
[legend]
Collaboration diagram for FTensor::Christof< T *, Tensor_Dim0, Tensor_Dim12 >:
[legend]

Public Member Functions

template<class... U>
 Christof (U *... d)
 
template<class... U>
 Christof (const int i, 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, koperator() (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, koperator() (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, ioperator() (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, ioperator() (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, ioperator() (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, ioperator() (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, ioperator() (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, ioperator() (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, joperator() (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, joperator() (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, joperator() (const Index< i, Dim0 > index1, const Index< j, Dim2 > index2, const int N) const
 
const Christof< T *, Tensor_Dim0, Tensor_Dim12 > & operator++ () const
 

Protected Attributes

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

Private Member Functions

template<int I>
 Christof (const Christof< PackPtr< T *, I >, Tensor_Dim0, Tensor_Dim12 > &)=delete
 

Private Attributes

const int inc
 

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

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

Definition at line 20 of file Christof_pointer.hpp.

20  : 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");
24  }

◆ Christof() [2/4]

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

Definition at line 27 of file Christof_pointer.hpp.

27  : data{d...}, inc(i) {
28  static_assert(sizeof...(d) == sizeof(data) / sizeof(T),
29  "Incorrect number of Arguments. Constructor should "
30  "initialize the entire Tensor");
31  }

◆ Christof() [3/4]

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

Definition at line 33 of file Christof_pointer.hpp.

33 {}

◆ Christof() [4/4]

template<class T , int Tensor_Dim0, int Tensor_Dim12>
template<int I>
FTensor::Christof< T *, Tensor_Dim0, Tensor_Dim12 >::Christof ( const Christof< PackPtr< T *, I >, Tensor_Dim0, Tensor_Dim12 > &  )
privatedelete

Member Function Documentation

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

Definition at line 162 of file Christof_pointer.hpp.

164  {
165  using TensorExpr
166  = Tensor3_contracted_12<const Christof<T *, Tensor_Dim0, Tensor_Dim12>,
167  T, Dim12>;
168  return Tensor1_Expr<TensorExpr, T, Dim0, i>(TensorExpr(*this));
169  }

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

Definition at line 121 of file Christof_pointer.hpp.

123  {
124  using TensorExpr
125  = Tensor3_contracted_12<const Christof<T *, Tensor_Dim0, Tensor_Dim12>,
126  T, Dim12>;
127  return Tensor1_Expr<TensorExpr, T, Dim0, i>(TensorExpr(*this));
128  }

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

Definition at line 236 of file Christof_pointer.hpp.

238  {
239  using TensorExpr
240  = Christof_numeral_1<const Christof<T *, Tensor_Dim0, Tensor_Dim12>, T>;
241  return Tensor2_Expr<TensorExpr, T, Dim0, Dim2, i, j>(
242  TensorExpr(*this, N));
243  }

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

Definition at line 223 of file Christof_pointer.hpp.

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

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

Definition at line 188 of file Christof_pointer.hpp.

190  {
191  using TensorExpr
192  = Tensor3_contracted_01<const Christof<T *, Tensor_Dim0, Tensor_Dim12>,
193  T, Dim01>;
194  return Tensor1_Expr<TensorExpr, T, Dim2, i>(TensorExpr(*this));
195  }

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

Definition at line 147 of file Christof_pointer.hpp.

149  {
150  using TensorExpr
151  = Tensor3_contracted_01<const Christof<T *, Tensor_Dim0, Tensor_Dim12>,
152  T, Dim01>;
153  return Tensor1_Expr<TensorExpr, T, Dim2, i>(TensorExpr(*this));
154  }

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

Definition at line 175 of file Christof_pointer.hpp.

177  {
178  using TensorExpr
179  = Tensor3_contracted_02<const Christof<T *, Tensor_Dim0, Tensor_Dim12>,
180  T, Dim02>;
181  return Tensor1_Expr<TensorExpr, T, Dim1, i>(TensorExpr(*this));
182  }

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

Definition at line 134 of file Christof_pointer.hpp.

136  {
137  using TensorExpr
138  = Tensor3_contracted_02<const Christof<T *, Tensor_Dim0, Tensor_Dim12>,
139  T, Dim02>;
140  return Tensor1_Expr<TensorExpr, T, Dim1, i>(TensorExpr(*this));
141  }

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

Definition at line 96 of file Christof_pointer.hpp.

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

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

Definition at line 106 of file Christof_pointer.hpp.

108  {
109  return Dg_Expr<const Christof<T *, Tensor_Dim0, Tensor_Dim12>, T, Dim12,
110  Dim0, i, j, k>(*this);
111  }

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

Definition at line 38 of file Christof_pointer.hpp.

39  {
40 #ifdef FTENSOR_DEBUG
41  if(N1 >= Tensor_Dim0 || N1 < 0 || N2 >= Tensor_Dim12 || N2 < 0
42  || N3 >= Tensor_Dim12 || N3 < 0)
43  {
44  std::stringstream s;
45  s << "Bad index in Christof<T*," << Tensor_Dim0 << ","
46  << Tensor_Dim12 << ">.operator(" << N1 << "," << N2 << "," << N3
47  << ")" << std::endl;
48  throw std::out_of_range(s.str());
49  }
50 #endif
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];
53  }

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

Definition at line 55 of file Christof_pointer.hpp.

56  {
57 #ifdef FTENSOR_DEBUG
58  if(N1 >= Tensor_Dim0 || N1 < 0 || N2 >= Tensor_Dim12 || N2 < 0
59  || N3 >= Tensor_Dim12 || N3 < 0)
60  {
61  std::stringstream s;
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());
66  }
67 #endif
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];
70  }

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

Definition at line 205 of file Christof_pointer.hpp.

207  {
208  using TensorExpr
209  = Christof_number_0<const Christof<T *, Tensor_Dim0, Tensor_Dim12>, T,
210  N>;
211  return Tensor2_symmetric_Expr<TensorExpr, T, Dim12, i, j>(
212  TensorExpr(*this));
213  }

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

Definition at line 248 of file Christof_pointer.hpp.

249  {
250  for(int i = 0; i < Tensor_Dim0; ++i)
251  for(int j = 0; j < (Tensor_Dim12 * (Tensor_Dim12 + 1)) / 2; ++j)
252  data[i][j] += inc;
253  return *this;
254  }

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

Definition at line 72 of file Christof_pointer.hpp.

73  {
74 #ifdef FTENSOR_DEBUG
75  if(N1 >= Tensor_Dim0 || N1 < 0 || N2 >= Tensor_Dim12 || N2 < 0
76  || N3 >= Tensor_Dim12 || N3 < 0)
77  {
78  std::stringstream s;
79  s << "Bad index in Christof<T*," << Tensor_Dim0 << ","
80  << Tensor_Dim12 << ">.ptr(" << N1 << "," << N2 << "," << N3 << ")"
81  << std::endl;
82  throw std::out_of_range(s.str());
83  }
84 #endif
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];
87  }

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

Definition at line 17 of file Christof_pointer.hpp.

◆ inc

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

Definition at line 12 of file Christof_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::Christof< T *, Tensor_Dim0, Tensor_Dim12 >::inc
const int inc
Definition: Christof_pointer.hpp:12
FTensor::Christof< T *, Tensor_Dim0, Tensor_Dim12 >::data
T *restrict data[Tensor_Dim0][(Tensor_Dim12 *(Tensor_Dim12+1))/2]
Definition: Christof_pointer.hpp:17
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