CASM  1.1.0
A Clusters Approach to Statistical Mechanics
ConfigEnumRandomOccupations.hh
Go to the documentation of this file.
1 #ifndef CASM_ConfigEnumRandomOccupations
2 #define CASM_ConfigEnumRandomOccupations
3 
4 #include <functional>
5 
9 #include "casm/external/MersenneTwister/MersenneTwister.h"
11 
12 class MTRand;
13 
14 namespace CASM {
15 
16 class ConfigEnumInput;
17 
27  ConfigEnumRandomOccupationsParams(MTRand &_mtrand, Index _n_config);
28 
30  MTRand &mtrand;
31 
34 };
35 
38 class ConfigEnumRandomOccupations : public InputEnumeratorBase<Configuration> {
39  // -- Required members -------------------
40 
41  public:
43  ConfigEnumRandomOccupationsParams const &params);
44 
46  Index _n_config, MTRand &_mtrand);
47 
48  std::string name() const override;
49 
50  static const std::string enumerator_name;
51 
52  private:
54  void increment() override;
55 
56  // -- Unique -------------------
57 
58  void randomize();
59 
61  MTRand &m_mtrand;
62  Eigen::VectorXi m_max_allowed;
63  std::vector<Index> m_site_selection;
65 };
66 
68 } // namespace CASM
69 
70 #endif
Enumerate n random occupations in a particular Supercell.
void increment() override
Implements increment.
ConfigEnumRandomOccupations(ConfigEnumInput const &_in_config, ConfigEnumRandomOccupationsParams const &params)
std::string name() const override
Derived enumerators must implement name, via ENUM_MEMBERS.
notstd::cloneable_ptr< Configuration > m_current
Base class for implementing specialized input enumerators.
A 'cloneable_ptr' can be used in place of 'unique_ptr'.
Main CASM namespace.
Definition: APICommand.hh:8
INDEX_TYPE Index
For long integer indexing:
Definition: definitions.hh:39
Parameters controlling ConfigEnumRandomOccupations.
ConfigEnumRandomOccupationsParams(MTRand &_mtrand, Index _n_config)
Index n_config
Number of random configurations to generate.