12 double data_confidence,
size_type data_initsize)
13 : m_must_converge(false),
14 m_conf(data_confidence),
15 m_data(data_initsize),
20 double data_confidence,
size_type data_initsize)
21 : m_must_converge(true),
23 m_conf(data_confidence),
24 m_data(data_initsize),
36 std::string print_name,
37 double data_confidence,
39 :
MonteSampler(print_name, data_confidence, data_initsize),
40 m_property_name(_property_name) {}
51 std::string print_name,
double data_prec,
52 double data_confidence,
54 :
MonteSampler(print_name, data_prec, data_confidence, data_initsize),
55 m_property_name(_property_name) {}
74 double data_confidence,
76 :
MonteSampler(print_name, data_confidence, data_initsize),
77 m_property_name(_property_name),
90 double data_prec,
double data_confidence,
92 :
MonteSampler(print_name, data_prec, data_confidence, data_initsize),
93 m_property_name(_property_name),
107 : m_formatter(formatter),
114 auto curr_sample = std::make_pair(counter.
pass(), counter.
step());
115 if (curr_sample != m_last_sample) {
117 m_last_sample = curr_sample;
124 std::shared_ptr<QueryMonteSampler::Formatter> formatter,
size_type _index,
125 std::string print_name,
double data_confidence,
size_type data_initsize)
126 :
MonteSampler(print_name, data_confidence, data_initsize),
132 std::shared_ptr<QueryMonteSampler::Formatter> formatter,
size_type _index,
133 std::string print_name,
double data_prec,
double data_confidence,
135 :
MonteSampler(print_name, data_prec, data_confidence, data_initsize),
137 m_formatter(formatter) {}
156 std::string print_name,
157 double data_confidence,
159 :
MonteSampler(print_name, data_confidence, data_initsize),
161 m_comp_converter(_comp_converter) {}
174 std::string print_name,
double data_prec,
175 double data_confidence,
177 :
MonteSampler(print_name, data_prec, data_confidence, data_initsize),
179 m_comp_converter(_comp_converter) {}
201 std::string print_name,
202 double data_confidence,
204 :
MonteSampler(print_name, data_confidence, data_initsize),
206 m_basis_size(_basis_size) {}
219 double data_prec,
double data_confidence,
size_type data_initsize)
220 :
MonteSampler(print_name, data_prec, data_confidence, data_initsize),
222 m_basis_size(_basis_size) {}
241 std::string print_name,
242 double data_confidence,
244 :
MonteSampler(print_name, data_confidence, data_initsize),
246 m_vacancy_index(_vacancy_index) {}
259 double data_prec,
double data_confidence,
size_type data_initsize)
260 :
MonteSampler(print_name, data_prec, data_confidence, data_initsize),
262 m_vacancy_index(_vacancy_index) {}
267 double atom_sum = 0.0;
Convert between number of species per unit cell and parametric composition.
Eigen::VectorXd param_composition(const Eigen::VectorXd &n) const
Convert number of mol per prim, 'n' to parametric composition 'x'.
void sample(const MonteCarlo &mc, const MonteCounter &counter)
Sample data from a MonteCarlo calculation.
AtomFracMonteSampler(size_type _index, size_type _vacancy_index, std::string print_name, double data_confidence, size_type data_initsize)
Construct sampler that does not need to converge.
size_type m_vacancy_index
void sample(const MonteCarlo &mc, const MonteCounter &counter)
Sample data from a MonteCarlo calculation.
CompositionConverter m_comp_converter
CompMonteSampler(size_type _index, const CompositionConverter &_comp_converter, std::string print_name, double data_confidence, size_type data_initsize)
Construct sampler that does not need to converge.
void push_back(double value)
Add an observation.
Interface base class for all types of Monte Carlo simulations (not meant to be used polymorphically)
const double & scalar_property(std::string property_name) const
const Access a particular scalar property
const Configuration & config() const
const Access current microstate
const Eigen::VectorXd & vector_property(std::string property_name) const
const Access a particular vector property
Track the number of passes, steps and samples taken in a Monte Carlo calculation.
size_type step() const
Number of steps into the current pass.
size_type pass() const
Number of complete passes performed.
An abstract base class for sampling and storing data observations.
MonteSampler(const std::string &print_name, double data_confidence, size_type data_initsize)
Construct sampler that does not need to converge.
const MCData & data() const
const Access the raw data observation container
std::shared_ptr< QueryMonteSampler::Formatter > m_formatter
QueryMonteSampler(std::shared_ptr< QueryMonteSampler::Formatter > formatter, size_type _index, std::string print_name, double data_confidence, size_type data_initsize)
Construct sampler that does not need to converge.
void sample(const MonteCarlo &mc, const MonteCounter &counter)
Sample data from a MonteCarlo calculation.
ScalarMonteSampler(std::string _property_name, std::string print_name, double data_confidence, size_type data_initsize)
Construct sampler that does not need to converge.
void sample(const MonteCarlo &mc, const MonteCounter &counter)
Sample data from a MonteCarlo calculation.
std::string m_property_name
SiteFracMonteSampler(size_type _index, size_type _basis_size, std::string print_name, double data_confidence, size_type data_initsize)
Construct sampler that does not need to converge.
void sample(const MonteCarlo &mc, const MonteCounter &counter)
Sample data from a MonteCarlo calculation.
std::string m_property_name
VectorMonteSampler(std::string _property_name, size_type _index, std::string print_name, double data_confidence, size_type data_initsize)
Construct sampler that does not need to converge.
void sample(const MonteCarlo &mc, const MonteCounter &counter)
Sample data from a MonteCarlo calculation.
Eigen::VectorXd comp(const Configuration &config)
Returns parametric composition, as calculated using PrimClex::param_comp.
Eigen::VectorXd comp_n(const Configuration &config)
Returns the composition, as number of each species per unit cell.
T max(const T &A, const T &B)