QMCPACK
AntiSymTensor< T, D > Class Template Reference
+ Collaboration diagram for AntiSymTensor< T, D >:

Classes

class  AssignProxy
 
class  DontInitialize
 

Public Types

enum  { ElemDim = 2 }
 
enum  { Size = D * (D - 1) / 2 }
 
using Type_t = T
 

Public Member Functions

 AntiSymTensor ()
 
 AntiSymTensor (DontInitialize)
 
 AntiSymTensor (const T &x00)
 
 AntiSymTensor (const T &x10, const T &x20, const T &x21)
 
 AntiSymTensor (const AntiSymTensor< T, D > &rhs)
 
 AntiSymTensor (const Tensor< T, D > &t)
 
 ~AntiSymTensor ()
 
AntiSymTensor< T, D > & operator= (const AntiSymTensor< T, D > &rhs)
 
template<class T1 >
AntiSymTensor< T, D > & operator= (const AntiSymTensor< T1, D > &rhs)
 
AntiSymTensor< T, D > & operator= (const T &rhs)
 
template<class T1 >
AntiSymTensor< T, D > & operator+= (const AntiSymTensor< T1, D > &rhs)
 
template<class T1 >
AntiSymTensor< T, D > & operator-= (const AntiSymTensor< T1, D > &rhs)
 
template<class T1 >
AntiSymTensor< T, D > & operator*= (const AntiSymTensor< T1, D > &rhs)
 
AntiSymTensor< T, D > & operator*= (const T &rhs)
 
template<class T1 >
AntiSymTensor< T, D > & operator/= (const AntiSymTensor< T1, D > &rhs)
 
AntiSymTensor< T, D > & operator/= (const T &rhs)
 
int len (void) const
 
int size (void) const
 
int get_Size (void) const
 
Type_t operator() (unsigned int i, unsigned int j) const
 
AssignProxy operator() (unsigned int i, unsigned int j)
 
Type_toperator[] (unsigned int i)
 
Type_t operator[] (unsigned int i) const
 
Type_toperator() (unsigned int i)
 
Type_t operator() (unsigned int i) const
 

Private Attributes

X [Size]
 

Static Private Attributes

static T Zero = 0
 

Friends

class AssignProxy
 

Detailed Description

template<class T, unsigned D>
class qmcplusplus::AntiSymTensor< T, D >

Definition at line 57 of file AntiSymTensor.h.


Class Documentation

◆ qmcplusplus::AntiSymTensor::DontInitialize

class qmcplusplus::AntiSymTensor::DontInitialize

template<class T, unsigned D>
class qmcplusplus::AntiSymTensor< T, D >::DontInitialize

Definition at line 74 of file AntiSymTensor.h.

+ Collaboration diagram for AntiSymTensor< T, D >::DontInitialize:

Member Typedef Documentation

◆ Type_t

using Type_t = T

Definition at line 60 of file AntiSymTensor.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
ElemDim 

Definition at line 61 of file AntiSymTensor.h.

◆ anonymous enum

anonymous enum
Enumerator
Size 

Definition at line 65 of file AntiSymTensor.h.

66  {
67  Size = D * (D - 1) / 2
68  };

Constructor & Destructor Documentation

◆ AntiSymTensor() [1/6]

AntiSymTensor ( )
inline

Definition at line 71 of file AntiSymTensor.h.

71 { OTAssign<AntiSymTensor<T, D>, T, OpAssign>::apply(*this, T(0), OpAssign()); }

◆ AntiSymTensor() [2/6]

Definition at line 76 of file AntiSymTensor.h.

76 {}

◆ AntiSymTensor() [3/6]

AntiSymTensor ( const T &  x00)
inline

Definition at line 80 of file AntiSymTensor.h.

80 { OTAssign<AntiSymTensor<T, D>, T, OpAssign>::apply(*this, x00, OpAssign()); }

◆ AntiSymTensor() [4/6]

