56 template<
class T,
unsigned D>
89 SymTensor(
const T& x00,
const T& x10,
const T& x11,
const T& x20,
const T& x21,
const T& x22)
100 template<
typename T1>
110 for (
int i = 0; i < D; ++i)
112 (*this)(i, i) = t(i, i);
113 for (
int j = i + 1; j < D; ++j)
114 (*
this)(i, j) = (t(i, j) + t(j, i)) * 0.5;
140 for (
int i = 0; i < D; ++i)
142 (*this)(i, i) = rhs(i, i);
143 for (
int j = i + 1; j < D; ++j)
144 (*
this)(i, j) = (rhs(i, j) + rhs(j, i)) * 0.5;
201 for (
int i = 0; i < D; i++)
203 X[((i + 1) * i / 2) + i] = rhs;
208 int size(
void)
const {
return sizeof(*this); }
215 int lo = i < j ? i : j;
216 int hi = i > j ? i : j;
217 return X[((hi + 1) * hi / 2) + lo];
222 int lo = i < j ? i : j;
223 int hi = i > j ? i : j;
224 return X[((hi + 1) * hi / 2) + lo];
248 return X[hi * (hi + 1) / 2 + lo];
255 return X[hi * (hi + 1) / 2 + lo];
320 template<
class T,
unsigned D>
324 for (
int i = 0; i < D; i++)
329 template<
class T,
unsigned D>
387 template<
class T1,
class T2,
unsigned D>
394 template<
class T1,
class T2,
unsigned D>
401 template<
class T1,
class T2,
unsigned D>
408 template<
class T1,
class T2,
unsigned D>
415 template<
class T1,
class T2,
unsigned D>
448 template<
class T,
unsigned D>
449 std::ostream& operator<<(std::ostream& out, const SymTensor<T, D>& rhs)
453 for (
int i = 0; i < D; i++)
455 for (
int j = 0; j < D - 1; j++)
457 out << rhs(i, j) <<
" ";
459 out << rhs(i, D - 1) <<
" ";
466 out <<
" " << rhs(0, 0) <<
" ";
472 #endif // SYM_TENZOR_H #define PAssert(condition)
SymTensor< T, D > & operator*=(const T &rhs)
Type_t & HL(unsigned int hi, unsigned int lo)
SymTensor< T, D > & operator-=(const T &rhs)
helper functions for EinsplineSetBuilder
Type_t operator()(unsigned int i, unsigned int j) const
Type_t operator[](unsigned int i) const
SymTensor< T, D > & operator-=(const SymTensor< T1, D > &rhs)
SymTensor< T, D > & operator/=(const SymTensor< T1, D > &rhs)
SymTensor< T, D > & operator=(const T &rhs)
SymTensor< T, D > & operator=(const SymTensor< T1, D > &rhs)
SymTensor(const Tensor< T, D > &t)
SymTensor(const SymTensor< T1, D > &rhs)
Type_t & operator()(unsigned int i, unsigned int j)
SymTensor(const T &x00, const T &x10, const T &x11)
SymTensor< T, D > & operator+=(const SymTensor< T1, D > &rhs)
SymTensor< T, D > & operator=(const Tensor< T, D > &rhs)
void diagonal(const T &rhs)
Tensor<T,D> class for D by D tensor.
Type_t & operator()(unsigned int i)
SymTensor(DontInitialize)
SymTensor< T, D > & operator*=(const SymTensor< T1, D > &rhs)
#define OHMMS_META_BINARY_OPERATORS(TENT, FUNC, TAG)
SymTensor< T, D > & operator=(const SymTensor< T, D > &rhs)
AntiSymTensor< T, D > transpose(const AntiSymTensor< T, D > &rhs)
SymTensor< T, D > & operator/=(const T &rhs)
Type_t HL(unsigned int hi, unsigned int lo) const
Tensor< typename BinaryReturn< T1, T2, OpMultiply >::Type_t, D > dot(const AntiSymTensor< T1, D > &lhs, const AntiSymTensor< T2, D > &rhs)
Type_t operator()(unsigned int i) const
Type_t & operator[](unsigned int i)
SymTensor< T, D > & operator+=(const T &rhs)
SymTensor(const T &x00, const T &x10, const T &x11, const T &x20, const T &x21, const T &x22)
T trace(const AntiSymTensor< T, D > &)