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

#include <src/ftensor/src/FTensor/Tensor3/Tensor3_pointer.hpp>

Collaboration diagram for FTensor::Tensor3< T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 >:
[legend]

Public Member Functions

 Tensor3 ()
 
 Tensor3 (T *d000, T *d001, T *d010, T *d011, T *d100, T *d101, T *d110, T *d111, const int i=1)
 
 Tensor3 (T *d000, T *d001, T *d002, T *d010, T *d011, T *d012, T *d020, T *d021, T *d022, T *d100, T *d101, T *d102, T *d110, T *d111, T *d112, T *d120, T *d121, T *d122, T *d200, T *d201, T *d202, T *d210, T *d211, T *d212, T *d220, T *d221, T *d222, const int i=1)
 
 Tensor3 (T *d000, T *d001, T *d002, T *d003, T *d010, T *d011, T *d012, T *d013, T *d020, T *d021, T *d022, T *d023, T *d030, T *d031, T *d032, T *d033, T *d100, T *d101, T *d102, T *d103, T *d110, T *d111, T *d112, T *d113, T *d120, T *d121, T *d122, T *d123, T *d130, T *d131, T *d132, T *d133, T *d200, T *d201, T *d202, T *d203, T *d210, T *d211, T *d212, T *d213, T *d220, T *d221, T *d222, T *d223, T *d230, T *d231, T *d232, T *d233, T *d300, T *d301, T *d302, T *d303, T *d310, T *d311, T *d312, T *d313, T *d320, T *d321, T *d322, T *d323, T *d330, T *d331, T *d332, T *d333, const int i=1)
 
T & operator() (const int N1, const int N2, const int N3)
 
operator() (const int N1, const int N2, const int N3) const
 
template<char i, char j, char k, int Dim0, int Dim1, int Dim2>
Tensor3_Expr< Tensor3< T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 >, T, Dim0, Dim1, Dim2, i, j, k > operator() (const Index< i, Dim0 >, const Index< j, Dim1 >, const Index< k, Dim2 >)
 
template<char i, char j, char k, int Dim0, int Dim1, int Dim2>
Tensor3_Expr< const Tensor3< T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 >, T, Dim0, Dim1, Dim2, i, j, k > operator() (const Index< i, Dim0 >, const Index< j, Dim1 >, const Index< k, Dim2 >) const
 
template<int Current_Dim0, int Current_Dim1, int Current_Dim2>
void increment (const Number< Current_Dim0 > &, const Number< Current_Dim1 > &, const Number< Current_Dim2 > &) const
 
const Tensor3< T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 > & operator++ () const
 

Private Attributes

const int inc
 
T *restrict data [Tensor_Dim1][Tensor_Dim1][Tensor_Dim2]
 

Detailed Description

template<class T, int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2>
class FTensor::Tensor3< T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 >

Definition at line 188 of file Tensor3_pointer.hpp.

Constructor & Destructor Documentation

◆ Tensor3() [1/4]

template<class T , int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2>
FTensor::Tensor3< T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 >::Tensor3 ( )

Definition at line 194 of file Tensor3_pointer.hpp.

194 {}

◆ Tensor3() [2/4]

template<class T , int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2>
FTensor::Tensor3< T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 >::Tensor3 ( T *  d000,
T *  d001,
T *  d010,
T *  d011,
T *  d100,
T *  d101,
T *  d110,
T *  d111,
const int  i = 1 
)

Definition at line 197 of file Tensor3_pointer.hpp.

199  : inc(i)
200  {
201  Tensor3_constructor<T * restrict, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2>(
202  data, d000, d001, d010, d011, d100, d101, d110, d111);
203  }
T *restrict data[Tensor_Dim1][Tensor_Dim1][Tensor_Dim2]

◆ Tensor3() [3/4]

