14 std::vector<int> max_allowed_on_selected_sites;
16 max_allowed_on_selected_sites.push_back(max_allowed[i]);
19 return max_allowed_on_selected_sites;
23 std::set<Index>
const &site_indices,
24 std::vector<int>
const &counter) {
26 for (
Index site_index : site_indices) {
27 configuration.
set_occ(site_index, counter[i++]);
43 : m_site_index_selection(config_enum_input.sites()),
44 m_counter(
std::vector<int>(config_enum_input.sites().size(), 0),
46 std::vector<int>(config_enum_input.sites().size(), 1)),
48 config_enum_input.configuration())),
49 m_enumerate_on_a_subset_of_supercell_sites(
50 m_site_index_selection.size() !=
51 config_enum_input.configuration().size()) {
80 "ConfigEnumAllOccupations";
84 bool is_valid_config{
false};
105 return current().is_primitive();
bool canonical_guarantee() const
void increment() override
Implements increment.
bool _current_is_valid_for_output() const
Returns true if current() is primitive and canonical.
static const std::string enumerator_name
bool m_enumerate_on_a_subset_of_supercell_sites
True if enumerating on a subset of supercell sites.
std::set< Index > m_site_index_selection
Site index to enumerate on.
notstd::cloneable_ptr< Configuration > m_current
The current configuration.
ConfigEnumAllOccupations(ConfigEnumInput const &config_enum_input)
Construct with a Supercell, using all permutations.
Counter< std::vector< int > > m_counter
Counter over allowed occupation indices on sites in m_site_index_selection.
std::string name() const override
Derived enumerators must implement name, via ENUM_MEMBERS.
const Supercell & supercell() const
Get the Supercell for this Configuration.
void set_occ(Index site_l, int val)
Set occupant variable on site l.
Eigen::VectorXi max_allowed_occupation() const
returns maximum allowed occupation bitstring – used for initializing enumeration counters
bool valid() const
Returns false if enumeration is complete.
virtual jsonParser source(step_type step) const
reference current() const
Access the current ObjectType by reference.
void _invalidate()
Call if enumeration complete.
void _increment_step()
Increment current step value.
step_type step() const
Increments with each enumerated object.
void _set_step(step_type val)
Set current step value.
bool is_guaranteed_for_database_insert(ConfigEnumAllOccupations const &enumerator)
std::set< Index > const & sites() const
Configuration const & configuration() const
void set_occupation(Configuration &configuration, std::set< Index > const &site_indices, std::vector< int > const &counter)
std::vector< int > max_selected_occupation(ConfigEnumInput const &config_enum_input)
void reset_properties(ConfigType &config)
INDEX_TYPE Index
For long integer indexing:
Non-std smart pointer classes and functions.
cloneable_ptr< T > make_cloneable(Args &&... args)
make a cloneable_ptr<T> via T(Args... args)