v0.14.0
Public Member Functions | Private Attributes | List of all members
FTensor::Tensor2_antisymmetric< T, Tensor_Dim > Class Template Reference

#include <src/ftensor/src/FTensor/Tensor2_antisymmetric/Tensor2_antisymmetric_value.hpp>

Inheritance diagram for FTensor::Tensor2_antisymmetric< T, Tensor_Dim >:
[legend]
Collaboration diagram for FTensor::Tensor2_antisymmetric< T, Tensor_Dim >:
[legend]

Public Member Functions

template<class... U>
 Tensor2_antisymmetric (U... d)
 
 Tensor2_antisymmetric ()
 
T & unsafe (const int N1, const int N2)
 
operator() (const int N1, const int N2) const
 
template<char i, char j, int Dim0, int Dim1>
std::enable_if<(Tensor_Dim >=Dim0 &&Tensor_Dim >=Dim1), Tensor2_Expr< Tensor2_antisymmetric< T, Tensor_Dim >, T, Dim0, Dim1, i, j > >::type operator() (const Index< i, Dim0 >, const Index< j, Dim1 >)
 
template<char i, char j, int Dim0, int Dim1>
std::enable_if<(Tensor_Dim >=Dim0 &&Tensor_Dim >=Dim1), Tensor2_Expr< const Tensor2_antisymmetric< T, Tensor_Dim >, T, Dim0, Dim1, i, j > >::type operator() (const Index< i, Dim0 >, const Index< j, Dim1 >) const
 
template<char i, char j, int Dim>
std::enable_if<(Tensor_Dim >=Dim), Tensor2_antisymmetric_Expr< Tensor2_antisymmetric< T, Tensor_Dim >, T, Dim, i, j > >::type operator() (const Index< i, Dim > index1, const Index< j, Dim > index2)
 
template<char i, char j, int Dim>
std::enable_if<(Tensor_Dim >=Dim), Tensor2_antisymmetric_Expr< const Tensor2_antisymmetric< T, Tensor_Dim >, T, Dim, i, j > >::type operator() (const Index< i, Dim > index1, const Index< j, Dim > index2) const
 
template<char i, int N, int Dim>
std::enable_if<(Tensor_Dim >=Dim &&Tensor_Dim > N), Tensor1_Expr< Tensor2_number_rhs_1< Tensor2_antisymmetric< T, Tensor_Dim >, T, N >, T, Dim, i > >::type operator() (const Index< i, Dim > index1, const Number< N >)
 
template<char i, int N, int Dim>
std::enable_if<(Tensor_Dim >=Dim &&Tensor_Dim > N), Tensor1_Expr< const Tensor2_number_1< const Tensor2_antisymmetric< T, Tensor_Dim >, T, N >, T, Dim, i > >::type operator() (const Index< i, Dim > index1, const Number< N >) const
 
template<char i, int N, int Dim>
std::enable_if<(Tensor_Dim > N &&Tensor_Dim >=Dim), Tensor1_Expr< Tensor2_number_rhs_0< Tensor2_antisymmetric< T, Tensor_Dim >, T, N >, T, Dim, i > >::type operator() (const Number< N >, const Index< i, Dim > index1)
 
template<char i, int N, int Dim>
std::enable_if<(Tensor_Dim > N &&Tensor_Dim >=Dim), Tensor1_Expr< const Tensor2_number_0< const Tensor2_antisymmetric< T, Tensor_Dim >, T, N >, T, Dim, i > >::type operator() (const Number< N > &n1, const Index< i, Dim > index1) const
 
template<char i, int Dim>
std::enable_if<(Tensor_Dim >=Dim), Tensor1_Expr< const Tensor2_numeral_1< const Tensor2_antisymmetric< T, Tensor_Dim >, T >, T, Dim, i > >::type operator() (const Index< i, Dim > index1, const int N) const
 
template<char i, int Dim>
std::enable_if<(Tensor_Dim >=Dim), Tensor1_Expr< const Tensor2_numeral_0< const Tensor2_antisymmetric< T, Tensor_Dim >, T >, T, Dim, i > >::type operator() (const int N, const Index< i, Dim > index1) const
 
template<char i, int Dim>
std::enable_if<(Tensor_Dim >=Dim), T >::type operator() (const Index< i, Dim > index1, const Index< i, Dim > index2)
 
template<char i, int Dim>
std::enable_if<(Tensor_Dim >=Dim), T >::type operator() (const Index< i, Dim > index1, const Index< i, Dim > index2) const
 

Private Attributes

data [(Tensor_Dim *(Tensor_Dim - 1))/2]
 

Detailed Description

template<class T, int Tensor_Dim>
class FTensor::Tensor2_antisymmetric< T, Tensor_Dim >

Definition at line 9 of file Tensor2_antisymmetric_value.hpp.

Constructor & Destructor Documentation

◆ Tensor2_antisymmetric() [1/2]

template<class T , int Tensor_Dim>
template<class... U>
FTensor::Tensor2_antisymmetric< T, Tensor_Dim >::Tensor2_antisymmetric ( U...  d)
inline