AntiSymTensor ( const T &  x10,
const T &  x20,
const T &  x21 
)
inline

Definition at line 82 of file AntiSymTensor.h.

References AntiSymTensor< T, D >::X.

83  {
84  X[0] = x10;
85  X[1] = x20;
86  X[2] = x21;
87  }

◆ AntiSymTensor() [5/6]

AntiSymTensor ( const AntiSymTensor< T, D > &  rhs)
inline

Definition at line 90 of file AntiSymTensor.h.

91  {
92  OTAssign<AntiSymTensor<T, D>, AntiSymTensor<T, D>, OpAssign>::apply(*this, rhs, OpAssign());
93  }

◆ AntiSymTensor() [6/6]

AntiSymTensor ( const Tensor< T, D > &  t)
inline

Definition at line 97 of file AntiSymTensor.h.

98  {
99  for (int i = 1; i < D; ++i)
100  {
101  for (int j = 0; j < i; ++j)
102  (*this)[((i - 1) * i / 2) + j] = (t(i, j) - t(j, i)) * 0.5;
103  }
104  }

◆ ~AntiSymTensor()

~AntiSymTensor ( )
inline

Definition at line 106 of file AntiSymTensor.h.

106 {};

Member Function Documentation

◆ get_Size()

int get_Size ( void  ) const
inline

Definition at line 169 of file AntiSymTensor.h.

References AntiSymTensor< T, D >::Size.

◆ len()

int len ( void  ) const
inline

Definition at line 167 of file AntiSymTensor.h.

References AntiSymTensor< T, D >::Size.

◆ operator()() [1/4]

Type_t operator() ( unsigned int  i,
unsigned int  j 
) const
inline

Definition at line 200 of file AntiSymTensor.h.

References AntiSymTensor< T, D >::X.

201  {
202  if (i == j)
203  return T(0.0);
204  else if (i < j)
205  return -X[((j - 1) * j / 2) + i];
206  else
207  return X[((i - 1) * i / 2) + j];
208  }

◆ operator()() [2/4]

AssignProxy operator() ( unsigned int  i,
unsigned int  j 
)
inline

Definition at line 216 of file AntiSymTensor.h.

References AntiSymTensor< T, D >::AssignProxy, and AntiSymTensor< T, D >::X.

217  {
218  if (i == j)
220  else
221  {
222  int lo = i < j ? i : j;
223  int hi = i > j ? i : j;
224  return AssignProxy(X[((hi - 1) * hi / 2) + lo], i - j);
225  }
226  }

◆ operator()() [3/4]

Type_t& operator() ( unsigned int  i)
inline

Definition at line 248 of file AntiSymTensor.h.

References PAssert, AntiSymTensor< T, D >::Size, and AntiSymTensor< T, D >::X.

249  {
250  PAssert(i < Size);
251  return X[i];
252  }
#define PAssert(condition)
Definition: OhmmsTinyMeta.h:61

◆ operator()() [4/4]

Type_t operator() ( unsigned int  i) const
inline

Definition at line 254 of file AntiSymTensor.h.

References PAssert, AntiSymTensor< T, D >::Size, and AntiSymTensor< T, D >::X.

255  {
256  PAssert(i < Size);
257  return X[i];
258  }
#define PAssert(condition)
Definition: OhmmsTinyMeta.h:61

◆ operator*=() [1/2]

AntiSymTensor<T, D>& operator*= ( const AntiSymTensor< T1, D > &  rhs)
inline

Definition at line 142 of file AntiSymTensor.h.

143  {
144  OTAssign<AntiSymTensor<T, D>, AntiSymTensor<T1, D>, OpMultiplyAssign>::apply(*this, rhs, OpMultiplyAssign());
145  return *this;
146  }

◆ operator*=() [2/2]

AntiSymTensor<T, D>& operator*= ( const T &  rhs)
inline

Definition at line 147 of file AntiSymTensor.h.