template<class T , int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2>
FTensor::Tensor3< T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 >::Tensor3 ( T *  d000,
T *  d001,
T *  d002,
T *  d010,
T *  d011,
T *  d012,
T *  d020,
T *  d021,
T *  d022,
T *  d100,
T *  d101,
T *  d102,
T *  d110,
T *  d111,
T *  d112,
T *  d120,
T *  d121,
T *  d122,
T *  d200,
T *  d201,
T *  d202,
T *  d210,
T *  d211,
T *  d212,
T *  d220,
T *  d221,
T *  d222,
const int  i = 1 
)

Definition at line 206 of file Tensor3_pointer.hpp.

211  : inc(i)
212  {
213  Tensor3_constructor<T * restrict, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2>(
214  data, d000, d001, d002, d010, d011, d012, d020, d021, d022, d100, d101,
215  d102, d110, d111, d112, d120, d121, d122, d200, d201, d202, d210, d211,
216  d212, d220, d221, d222);
217  }
T *restrict data[Tensor_Dim1][Tensor_Dim1][Tensor_Dim2]

◆ Tensor3() [4/4]

template<class T , int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2>
FTensor::Tensor3< T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 >::Tensor3 ( T *  d000,
T *  d001,
T *  d002,
T *  d003,
T *  d010,
T *  d011,
T *  d012,
T *  d013,
T *  d020,
T *  d021,
T *  d022,
T *  d023,
T *  d030,
T *  d031,
T *  d032,
T *  d033,
T *  d100,
T *  d101,
T *  d102,
T *  d103,
T *  d110,
T *  d111,
T *  d112,
T *  d113,
T *  d120,
T *  d121,
T *  d122,
T *  d123,
T *  d130,
T *  d131,
T *  d132,
T *  d133,
T *  d200,
T *  d201,
T *  d202,
T *  d203,
T *  d210,
T *  d211,
T *  d212,
T *  d213,
T *  d220,
T *  d221,
T *  d222,
T *  d223,
T *  d230,
T *  d231,
T *  d232,
T *  d233,
T *  d300,
T *  d301,
T *  d302,
T *  d303,
T *  d310,
T *  d311,
T *  d312,
T *  d313,
T *  d320,
T *  d321,
T *  d322,
T *  d323,
T *  d330,
T *  d331,
T *  d332,
T *  d333,
const int  i = 1 
)

Definition at line 220 of file Tensor3_pointer.hpp.

235  : inc(i)
236  {
237  Tensor3_constructor<T * restrict, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2>(
238  data, d000, d001, d002, d003, d010, d011, d012, d013, d020, d021, d022,
239  d023, d030, d031, d032, d033,
240 
241  d100, d101, d102, d103, d110, d111, d112, d113, d120, d121, d122, d123,
242  d130, d131, d132, d133,
243 
244  d200, d201, d202, d203, d210, d211, d212, d213, d220, d221, d222, d223,
245  d230, d231, d232, d233,
246 
247  d300, d301, d302, d303, d310, d311, d312, d313, d320, d321, d322, d323,
248  d330, d331, d332, d333);
249  }
T *restrict data[Tensor_Dim1][Tensor_Dim1][Tensor_Dim2]

Member Function Documentation

◆ increment()

template<class T , int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2>
template<int Current_Dim0, int Current_Dim1, int Current_Dim2>
void FTensor::Tensor3< T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 >::increment ( const Number< Current_Dim0 > &  ,
const Number< Current_Dim1 > &  ,
const Number< Current_Dim2 > &   
) const

Definition at line 315 of file Tensor3_pointer.hpp.

317  {
318  data[Current_Dim0 - 1][Current_Dim1 - 1][Current_Dim2 - 1] += inc;
319  }
T *restrict data[Tensor_Dim1][Tensor_Dim1][Tensor_Dim2]

◆ operator()() [1/4]

template<class T , int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2>
T& FTensor::Tensor3< T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 >::operator() ( const int  N1,
const int  N2,
const int  N3 
)

Definition at line 254 of file Tensor3_pointer.hpp.

