CASM  1.1.0
A Clusters Approach to Statistical Mechanics
CASM::Monte::SiteFracMonteSampler Class Reference

#include <MonteSampler.hh>

+ Inheritance diagram for CASM::Monte::SiteFracMonteSampler:

Detailed Description

Sampler for site fraction.

  • Requires 'comp_n' property to exist in the sampled MonteCarlo object

Definition at line 336 of file MonteSampler.hh.

Public Member Functions

 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. More...
 
 SiteFracMonteSampler (size_type _index, size_type _basis_size, std::string print_name, double data_prec, double data_confidence, size_type data_initsize)
 Construct sampler that must converge. More...
 
void sample (const MonteCarlo &mc, const MonteCounter &counter)
 Sample data from a MonteCarlo calculation. More...
 
std::unique_ptr< SiteFracMonteSamplerclone () const
 Clone this object. More...
 
void clear ()
 Clear all data observations. More...
 
std::pair< bool, size_typeis_equilibrated () const
 Returns pair(true, equil_steps) if equilibration has occured to required precision. More...
 
bool must_converge () const
 Returns true if convergence criteria must be met for Monte Carlo calculation to be complete. More...
 
double requested_precision () const
 Returns requested precision on the mean. More...
 
bool is_converged (size_type equil_samples) const
 Returns true if convergence criteria have been met for data sampled in range [equil_samples, end) More...
 
double mean (size_type equil_samples) const
 Returns <X> for data sampled in range [equil_samples, end) More...
 
double squared_norm (size_type equil_samples) const
 Returns <X*X> for data sampled in range [equil_samples, end) More...
 
double calculated_precision (size_type equil_samples) const
 Returns calculated precision on the mean for data sampled in range [equil_samples, end) More...
 
const MCDatadata () const
 const Access the raw data observation container More...
 
std::string name () const
 Property name for printing. More...
 

Protected Member Functions

MCDatadata ()
 Access the raw data observation container. More...
 

Private Member Functions

virtual SiteFracMonteSampler_clone () const
 
void _check_convergence (size_type equil_samples) const
 

Private Attributes

size_type m_index
 
size_type m_basis_size
 
bool m_must_converge
 If false, data observations are recorded but shouldn't be used to determine if Monte Carlo run has converged. More...
 
double m_prec
 Requested precision, if must_converge. More...
 
double m_conf
 Requested confidence, if must_converge. More...
 
MCData m_data
 An array of observations, one for every so many steps or passes. More...
 
std::string m_name
 Property name for printing. More...
 
bool m_equilibration_uptodate = false
 
MCDataEquilibration m_equilibration
 
bool m_convergence_uptodate = false
 
size_type m_convergence_start_sample = 0
 
MCDataConvergence m_convergence
 

Constructor & Destructor Documentation

◆ SiteFracMonteSampler() [1/2]

CASM::Monte::SiteFracMonteSampler::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.

Parameters
_indexparam composition index to sample, ex: 0 -> 'a', 1 -> 'b'
_basis_sizenumber of sites per primitive cell
print_nameName to be printed, ex: "site_frac(Mg)"
data_initsizeFor constructing MCData object

Definition at line 199 of file MonteSampler.cc.

◆ SiteFracMonteSampler() [2/2]

CASM::Monte::SiteFracMonteSampler::SiteFracMonteSampler ( size_type  _index,
size_type  _basis_size,
std::string  print_name,
double  data_prec,
double  data_confidence,
size_type  data_initsize 
)

Construct sampler that must converge.

Parameters
_indexparam composition index to sample, ex: 0 -> 'a', 1 -> 'b'
_basis_sizenumber of sites per primitive cell
print_nameName to be printed, ex: "site_frac(Mg)"
data_precRequired precision level
data_confidenceRequired confidence level
data_initsizeFor constructing MCData object

Definition at line 217 of file MonteSampler.cc.

Member Function Documentation

◆ _check_convergence()

void CASM::Monte::MonteSampler::_check_convergence ( size_type  equil_samples) const
inlineprivateinherited

Definition at line 149 of file MonteSampler.hh.

◆ _clone()

virtual SiteFracMonteSampler* CASM::Monte::SiteFracMonteSampler::_clone ( ) const
inlineprivatevirtual

Reimplemented from CASM::Monte::MonteSampler.

Definition at line 357 of file MonteSampler.hh.

◆ calculated_precision()

double CASM::Monte::MonteSampler::calculated_precision ( size_type  equil_samples) const
inlineinherited

Returns calculated precision on the mean for data sampled in range [equil_samples, end)

Definition at line 116 of file MonteSampler.hh.

◆ clear()

void CASM::Monte::MonteSampler::clear ( )
inlineinherited

Clear all data observations.

Definition at line 43 of file MonteSampler.hh.