148  {
149  OTAssign<AntiSymTensor<T, D>, T, OpMultiplyAssign>::apply(*this, rhs, OpMultiplyAssign());
150  return *this;
151  }

◆ operator+=()

AntiSymTensor<T, D>& operator+= ( const AntiSymTensor< T1, D > &  rhs)
inline

Definition at line 128 of file AntiSymTensor.h.

129  {
130  OTAssign<AntiSymTensor<T, D>, AntiSymTensor<T1, D>, OpAddAssign>::apply(*this, rhs, OpAddAssign());
131  return *this;
132  }

◆ operator-=()

AntiSymTensor<T, D>& operator-= ( const AntiSymTensor< T1, D > &  rhs)
inline

Definition at line 135 of file AntiSymTensor.h.

136  {
137  OTAssign<AntiSymTensor<T, D>, AntiSymTensor<T1, D>, OpSubtractAssign>::apply(*this, rhs, OpSubtractAssign());
138  return *this;
139  }

◆ operator/=() [1/2]

AntiSymTensor<T, D>& operator/= ( const AntiSymTensor< T1, D > &  rhs)
inline

Definition at line 154 of file AntiSymTensor.h.

155  {
156  OTAssign<AntiSymTensor<T, D>, AntiSymTensor<T1, D>, OpDivideAssign>::apply(*this, rhs, OpDivideAssign());
157  return *this;
158  }

◆ operator/=() [2/2]

AntiSymTensor<T, D>& operator/= ( const T &  rhs)
inline

Definition at line 159 of file AntiSymTensor.h.

160  {
161  OTAssign<AntiSymTensor<T, D>, T, OpDivideAssign>::apply(*this, rhs, OpDivideAssign());
162  return *this;
163  }

◆ operator=() [1/3]

AntiSymTensor<T, D>& operator= ( const AntiSymTensor< T, D > &  rhs)
inline

Definition at line 109 of file AntiSymTensor.h.

110  {
111  OTAssign<AntiSymTensor<T, D>, AntiSymTensor<T, D>, OpAssign>::apply(*this, rhs, OpAssign());
112  return *this;
113  }

◆ operator=() [2/3]

AntiSymTensor<T, D>& operator= ( const AntiSymTensor< T1, D > &  rhs)
inline

Definition at line 115 of file AntiSymTensor.h.

116  {
117  OTAssign<AntiSymTensor<T, D>, AntiSymTensor<T1, D>, OpAssign>::apply(*this, rhs, OpAssign());
118  return *this;
119  }

◆ operator=() [3/3]

AntiSymTensor<T, D>& operator= ( const T &  rhs)
inline

Definition at line 120 of file AntiSymTensor.h.

121  {
122  OTAssign<AntiSymTensor<T, D>, T, OpAssign>::apply(*this, rhs, OpAssign());
123  return *this;
124  }

◆ operator[]() [1/2]

Type_t& operator[] ( unsigned int  i)
inline

Definition at line 234 of file AntiSymTensor.h.

References PAssert, AntiSymTensor< T, D >::Size, and AntiSymTensor< T, D >::X.

235  {
236  PAssert(i < Size);
237  return X[i];
238  }
#define PAssert(condition)
Definition: OhmmsTinyMeta.h:61

◆ operator[]() [2/2]

Type_t operator[] ( unsigned int  i) const
inline

Definition at line 240 of file AntiSymTensor.h.

References PAssert, AntiSymTensor< T, D >::Size, and AntiSymTensor< T, D >::X.

241  {
242  PAssert(i < Size);
243  return X[i];
244  }
#define PAssert(condition)
Definition: OhmmsTinyMeta.h:61

◆ size()

int size ( void  ) const
inline

Definition at line 168 of file AntiSymTensor.h.

168 { return sizeof(*this); }

Friends And Related Function Documentation

◆ AssignProxy

friend class AssignProxy
friend

Member Data Documentation

◆ X

◆ Zero

T Zero = 0
staticprivate

Definition at line 291 of file AntiSymTensor.h.


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