21 using namespace spoinfo;
40 for (
int i = 0; i < state_vector.size(); ++i)
46 states_t::iterator so = other.
states.begin(), so_end = other.
states.end();
47 for (; so != so_end; ++so)
55 index_min = std::numeric_limits<int>::max();
57 indices_present =
true;
58 energies_present =
true;
59 states_t::iterator i = states.begin(), i_end = states.end();
60 for (; i != i_end; ++i)
64 index_max = std::max(
s.index, index_max);
65 indices_present &=
s.has_index();
66 energies_present &=
s.has_energy();
70 "SPOSetInfo::finish\n indices have not been assigned to states as required\n this is a developer error");
124 app_log() << pad <<
"complete = " << complete() << std::endl;
127 app_log() << pad <<
"min_index = " << min_index() << std::endl;
128 app_log() << pad <<
"max_index = " << max_index() << std::endl;
129 app_log() << pad <<
"contiguous = " << contiguous() << std::endl;
130 app_log() << pad <<
"has_energies = " << has_energies() << std::endl;
133 app_log() << pad <<
"energy_tolerance = " << energy_tolerance() << std::endl;
134 app_log() << pad <<
"# of states = " << size() << std::endl;
135 app_log() << pad <<
"state information:" << std::endl;
136 states_t::iterator
s = states.begin(), s_end = states.end();
137 std::string pad2 = pad +
" ";
139 for (;
s != s_end; ++
s, ++
ns)
141 app_log() << pad <<
" state " <<
ns << std::endl;
158 APP_ABORT(
"SHOSetInfo::energy_sort not all states have an energy assigned");
161 sort(states.begin(), states.end(), energy_order);
163 count_degeneracies();
170 states_t::iterator stmp,
s = states.begin(), s_end = states.end();
177 while (stmp != s_end &&
std::abs((*stmp)->energy - (*s)->energy) < energy_tol)
182 (*s)->degeneracy = g;
185 for (
int n = 0;
n < g; ++
n)
187 (*s)->degeneracy = g;
197 bool index_ord =
false;
198 bool energy_ord =
false;
199 states_t::iterator s_prev,
s;
201 for (
int i = 1; i < size(); ++i)
212 for (
int i = 1; i < size(); ++i)
216 energy_ord &= energy_order(*s_prev, *
s);
219 if (index_ord && energy_ord)
227 count_degeneracies();
234 indices_present =
false;
235 energies_present =
false;
void index_sort()
sort states by index
std::vector< SPOInfo * > states
collection of SPOInfo
bool index_order(const SPOInfo *left, const SPOInfo *right)
comparison function for sorting SPOInfo based on orbital index
void delete_iter(IT first, IT last)
delete the pointers in [first,last)
helper functions for EinsplineSetBuilder
QTBase::RealType RealType
MakeReturn< UnaryNode< FnFabs, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t abs(const Vector< T1, C1 > &l)
void clear()
empty collection and render mutable
void determine_order(RealType tol)
determine the ordering of the states, if any
comparison functor for sorting SPOInfo based on energy
void report(const std::string &pad="")
base class to describe a single orbital in an SPOSet
void count_degeneracies()
count energetic degeneracy of states
bool energy_ordered() const
void modify()
render collection mutable
collection of orbital info for SPOSet instance or builder
#define APP_ABORT(msg)
Widely used but deprecated fatal error macros from legacy code.
const SPOInfo * operator[](int s) const
void energy_sort(RealType tol)
sort states by energy
bool has_energies() const
RealType energy_tolerance() const
QMCTraits::RealType RealType
void add(int n, const T *restrict in, T *restrict out)
QMCTraits::RealType RealType
constexpr RealType no_energy_tol
orderings
enumeration of possible orbital info orderings
void finish(orderings ord=spoinfo::no_order, RealType tol=1e-6)
renders collection immutable, must be called at end of initialization
bool index_ordered() const