Definition at line 14 of file Tensor2_antisymmetric_value.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  }

◆ Tensor2_antisymmetric() [2/2]

template<class T , int Tensor_Dim>
FTensor::Tensor2_antisymmetric< T, Tensor_Dim >::Tensor2_antisymmetric ( )
inline

Definition at line 21 of file Tensor2_antisymmetric_value.hpp.

21 {}

Member Function Documentation

◆ operator()() [1/13]

template<class T , int Tensor_Dim>
template<char i, int Dim>
std::enable_if<(Tensor_Dim >= Dim), T>::type FTensor::Tensor2_antisymmetric< T, Tensor_Dim >::operator() ( const Index< i, Dim >  index1,
const Index< i, Dim >  index2 
)
inline

Definition at line 218 of file Tensor2_antisymmetric_value.hpp.

219  {
220  return 0;
221  }

◆ operator()() [2/13]

template<class T , int Tensor_Dim>
template<char i, int Dim>
std::enable_if<(Tensor_Dim >= Dim), T>::type FTensor::Tensor2_antisymmetric< T, Tensor_Dim >::operator() ( const Index< i, Dim >  index1,
const Index< i, Dim >  index2 
) const
inline

Definition at line 225 of file Tensor2_antisymmetric_value.hpp.

226  {
227  return 0;
228  }

◆ operator()() [3/13]

template<class T , int Tensor_Dim>
template<char i, char j, int Dim>
std::enable_if< (Tensor_Dim >= Dim), Tensor2_antisymmetric_Expr<Tensor2_antisymmetric<T, Tensor_Dim>, T, Dim, i, j> >::type FTensor::Tensor2_antisymmetric< T, Tensor_Dim >::operator() ( const Index< i, Dim >  index1,
const Index< j, Dim >  index2 
)
inline

Definition at line 103 of file Tensor2_antisymmetric_value.hpp.

104  {
105  return Tensor2_antisymmetric_Expr<Tensor2_antisymmetric<T, Tensor_Dim>,
106  T, Dim, i, j>(*this);
107  }

◆ operator()() [4/13]

template<class T , int Tensor_Dim>
template<char i, char j, int Dim>
std::enable_if< (Tensor_Dim >= Dim), Tensor2_antisymmetric_Expr<const Tensor2_antisymmetric<T, Tensor_Dim>, T, Dim, i, j> >::type FTensor::Tensor2_antisymmetric< T, Tensor_Dim >::operator() ( const Index< i, Dim >  index1,
const Index< j, Dim >  index2 
) const
inline

Definition at line 114 of file Tensor2_antisymmetric_value.hpp.

115  {
116  return Tensor2_antisymmetric_Expr<
117  const Tensor2_antisymmetric<T, Tensor_Dim>, T, Dim, i, j>(*this);
118  }

◆ operator()() [5/13]

template<class T , int Tensor_Dim>
template<char i, int Dim>
std::enable_if< (Tensor_Dim >= Dim), Tensor1_Expr< const Tensor2_numeral_1<const Tensor2_antisymmetric<T, Tensor_Dim>, T>, T, Dim, i> >::type FTensor::Tensor2_antisymmetric< T, Tensor_Dim >::operator() ( const Index< i, Dim >  index1,
const int  N 
) const
inline

Definition at line 187 of file Tensor2_antisymmetric_value.hpp.

188  {
189  using TensorExpr
190  = Tensor2_numeral_1<const Tensor2_antisymmetric<T, Tensor_Dim>, T>;
191  return Tensor1_Expr<TensorExpr, T, Dim, i>(TensorExpr(*this, N));
192  }

◆ operator()() [6/13]

template<class T , int Tensor_Dim>
template<char i, int N, int Dim>
std::enable_if< (Tensor_Dim >= Dim && Tensor_Dim > N), Tensor1_Expr< Tensor2_number_rhs_1<Tensor2_antisymmetric<T, Tensor_Dim>, T, N>, T, Dim, i> >::type FTensor::Tensor2_antisymmetric< T, Tensor_Dim >::operator() ( const Index< i, Dim >  index1,
const Number< N  
)
inline

Definition at line 133 of file Tensor2_antisymmetric_value.hpp.

134  {
135  using TensorExpr
136  = Tensor2_number_rhs_1<Tensor2_antisymmetric<T, Tensor_Dim>, T, N>;
138  }

◆ operator()() [7/13]

template<class T , int Tensor_Dim>
template<char i, int N, int Dim>
std::enable_if< (Tensor_Dim >= Dim && Tensor_Dim > N), Tensor1_Expr<const Tensor2_number_1< const Tensor2_antisymmetric<T, Tensor_Dim>, T, N>, T, Dim, i> >::type FTensor::Tensor2_antisymmetric< T, Tensor_Dim >::operator() ( const Index< i, Dim >  index1,
const Number< N  
) const
inline

Definition at line 146 of file Tensor2_antisymmetric_value.hpp.

147  {
148  using TensorExpr
149  = Tensor2_number_1<const Tensor2_antisymmetric<T, Tensor_Dim>, T, N>;
150  return Tensor1_Expr<TensorExpr, T, Dim, i>(TensorExpr(*this));
151  }