255  {
256 #ifdef FTENSOR_DEBUG
257  if(N1 >= Tensor_Dim0 || N1 < 0 || N2 >= Tensor_Dim1 || N2 < 0
258  || N3 >= Tensor_Dim2 || N3 < 0)
259  {
260  std::stringstream s;
261  s << "Bad index in Tensor3<T," << Tensor_Dim0 << "," << Tensor_Dim1
262  << "," << Tensor_Dim2 << ">.operator(" << N1 << "," << N2 << ","
263  << N3 << ")" << std::endl;
264  throw std::runtime_error(s.str());
265  }
266 #endif
267  return *data[N1][N2][N3];
268  }
T *restrict data[Tensor_Dim1][Tensor_Dim1][Tensor_Dim2]

◆ operator()() [2/4]

template<class T , int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2>
T FTensor::Tensor3< T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 >::operator() ( const int  N1,
const int  N2,
const int  N3 
) const

Definition at line 270 of file Tensor3_pointer.hpp.

271  {
272 #ifdef FTENSOR_DEBUG
273  if(N1 >= Tensor_Dim0 || N1 < 0 || N2 >= Tensor_Dim1 || N2 < 0
274  || N3 >= Tensor_Dim2 || N3 < 0)
275  {
276  std::stringstream s;
277  s << "Bad index in Tensor3<T," << Tensor_Dim0 << "," << Tensor_Dim1
278  << "," << Tensor_Dim2 << ">.operator(" << N1 << "," << N2 << ","
279  << N3 << ") const" << std::endl;
280  throw std::runtime_error(s.str());
281  }
282 #endif
283  return *data[N1][N2][N3];
284  }
T *restrict data[Tensor_Dim1][Tensor_Dim1][Tensor_Dim2]

◆ operator()() [3/4]

template<class T , int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2>
template<char i, char j, char k, int Dim0, int Dim1, int Dim2>
Tensor3_Expr<Tensor3<T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2>, T, Dim0, Dim1, Dim2, i, j, k> FTensor::Tensor3< T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 >::operator() ( const Index< i, Dim0 >  ,
const Index< j, Dim1 >  ,
const Index< k, Dim2 >   
)

Definition at line 292 of file Tensor3_pointer.hpp.

294  {
295  return Tensor3_Expr<Tensor3<T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2>,
296  T, Dim0, Dim1, Dim2, i, j, k>(*this);
297  }

◆ operator()() [4/4]

template<class T , int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2>
template<char i, char j, char k, int Dim0, int Dim1, int Dim2>
Tensor3_Expr<const Tensor3<T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2>, T, Dim0, Dim1, Dim2, i, j, k> FTensor::Tensor3< T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 >::operator() ( const Index< i, Dim0 >  ,
const Index< j, Dim1 >  ,
const Index< k, Dim2 >   
) const

Definition at line 302 of file Tensor3_pointer.hpp.

304  {
305  return Tensor3_Expr<
306  const Tensor3<T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2>, T, Dim0,
307  Dim1, Dim2, i, j, k>(*this);
308  }

◆ operator++()

template<class T , int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2>
const Tensor3<T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2>& FTensor::Tensor3< T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 >::operator++ ( ) const

Definition at line 322 of file Tensor3_pointer.hpp.

323  {
324  T3_increment(*this, Number<Tensor_Dim0>(), Number<Tensor_Dim1>(),
325  Number<Tensor_Dim2>());
326  return *this;
327  }
void T3_increment(const Tensor3< T, Dim0, Dim1, Dim2 > &iter, const Number< Current_Dim0 > &, const Number< Current_Dim1 > &, const Number< Current_Dim2 > &)

Member Data Documentation

◆ data

template<class T , int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2>
T* restrict FTensor::Tensor3< T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 >::data[Tensor_Dim1][Tensor_Dim1][Tensor_Dim2]
mutableprivate

Definition at line 191 of file Tensor3_pointer.hpp.

◆ inc

template<class T , int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2>
const int FTensor::Tensor3< T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 >::inc
private

Definition at line 190 of file Tensor3_pointer.hpp.


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