v0.6.10
Public Member Functions | Private Member Functions | Private Attributes | List of all members
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, 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>
Tensor2_Expr< Tensor2_symmetric< T, Tensor_Dim >, T, Dim0, Dim1, i, j > operator() (const Index< i, Dim0 >, const Index< j, Dim1 >)
 
template<char i, char j, int Dim0, int Dim1>
Tensor2_Expr< const Tensor2_symmetric< T, Tensor_Dim >, T, Dim0, Dim1, i, j > operator() (const Index< i, Dim0 >, const Index< j, Dim1 >) const
 
template<char i, char j, int Dim>
Tensor2_symmetric_Expr< Tensor2_symmetric< T, Tensor_Dim >, T, Dim, i, j > operator() (const Index< i, Dim >, const Index< j, Dim >)
 
template<char i, char j, int Dim>
Tensor2_symmetric_Expr< const Tensor2_symmetric< T, Tensor_Dim >, T, Dim, i, j > operator() (const Index< i, Dim >, const Index< j, Dim >) const
 
template<char i, int N, int Dim>
Tensor1_Expr< Tensor2_number_rhs_1< Tensor2_symmetric< T, Tensor_Dim >, T, N >, T, Dim, i > operator() (const Index< i, Dim >, const Number< N > &)
 
template<char i, int N, int Dim>
Tensor1_Expr< const Tensor2_number_1< const Tensor2_symmetric< T, Tensor_Dim >, T, N >, T, Dim, i > operator() (const Index< i, Dim >, const Number< N > &) const
 
template<char i, int N, int Dim>
Tensor1_Expr< Tensor2_number_rhs_0< Tensor2_symmetric< T, Tensor_Dim >, T, N >, T, Dim, i > operator() (const Number< N > &, const Index< i, Dim >)
 
template<char i, int N, int Dim>
Tensor1_Expr< const Tensor2_number_0< const Tensor2_symmetric< T, Tensor_Dim >, T, N >, T, Dim, i > operator() (const Number< N > &, const Index< i, Dim >) const
 
template<char i, int Dim>
Tensor1_Expr< const Tensor2_numeral_1< const Tensor2_symmetric< T, Tensor_Dim >, T >, T, Dim, i > operator() (const Index< i, Dim >, const int N) const
 
template<char i, int Dim>
Tensor1_Expr< const Tensor2_numeral_0< const Tensor2_symmetric< T, Tensor_Dim >, T >, T, Dim, i > operator() (const int N, const Index< i, Dim >) const
 
template<char i, int Dim>
operator() (const Index< i, Dim >, const Index< i, Dim >)
 
template<char i, int Dim>
operator() (const Index< i, Dim >, const Index< i, Dim >) const
 

Private Member Functions

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

Private Attributes

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

Detailed Description

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

Definition at line 4 of file Tensor2_symmetric_value.hpp.

Constructor & Destructor Documentation

◆ Tensor2_symmetric() [1/4]

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

Definition at line 8 of file Tensor2_symmetric_value.hpp.

8 {}

◆ Tensor2_symmetric() [2/4]

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

Definition at line 11 of file Tensor2_symmetric_value.hpp.

◆ Tensor2_symmetric() [3/4]

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

Definition at line 17 of file Tensor2_symmetric_value.hpp.

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

◆ Tensor2_symmetric() [4/4]

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

Definition at line 23 of file Tensor2_symmetric_value.hpp.

25  {
27  (data,d00,d01,d02,d03,d11,d12,d13,d22,d23,d33);
28  }
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 Tensor2_symmetric< T, Tensor_Dim >::internal_contract ( const Number< N > &  )
private

Definition at line 195 of file Tensor2_symmetric_value.hpp.

196  {
197  return data[N-1+((N-1)*(2*Tensor_Dim-N))/2]
199  }
T data[(Tensor_Dim *(Tensor_Dim+1))/2]
Definition: Number.hpp:8
const int N
Definition: speed_test.cpp:3
T internal_contract(const Number< N > &)

◆ internal_contract() [2/2]

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

Definition at line 201 of file Tensor2_symmetric_value.hpp.

202  {
203  return data[0];
204  }
T data[(Tensor_Dim *(Tensor_Dim+1))/2]

◆ operator()() [1/14]

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

Definition at line 33 of file Tensor2_symmetric_value.hpp.

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

◆ operator()() [2/14]

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

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 << ") const"
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()() [3/14]

template<class T, int Tensor_Dim>
template<char i, char j, int Dim0, int Dim1>
Tensor2_Expr<Tensor2_symmetric<T,Tensor_Dim>,T,Dim0,Dim1,i,j> Tensor2_symmetric< T, Tensor_Dim >::operator() ( const Index< i, Dim0 >  ,
const Index< j, Dim1 >   
)

Definition at line 75 of file Tensor2_symmetric_value.hpp.

76  {
77  return Tensor2_Expr<Tensor2_symmetric<T,Tensor_Dim>,T,Dim0,Dim1,i,j>
78  (*this);
79  }

◆ operator()() [4/14]

