QMCPACK
SPOSetInfoSimple< SPOI > Struct Template Reference
+ Inheritance diagram for SPOSetInfoSimple< SPOI >:
+ Collaboration diagram for SPOSetInfoSimple< SPOI >:

Public Types

using RealType = QMCTraits::RealType
 

Public Member Functions

 SPOSetInfoSimple ()
 
 ~SPOSetInfoSimple ()
 
void add (SPOI *state)
 
void clear ()
 
int size () const
 
SPOI * operator[] (int s) const
 
SPOI *& operator[] (int s)
 
void index_sort ()
 
void energy_sort (RealType tol=1e-6, bool assign_indices=false)
 

Public Attributes

std::vector< SPOI * > states
 

Detailed Description

template<typename SPOI>
struct qmcplusplus::SPOSetInfoSimple< SPOI >

Definition at line 137 of file SPOSetInfo.h.

Member Typedef Documentation

◆ RealType

Definition at line 139 of file SPOSetInfo.h.

Constructor & Destructor Documentation

◆ SPOSetInfoSimple()

SPOSetInfoSimple ( )
inline

Definition at line 142 of file SPOSetInfo.h.

142 {}

◆ ~SPOSetInfoSimple()

~SPOSetInfoSimple ( )
inline

Definition at line 144 of file SPOSetInfo.h.

144 { delete_iter(states.begin(), states.end()); }
void delete_iter(IT first, IT last)
delete the pointers in [first,last)
std::vector< SPOI * > states
Definition: SPOSetInfo.h:140

Member Function Documentation

◆ add()

void add ( SPOI *  state)
inline

Definition at line 146 of file SPOSetInfo.h.

147  {
148  states.push_back(state);
149  state = 0;
150  }
std::vector< SPOI * > states
Definition: SPOSetInfo.h:140

◆ clear()

void clear ( )
inline

Definition at line 152 of file SPOSetInfo.h.

153  {
154  delete_iter(states.begin(), states.end());
155  states.clear();
156  }
void delete_iter(IT first, IT last)
delete the pointers in [first,last)
std::vector< SPOI * > states
Definition: SPOSetInfo.h:140

◆ energy_sort()

void energy_sort ( RealType  tol = 1e-6,
bool  assign_indices = false 
)
inline

Definition at line 166 of file SPOSetInfo.h.

167  {
168  spoinfo::EnergyOrder energy_order(tol);
169  sort(states.begin(), states.end(), energy_order);
170  if (assign_indices)
171  for (int i = 0; i < size(); ++i)
172  states[i]->index = i;
173  }
std::vector< SPOI * > states
Definition: SPOSetInfo.h:140

◆ index_sort()

void index_sort ( )
inline

Definition at line 164 of file SPOSetInfo.h.

164 { sort(states.begin(), states.end(), spoinfo::index_order); }
bool index_order(const SPOInfo *left, const SPOInfo *right)
comparison function for sorting SPOInfo based on orbital index
Definition: SPOInfo.h:78
std::vector< SPOI * > states
Definition: SPOSetInfo.h:140

◆ operator[]() [1/2]

SPOI* operator[] ( int  s) const
inline

Definition at line 160 of file SPOSetInfo.h.

160 { return states[s]; }
std::vector< SPOI * > states
Definition: SPOSetInfo.h:140

◆ operator[]() [2/2]

SPOI*& operator[] ( int  s)
inline

Definition at line 162 of file SPOSetInfo.h.

162 { return states[s]; }
std::vector< SPOI * > states
Definition: SPOSetInfo.h:140

◆ size()

int size ( void  ) const
inline

Definition at line 158 of file SPOSetInfo.h.

Referenced by SPOSetInfoSimple< qmcplusplus::SHOState >::energy_sort().

158 { return states.size(); }
std::vector< SPOI * > states
Definition: SPOSetInfo.h:140

Member Data Documentation

◆ states


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