◆ operator()() [8/13]

template<class T , int Tensor_Dim>
template<char i, char j, int Dim0, int Dim1>
std::enable_if<(Tensor_Dim >= Dim0 && Tensor_Dim >= Dim1), Tensor2_Expr<Tensor2_antisymmetric<T, Tensor_Dim>, T, Dim0, Dim1, i, j> >::type FTensor::Tensor2_antisymmetric< T, Tensor_Dim >::operator() ( const Index< i, Dim0 >  ,
const Index< j, Dim1 >   
)
inline

Definition at line 78 of file Tensor2_antisymmetric_value.hpp.

79  {
80  return Tensor2_Expr<Tensor2_antisymmetric<T, Tensor_Dim>, T, Dim0, Dim1,
81  i, j>(*this);
82  }

◆ operator()() [9/13]

template<class T , int Tensor_Dim>
template<char i, char j, int Dim0, int Dim1>
std::enable_if< (Tensor_Dim >= Dim0 && Tensor_Dim >= Dim1), Tensor2_Expr<const Tensor2_antisymmetric<T, Tensor_Dim>, T, Dim0, Dim1, i, j> >::type FTensor::Tensor2_antisymmetric< T, Tensor_Dim >::operator() ( const Index< i, Dim0 >  ,
const Index< j, Dim1 >   
) const
inline

Definition at line 89 of file Tensor2_antisymmetric_value.hpp.

90  {
91  return Tensor2_Expr<const Tensor2_antisymmetric<T, Tensor_Dim>, T, Dim0,
92  Dim1, i, j>(*this);
93  }

◆ operator()() [10/13]

template<class T , int Tensor_Dim>
template<char i, int Dim>
std::enable_if< (Tensor_Dim >= Dim), Tensor1_Expr< const Tensor2_numeral_0<const Tensor2_antisymmetric<T, Tensor_Dim>, T>, T, Dim, i> >::type FTensor::Tensor2_antisymmetric< T, Tensor_Dim >::operator() ( const int  N,
const Index< i, Dim >  index1 
) const
inline

Definition at line 200 of file Tensor2_antisymmetric_value.hpp.

201  {
202  using TensorExpr
203  = Tensor2_numeral_0<const Tensor2_antisymmetric<T, Tensor_Dim>, T>;
204  return Tensor1_Expr<TensorExpr, T, Dim, i>(TensorExpr(*this, N));
205  }

◆ operator()() [11/13]

template<class T , int Tensor_Dim>
T FTensor::Tensor2_antisymmetric< T, Tensor_Dim >::operator() ( const int  N1,
const int  N2 
) const
inline

Definition at line 46 of file Tensor2_antisymmetric_value.hpp.

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

◆ operator()() [12/13]

template<class T , int Tensor_Dim>
template<char i, int N, int Dim>
std::enable_if< (Tensor_Dim > N && Tensor_Dim >= Dim), Tensor1_Expr<const Tensor2_number_0< const Tensor2_antisymmetric<T, Tensor_Dim>, T, N>, T, Dim, i> >::type FTensor::Tensor2_antisymmetric< T, Tensor_Dim >::operator() ( const Number< N > &  n1,
const Index< i, Dim >  index1 
) const
inline

Definition at line 172 of file Tensor2_antisymmetric_value.hpp.

173  {
174  using TensorExpr
175  = Tensor2_number_0<const Tensor2_antisymmetric<T, Tensor_Dim>, T, N>;
176  return Tensor1_Expr<TensorExpr, T, Dim, i>(TensorExpr(*this));
177  }

◆ operator()() [13/13]

template<class T , int Tensor_Dim>
template<char i, int N, int Dim>
std::enable_if< (Tensor_Dim > N && Tensor_Dim >= Dim), Tensor1_Expr< Tensor2_number_rhs_0<Tensor2_antisymmetric<T, Tensor_Dim>, T, N>, T, Dim, i> >::type FTensor::Tensor2_antisymmetric< T, Tensor_Dim >::operator() ( const Number< N ,
const Index< i, Dim >  index1 
)
inline

Definition at line 159 of file Tensor2_antisymmetric_value.hpp.

160  {
161  using TensorExpr
162  = Tensor2_number_rhs_0<Tensor2_antisymmetric<T, Tensor_Dim>, T, N>;
164  }

◆ unsafe()

template<class T , int Tensor_Dim>
T& FTensor::Tensor2_antisymmetric< T, Tensor_Dim >::unsafe ( const int  N1,
const int  N2 
)
inline

Definition at line 32 of file Tensor2_antisymmetric_value.hpp.

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

Member Data Documentation

◆ data

template<class T , int Tensor_Dim>
T FTensor::Tensor2_antisymmetric< T, Tensor_Dim >::data[(Tensor_Dim *(Tensor_Dim - 1))/2]
private

Definition at line 11 of file Tensor2_antisymmetric_value.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
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
FTensor::Tensor2_antisymmetric::data
T data[(Tensor_Dim *(Tensor_Dim - 1))/2]
Definition: Tensor2_antisymmetric_value.hpp:11
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