◆ clone()

std::unique_ptr<SiteFracMonteSampler> CASM::Monte::SiteFracMonteSampler::clone ( ) const
inline

Clone this object.

Definition at line 352 of file MonteSampler.hh.

◆ data() [1/2]

MCData& CASM::Monte::MonteSampler::data ( )
inlineprotectedinherited

Access the raw data observation container.

Definition at line 140 of file MonteSampler.hh.

◆ data() [2/2]

const MCData& CASM::Monte::MonteSampler::data ( ) const
inlineinherited

const Access the raw data observation container

Definition at line 128 of file MonteSampler.hh.

◆ is_converged()

bool CASM::Monte::MonteSampler::is_converged ( size_type  equil_samples) const
inlineinherited

Returns true if convergence criteria have been met for data sampled in range [equil_samples, end)

Definition at line 75 of file MonteSampler.hh.

◆ is_equilibrated()

std::pair<bool, size_type> CASM::Monte::MonteSampler::is_equilibrated ( ) const
inlineinherited

Returns pair(true, equil_steps) if equilibration has occured to required precision.

Definition at line 50 of file MonteSampler.hh.

◆ mean()

double CASM::Monte::MonteSampler::mean ( size_type  equil_samples) const
inlineinherited

Returns <X> for data sampled in range [equil_samples, end)

Definition at line 91 of file MonteSampler.hh.

◆ must_converge()

bool CASM::Monte::MonteSampler::must_converge ( ) const
inlineinherited

Returns true if convergence criteria must be met for Monte Carlo calculation to be complete.

Definition at line 66 of file MonteSampler.hh.

◆ name()

std::string CASM::Monte::MonteSampler::name ( ) const
inlineinherited

Property name for printing.

Definition at line 131 of file MonteSampler.hh.

◆ requested_precision()

double CASM::Monte::MonteSampler::requested_precision ( ) const
inlineinherited

Returns requested precision on the mean.

Definition at line 69 of file MonteSampler.hh.

◆ sample()

void CASM::Monte::SiteFracMonteSampler::sample ( const MonteCarlo mc,
const MonteCounter counter 
)
virtual

Sample data from a MonteCarlo calculation.

Reimplemented from CASM::Monte::MonteSampler.

Definition at line 225 of file MonteSampler.cc.

◆ squared_norm()

double CASM::Monte::MonteSampler::squared_norm ( size_type  equil_samples) const
inlineinherited

Returns <X*X> for data sampled in range [equil_samples, end)

Definition at line 103 of file MonteSampler.hh.

Member Data Documentation

◆ m_basis_size

size_type CASM::Monte::SiteFracMonteSampler::m_basis_size
private

Definition at line 363 of file MonteSampler.hh.

◆ m_conf

double CASM::Monte::MonteSampler::m_conf
privateinherited

Requested confidence, if must_converge.

Definition at line 166 of file MonteSampler.hh.

◆ m_convergence

MCDataConvergence CASM::Monte::MonteSampler::m_convergence
mutableprivateinherited

Definition at line 180 of file MonteSampler.hh.

◆ m_convergence_start_sample

size_type CASM::Monte::MonteSampler::m_convergence_start_sample = 0
mutableprivateinherited

Definition at line 179 of file MonteSampler.hh.

◆ m_convergence_uptodate

bool CASM::Monte::MonteSampler::m_convergence_uptodate = false
mutableprivateinherited

Definition at line 178 of file MonteSampler.hh.

◆ m_data

MCData CASM::Monte::MonteSampler::m_data
privateinherited

An array of observations, one for every so many steps or passes.

Definition at line 169 of file MonteSampler.hh.

◆ m_equilibration

MCDataEquilibration CASM::Monte::MonteSampler::m_equilibration
mutableprivateinherited

Definition at line 177 of file MonteSampler.hh.

◆ m_equilibration_uptodate

bool CASM::Monte::MonteSampler::m_equilibration_uptodate = false
mutableprivateinherited

Definition at line 176 of file MonteSampler.hh.

◆ m_index

size_type CASM::Monte::SiteFracMonteSampler::m_index
private

Definition at line 361 of file MonteSampler.hh.

◆ m_must_converge

bool CASM::Monte::MonteSampler::m_must_converge
privateinherited

If false, data observations are recorded but shouldn't be used to determine if Monte Carlo run has converged.

Definition at line 160 of file MonteSampler.hh.

◆ m_name

std::string CASM::Monte::MonteSampler::m_name
privateinherited

Property name for printing.

Definition at line 172 of file MonteSampler.hh.

◆ m_prec

double CASM::Monte::MonteSampler::m_prec
privateinherited

Requested precision, if must_converge.

Definition at line 163 of file MonteSampler.hh.


The documentation for this class was generated from the following files: