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

#include <src/ftensor/src/FTensor/Tensor3_antisymmetric/Tensor3_antisymmetric_pointer.hpp>

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

Public Member Functions

template<class... U>
 Tensor3_antisymmetric (U *... d)
 
 Tensor3_antisymmetric ()
 
T & unsafe (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>
Tensor3_antisymmetric_Expr< Tensor3_antisymmetric< T *, Tensor_Dim0, Tensor_Dim12 >, T, Dim0, Dim12, i, j, koperator() (const Index< i, Dim0 > index1, const Index< j, Dim12 > index2, const Index< k, Dim12 > index3)
 
template<char i, char j, char k, int Dim0, int Dim12>
Tensor3_antisymmetric_Expr< const Tensor3_antisymmetric< T *, Tensor_Dim0, Tensor_Dim12 >, T, Dim0, Dim12, i, j, koperator() (const Index< i, Dim0 > index1, const Index< j, Dim12 > index2, const Index< k, Dim12 > index3) const
 
const Tensor3_antisymmetric< 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::Tensor3_antisymmetric< T *, Tensor_Dim0, Tensor_Dim12 >

Definition at line 8 of file Tensor3_antisymmetric_pointer.hpp.

Constructor & Destructor Documentation

◆ Tensor3_antisymmetric() [1/2]

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

Definition at line 14 of file Tensor3_antisymmetric_pointer.hpp.

14  : data{d...}
15  {
16  static_assert(sizeof...(d) == sizeof(data) / sizeof(T),
17  "Incorrect number of Arguments. Constructor should "
18  "initialize the entire Tensor");
19  }

◆ Tensor3_antisymmetric() [2/2]

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

Definition at line 21 of file Tensor3_antisymmetric_pointer.hpp.

21 {}

Member Function Documentation

◆ operator()() [1/3]

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

Definition at line 99 of file Tensor3_antisymmetric_pointer.hpp.

101  {
102  return Tensor3_antisymmetric_Expr<
103  Tensor3_antisymmetric<T *, Tensor_Dim0, Tensor_Dim12>, T, Dim0, Dim12,
104  i, j, k>(*this);
105  }

◆ operator()() [2/3]

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

Definition at line 111 of file Tensor3_antisymmetric_pointer.hpp.

113  {
114  return Tensor3_antisymmetric_Expr<
115  const Tensor3_antisymmetric<T *, Tensor_Dim0, Tensor_Dim12>, T, Dim0,
116  Dim12, i, j, k>(*this);
117  }

◆ operator()() [3/3]

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

Definition at line 49 of file Tensor3_antisymmetric_pointer.hpp.

50  {
51 #ifdef FTENSOR_DEBUG
52  if(N1 >= Tensor_Dim0 || N1 < 0 || N2 >= Tensor_Dim12 || N2 < 0
53  || N3 >= Tensor_Dim12 || N3 < 0)
54  {
55  std::stringstream s;
56  s << "Bad index in Tensor3_antisymmetric<T*," << Tensor_Dim0 << ","
57  << Tensor_Dim12 << ">.operator(" << N1 << "," << N2 << "," << N3
58  << ") const" << std::endl;
59  throw std::out_of_range(s.str());
60  }
61 #endif
62  return N2 < N3
63  ? *data[N1]
64  [N3 - 1 + (N2 * (2 * (Tensor_Dim12 - 1) - N2 - 1)) / 2]
65  : (N2 > N3
66  ? -*data[N1][N2 - 1
67  + (N3 * (2 * (Tensor_Dim12 - 1) - N3 - 1)) / 2]
68  : 0.0);
69  }

◆ operator++()

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

Definition at line 123 of file Tensor3_antisymmetric_pointer.hpp.

124  {
125  for(int i = 0; i < Tensor_Dim0; ++i)
126  for(int j = 0; j < (Tensor_Dim12 * (Tensor_Dim12 - 1)) / 2; ++j)
127  ++data[i][j];
128  return *this;
129  }

◆ ptr()

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

Definition at line 71 of file Tensor3_antisymmetric_pointer.hpp.

72  {
73 #ifdef FTENSOR_DEBUG
74  if(N1 >= Tensor_Dim0 || N1 < 0 || N2 >= Tensor_Dim12 || N2 < 0
75  || N3 >= Tensor_Dim12 || N3 < 0)
76  {
77  std::stringstream s;
78  s << "Bad index in Tensor3_antisymmetric<T*," << Tensor_Dim0 << ","
79  << Tensor_Dim12 << ">.ptr(" << N1 << "," << N2 << "," << N3 << ")"
80  << std::endl;
81  throw std::out_of_range(s.str());
82  }
83 #endif
84  return N2 < N3
85  ? data[N1][N3 - 1 + (N2 * (2 * (Tensor_Dim12 - 1) - N2 - 1)) / 2]
86  : (N2 > N3
87  ? -data[N1][N2 - 1
88  + (N3 * (2 * (Tensor_Dim12 - 1) - N3 - 1)) / 2]
89  : 0);
90  }

◆ unsafe()

template<class T , int Tensor_Dim0, int Tensor_Dim12>
T& FTensor::Tensor3_antisymmetric< T *, Tensor_Dim0, Tensor_Dim12 >::unsafe ( const int  N1,
const int  N2,
const int  N3 
)
inline

Definition at line 33 of file Tensor3_antisymmetric_pointer.hpp.

34  {
35 #ifdef FTENSOR_DEBUG
36  if(N1 >= Tensor_Dim0 || N1 < 0 || N2 >= Tensor_Dim12 || N2 < 0
37  || N3 >= Tensor_Dim12 || N3 < 0 || N2 >= N3)
38  {
39  std::stringstream s;
40  s << "Bad index in Tensor3_antisymmetric<T*," << Tensor_Dim0 << ","
41  << Tensor_Dim12 << ">.unsafe(" << N1 << "," << N2 << "," << N3
42  << ")" << std::endl;
43  throw std::out_of_range(s.str());
44  }
45 #endif
46  return *data[N1][N3 - 1 + (N2 * (2 * (Tensor_Dim12 - 1) - N2 - 1)) / 2];
47  }

Member Data Documentation

◆ data

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

Definition at line 11 of file Tensor3_antisymmetric_pointer.hpp.


The documentation for this class was generated from the following file:
FTensor::Tensor3_antisymmetric< T *, Tensor_Dim0, Tensor_Dim12 >::data
T *restrict data[Tensor_Dim0][(Tensor_Dim12 *(Tensor_Dim12 - 1))/2]
Definition: Tensor3_antisymmetric_pointer.hpp:11
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
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20