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

#include <src/ftensor/src/FTensor/Tensor2_symmetric/Tensor2_symmetric_value.hpp>

Public Member Functions

 Tensor2_symmetric ()
 
 Tensor2_symmetric (T d00)
 
 Tensor2_symmetric (T d00, T d01, T d11)
 
 Tensor2_symmetric (T d00, T d01, T d02, T d11, T d12, T d22)
 
 Tensor2_symmetric (T d00, T d01, T d02, T d03, T d11, T d12, T d13, T d22, T d23, T d33)
 
T & operator() (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_symmetric< 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_symmetric< 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_symmetric_Expr< Tensor2_symmetric< T, Tensor_Dim >, T, Dim, i, j > >::type operator() (const Index< i, Dim >, const Index< j, Dim >)
 
template<char i, char j, int Dim>
std::enable_if<(Tensor_Dim >=Dim), Tensor2_symmetric_Expr< const Tensor2_symmetric< T, Tensor_Dim >, T, Dim, i, j > >::type operator() (const Index< i, Dim >, const Index< j, Dim >) const
 
template<char i, int N, int Dim>
std::enable_if<(Tensor_Dim >=Dim &&Tensor_Dim > N), Tensor1_Expr< Tensor2_number_rhs_1< Tensor2_symmetric< T, Tensor_Dim >, T, N >, T, Dim, i > >::type operator() (const Index< i, Dim >, 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_symmetric< T, Tensor_Dim >, T, N >, T, Dim, i > >::type operator() (const Index< i, Dim >, 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_symmetric< T, Tensor_Dim >, T, N >, T, Dim, i > >::type operator() (const Number< N > &, const Index< i, 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_symmetric< T, Tensor_Dim >, T, N >, T, Dim, i > >::type operator() (const Number< N > &, const Index< i, Dim >) const
 
template<char i, int Dim>
std::enable_if<(Tensor_Dim >=Dim), Tensor1_Expr< const Tensor2_numeral_1< const Tensor2_symmetric< T, Tensor_Dim >, T >, T, Dim, i > >::type operator() (const Index< i, Dim >, const int N) const
 
template<char i, int Dim>
std::enable_if<(Tensor_Dim >=Dim), Tensor1_Expr< const Tensor2_numeral_0< const Tensor2_symmetric< T, Tensor_Dim >, T >, T, Dim, i > >::type operator() (const int N, const Index< i, Dim >) const
 
template<char i, int Dim>
std::enable_if<(Tensor_Dim >=Dim), T >::type operator() (const Index< i, Dim >, const Index< i, Dim >)
 
template<char i, int Dim>
std::enable_if<(Tensor_Dim >=Dim), T >::type operator() (const Index< i, Dim >, const Index< i, Dim >) const
 

Private Member Functions

template<int N>
internal_contract (const Number< N > &) const
 
internal_contract (const Number< 1 > &) const
 

Private Attributes

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

Detailed Description

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

Definition at line 14 of file Tensor2_symmetric_value.hpp.

Constructor & Destructor Documentation

◆ Tensor2_symmetric() [1/5]

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

Definition at line 18 of file Tensor2_symmetric_value.hpp.

18 {}

◆ Tensor2_symmetric() [2/5]

template<class T, int Tensor_Dim>
FTensor::Tensor2_symmetric< T, Tensor_Dim >::Tensor2_symmetric ( d00)

Definition at line 21 of file Tensor2_symmetric_value.hpp.

22  {
23  Tensor2_symmetric_constructor<T,Tensor_Dim>(data,d00);
24  }
T data[(Tensor_Dim *(Tensor_Dim+1))/2]

◆ Tensor2_symmetric() [3/5]

template<class T, int Tensor_Dim>
FTensor::Tensor2_symmetric< T, Tensor_Dim >::Tensor2_symmetric ( d00,
d01,
d11 
)

Definition at line 27 of file Tensor2_symmetric_value.hpp.

28  {
29  Tensor2_symmetric_constructor<T,Tensor_Dim>(data,d00,d01,d11);
30  }
T data[(Tensor_Dim *(Tensor_Dim+1))/2]

◆ Tensor2_symmetric() [4/5]

template<class T, int Tensor_Dim>
FTensor::Tensor2_symmetric< T, Tensor_Dim >::Tensor2_symmetric ( d00,
d01,
d02,
d11,
d12,
d22 
)

Definition at line 33 of file Tensor2_symmetric_value.hpp.

34  {
35  Tensor2_symmetric_constructor<T,Tensor_Dim>(data,d00,d01,d02,d11,d12,d22);
36  }
T data[(Tensor_Dim *(Tensor_Dim+1))/2]

◆ Tensor2_symmetric() [5/5]

template<class T, int Tensor_Dim>
FTensor::Tensor2_symmetric< T, Tensor_Dim >::Tensor2_symmetric ( d00,
d01,
d02,
d03,
d11,
d12,
d13,
d22,
d23,
d33 
)

Definition at line 39 of file Tensor2_symmetric_value.hpp.

41  {
42  Tensor2_symmetric_constructor<T,Tensor_Dim>
43  (data,d00,d01,d02,d03,d11,d12,d13,d22,d23,d33);
44  }
T data[(Tensor_Dim *(Tensor_Dim+1))/2]

Member Function Documentation

◆ internal_contract() [1/2]

template<class T, int Tensor_Dim>
template<int N>
T FTensor::Tensor2_symmetric< T, Tensor_Dim >::internal_contract ( const Number< N > &  ) const
private

Definition at line 223 of file Tensor2_symmetric_value.hpp.

224  {
225  return data[N-1+((N-1)*(2*Tensor_Dim-N))/2]
226  + internal_contract(Number<N-1>());
227  }
T data[(Tensor_Dim *(Tensor_Dim+1))/2]
T internal_contract(const Number< N > &) const
const int N
Definition: speed_test.cpp:3

◆ internal_contract() [2/2]

template<class T, int Tensor_Dim>
T FTensor::Tensor2_symmetric< T, Tensor_Dim >::internal_contract ( const Number< 1 > &  ) const
private

Definition at line 229 of file Tensor2_symmetric_value.hpp.

230  {
231  return data[0];
232  }
T data[(Tensor_Dim *(Tensor_Dim+1))/2]

◆ operator()() [1/14]

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

Definition at line 49 of file Tensor2_symmetric_value.hpp.

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

◆ operator()() [2/14]

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

Definition at line 65 of file Tensor2_symmetric_value.hpp.

66  {
67 #ifdef FTENSOR_DEBUG
68  if(N1>=Tensor_Dim || N1<0 || N2>=Tensor_Dim || N2<0)
69  {
70  std::stringstream s;
71  s << "Bad index in Tensor2_symmetric<T," << Tensor_Dim
72  << ">.operator(" << N1 << "," << N2 << ") const"
73  << std::endl;
74  throw std::runtime_error(s.str());
75  }
76 #endif
77  return N1>N2 ? data[N1+(N2*(2*Tensor_Dim-N2-1))/2]
78  : data[N2+(N1*(2*Tensor_Dim-N1-1))/2];
79  }
T data[(Tensor_Dim *(Tensor_Dim+1))/2]

◆ operator()() [3/14]

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_symmetric<T,Tensor_Dim>,T,Dim0,Dim1,i,j> >::type FTensor::Tensor2_symmetric< T, Tensor_Dim >::operator() ( const Index< i, Dim0 >  ,
const Index< j, Dim1 >   
)

Definition at line 92 of file Tensor2_symmetric_value.hpp.

93  {
94  return Tensor2_Expr<Tensor2_symmetric<T,Tensor_Dim>,T,Dim0,Dim1,i,j>
95  (*this);
96  }

◆ operator()() [4/14]

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_symmetric<T,Tensor_Dim>,T,Dim0,Dim1,i,j> >::type FTensor::Tensor2_symmetric< T, Tensor_Dim >::operator() ( const Index< i, Dim0 >  ,
const Index< j, Dim1 >   
) const

Definition at line 101 of file Tensor2_symmetric_value.hpp.

102  {
103  return Tensor2_Expr<const Tensor2_symmetric<T,Tensor_Dim>,T,Dim0,Dim1,i,j>
104  (*this);
105  }

◆ operator()() [5/14]

template<class T, int Tensor_Dim>
template<char i, char j, int Dim>
std::enable_if<(Tensor_Dim >= Dim), Tensor2_symmetric_Expr<Tensor2_symmetric<T,Tensor_Dim>,T,Dim,i,j> >::type FTensor::Tensor2_symmetric< T, Tensor_Dim >::operator() ( const Index< i, Dim >  ,
const Index< j, Dim >   
)

Definition at line 113 of file Tensor2_symmetric_value.hpp.

114  {
115  return Tensor2_symmetric_Expr<Tensor2_symmetric<T,Tensor_Dim>,T,Dim,i,j>
116  (*this);
117  }

◆ operator()() [6/14]

template<class T, int Tensor_Dim>
template<char i, char j, int Dim>
std::enable_if<(Tensor_Dim >= Dim), Tensor2_symmetric_Expr<const Tensor2_symmetric<T,Tensor_Dim>,T,Dim,i,j> >::type FTensor::Tensor2_symmetric< T, Tensor_Dim >::operator() ( const Index< i, Dim >  ,
const Index< j, Dim >   
) const

Definition at line 122 of file Tensor2_symmetric_value.hpp.

123  {
124  return Tensor2_symmetric_Expr<const Tensor2_symmetric<T,Tensor_Dim>,
125  T,Dim,i,j>(*this);
126  }

◆ operator()() [7/14]

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_symmetric<T,Tensor_Dim>,T,N>, T,Dim,i> >::type FTensor::Tensor2_symmetric< T, Tensor_Dim >::operator() ( const Index< i, Dim >  ,
const Number< N > &   
)

Definition at line 139 of file Tensor2_symmetric_value.hpp.

140  {
141  typedef Tensor2_number_rhs_1<Tensor2_symmetric<T,Tensor_Dim>,T,N>
142  TensorExpr;
143  return Tensor1_Expr<TensorExpr,T,Dim,i>(*this);
144  }
const int N
Definition: speed_test.cpp:3

◆ operator()() [8/14]

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_symmetric<T,Tensor_Dim>, T,N>,T,Dim,i> >::type FTensor::Tensor2_symmetric< T, Tensor_Dim >::operator() ( const Index< i, Dim >  ,
const Number< N > &   
) const

Definition at line 150 of file Tensor2_symmetric_value.hpp.

151  {
152  typedef const Tensor2_number_1<const Tensor2_symmetric<T,Tensor_Dim>,T,N>
153  TensorExpr;
154  return Tensor1_Expr<TensorExpr,T,Dim,i>(TensorExpr(*this));
155  }
const int N
Definition: speed_test.cpp:3

◆ operator()() [9/14]

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_symmetric<T,Tensor_Dim>,T,N>, T,Dim,i> >::type FTensor::Tensor2_symmetric< T, Tensor_Dim >::operator() ( const Number< N > &  ,
const Index< i, Dim >   
)

Definition at line 161 of file Tensor2_symmetric_value.hpp.

162  {
163  typedef Tensor2_number_rhs_0<Tensor2_symmetric<T,Tensor_Dim>,T,N>
164  TensorExpr;
165  return Tensor1_Expr<TensorExpr,T,Dim,i>(*this);
166  }
const int N
Definition: speed_test.cpp:3

◆ operator()() [10/14]

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_symmetric<T,Tensor_Dim>, T,N>,T,Dim,i> >::type FTensor::Tensor2_symmetric< T, Tensor_Dim >::operator() ( const Number< N > &  ,
const Index< i, Dim >   
) const

Definition at line 172 of file Tensor2_symmetric_value.hpp.

173  {
174  typedef const Tensor2_number_0<const Tensor2_symmetric<T,Tensor_Dim>,T,N>
175  TensorExpr;
176  return Tensor1_Expr<TensorExpr,T,Dim,i>(TensorExpr(*this));
177  }
const int N
Definition: speed_test.cpp:3

◆ operator()() [11/14]

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_symmetric<T,Tensor_Dim>, T>,T,Dim,i> >::type FTensor::Tensor2_symmetric< T, Tensor_Dim >::operator() ( const Index< i, Dim >  ,
const int  N 
) const

Definition at line 185 of file Tensor2_symmetric_value.hpp.

186  {
187  typedef const Tensor2_numeral_1<const Tensor2_symmetric<T,Tensor_Dim>,T>
188  TensorExpr;
189  return Tensor1_Expr<TensorExpr,T,Dim,i>(TensorExpr(*this,N));
190  }

◆ operator()() [12/14]

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_symmetric<T,Tensor_Dim>, T>,T,Dim,i> >::type FTensor::Tensor2_symmetric< T, Tensor_Dim >::operator() ( const int  N,
const Index< i, Dim >   
) const

Definition at line 196 of file Tensor2_symmetric_value.hpp.

197  {
198  typedef const Tensor2_numeral_0<const Tensor2_symmetric<T,Tensor_Dim>,T>
199  TensorExpr;
200  return Tensor1_Expr<TensorExpr,T,Dim,i>(TensorExpr(*this,N));
201  }

◆ operator()() [13/14]

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

Definition at line 210 of file Tensor2_symmetric_value.hpp.

211  {
212  return internal_contract(Number<Dim>());
213  }
T internal_contract(const Number< N > &) const

◆ operator()() [14/14]

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

Definition at line 217 of file Tensor2_symmetric_value.hpp.

218  {
219  return internal_contract(Number<Dim>());
220  }
T internal_contract(const Number< N > &) const

Member Data Documentation

◆ data

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

Definition at line 16 of file Tensor2_symmetric_value.hpp.


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