template<class T, int Tensor_Dim>
template<char i, char j, int Dim0, int Dim1>
Tensor2_Expr<const Tensor2_symmetric<T,Tensor_Dim>,T,Dim0,Dim1,i,j> Tensor2_symmetric< T, Tensor_Dim >::operator() ( const Index< i, Dim0 >  ,
const Index< j, Dim1 >   
) const

Definition at line 83 of file Tensor2_symmetric_value.hpp.

84  {
86  (*this);
87  }

◆ operator()() [5/14]

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

Definition at line 94 of file Tensor2_symmetric_value.hpp.

◆ operator()() [6/14]

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

Definition at line 102 of file Tensor2_symmetric_value.hpp.

◆ operator()() [7/14]

template<class T, int Tensor_Dim>
template<char i, int N, int Dim>
Tensor1_Expr<Tensor2_number_rhs_1<Tensor2_symmetric<T,Tensor_Dim>,T,N>, T,Dim,i> Tensor2_symmetric< T, Tensor_Dim >::operator() ( const Index< i, Dim >  ,
const Number< N > &   
)

Definition at line 118 of file Tensor2_symmetric_value.hpp.

119  {
121  TensorExpr;
122  return Tensor1_Expr<TensorExpr,T,Dim,i>(*this);
123  }
const int N
Definition: speed_test.cpp:3

◆ operator()() [8/14]

template<class T, int Tensor_Dim>
template<char i, int N, int Dim>
Tensor1_Expr<const Tensor2_number_1<const Tensor2_symmetric<T,Tensor_Dim>, T,N>,T,Dim,i> Tensor2_symmetric< T, Tensor_Dim >::operator() ( const Index< i, Dim >  ,
const Number< N > &   
) const

Definition at line 128 of file Tensor2_symmetric_value.hpp.

129  {
131  TensorExpr;
132  return Tensor1_Expr<TensorExpr,T,Dim,i>(TensorExpr(*this));
133  }
const int N
Definition: speed_test.cpp:3

◆ operator()() [9/14]

template<class T, int Tensor_Dim>
template<char i, int N, int Dim>
Tensor1_Expr<Tensor2_number_rhs_0<Tensor2_symmetric<T,Tensor_Dim>,T,N>, T,Dim,i> Tensor2_symmetric< T, Tensor_Dim >::operator() ( const Number< N > &  ,
const Index< i, Dim >   
)

Definition at line 138 of file Tensor2_symmetric_value.hpp.

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

◆ operator()() [10/14]

template<class T, int Tensor_Dim>
template<char i, int N, int Dim>
Tensor1_Expr<const Tensor2_number_0<const Tensor2_symmetric<T,Tensor_Dim>, T,N>,T,Dim,i> Tensor2_symmetric< T, Tensor_Dim >::operator() ( const Number< N > &  ,
const Index< i, Dim >   
) const

Definition at line 148 of file Tensor2_symmetric_value.hpp.

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

◆ operator()() [11/14]

template<class T, int Tensor_Dim>
template<char i, int Dim>
Tensor1_Expr<const Tensor2_numeral_1<const Tensor2_symmetric<T,Tensor_Dim>, T>,T,Dim,i> Tensor2_symmetric< T, Tensor_Dim >::operator() ( const Index< i, Dim >  ,
const int  N 
) const

Definition at line 160 of file Tensor2_symmetric_value.hpp.

161  {
163  TensorExpr;
164  return Tensor1_Expr<TensorExpr,T,Dim,i>(TensorExpr(*this,N));
165  }

◆ operator()() [12/14]

template<class T, int Tensor_Dim>
template<char i, int Dim>
Tensor1_Expr<const Tensor2_numeral_0<const Tensor2_symmetric<T,Tensor_Dim>, T>,T,Dim,i> Tensor2_symmetric< T, Tensor_Dim >::operator() ( const int  N,
const Index< i, Dim >   
) const

Definition at line 170 of file Tensor2_symmetric_value.hpp.

171  {
173  TensorExpr;
174  return Tensor1_Expr<TensorExpr,T,Dim,i>(TensorExpr(*this,N));
175  }

◆ operator()() [13/14]

template<class T, int Tensor_Dim>
template<char i, int Dim>
T Tensor2_symmetric< T, Tensor_Dim >::operator() ( const Index< i, Dim >  ,
const Index< i, Dim >   
)

Definition at line 183 of file Tensor2_symmetric_value.hpp.

184  {
185  return internal_contract(Number<Dim>());
186  }
Definition: Number.hpp:8
T internal_contract(const Number< N > &)

◆ operator()() [14/14]

template<class T, int Tensor_Dim>
template<char i, int Dim>
T Tensor2_symmetric< T, Tensor_Dim >::operator() ( const Index< i, Dim >  ,
const Index< i, Dim >   
) const

Definition at line 189 of file Tensor2_symmetric_value.hpp.

190  {
191  return internal_contract(Number<Dim>());
192  }
Definition: Number.hpp:8
T internal_contract(const Number< N > &)

Member Data Documentation

◆ data

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

Definition at line 6 of file Tensor2_symmetric_value.hpp.


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