CASM
AClustersApproachtoStatisticalMechanics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
CASM::ScalarMonteSampler Class Reference

#include <MonteSampler.hh>

+ Inheritance diagram for CASM::ScalarMonteSampler:

Detailed Description

Sampler for a scalar property.

Definition at line 194 of file MonteSampler.hh.

Public Types

typedef MCData::size_type size_type
 

Public Member Functions

 ScalarMonteSampler (std::string _property_name, std::string print_name, double data_confidence, size_type data_initsize)
 Construct sampler that does not need to converge. More...
 
 ScalarMonteSampler (std::string _property_name, 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
< ScalarMonteSampler
clone () 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 ScalarMonteSampler_clone () const
 

Private Attributes

std::string m_property_name
 

Member Typedef Documentation

Definition at line 26 of file MonteSampler.hh.

Constructor & Destructor Documentation

CASM::ScalarMonteSampler::ScalarMonteSampler ( std::string  _property_name,
std::string  print_name,
double  data_confidence,
size_type  data_initsize 
)

Construct sampler that does not need to converge.

Parameters
_property_nameName of scalar property to sample, ex: "formation_energy"
print_nameName to be printed, ex: "formation_energy"
data_initsizeFor constructing MCData object

Definition at line 42 of file MonteSampler.cc.

CASM::ScalarMonteSampler::ScalarMonteSampler ( std::string  _property_name,
std::string  print_name,
double  data_prec,
double  data_confidence,
size_type  data_initsize 
)

Construct sampler that must converge.

Parameters
_property_nameName of scalar property to sample, ex: "formation_energy"
print_nameName to be printed, ex: "formation_energy"
data_precRequired precision level
data_confidenceRequired confidence level
data_initsizeFor constructing MCData object

Definition at line 57 of file MonteSampler.cc.

Member Function Documentation

virtual ScalarMonteSampler* CASM::ScalarMonteSampler::_clone ( ) const
inlineprivatevirtual

Reimplemented from CASM::MonteSampler.

Definition at line 222 of file MonteSampler.hh.

double CASM::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 119 of file MonteSampler.hh.

void CASM::MonteSampler::clear ( )
inlineinherited

Clear all data observations.

Definition at line 47 of file MonteSampler.hh.

std::unique_ptr<ScalarMonteSampler> CASM::ScalarMonteSampler::clone ( ) const
inline

Clone this object.

Definition at line 216 of file MonteSampler.hh.

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

const Access the raw data observation container

Definition at line 130 of file MonteSampler.hh.

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

Access the raw data observation container.

Definition at line 148 of file MonteSampler.hh.

bool CASM::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 82 of file MonteSampler.hh.

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

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

Definition at line 55 of file MonteSampler.hh.

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

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

Definition at line 97 of file MonteSampler.hh.

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

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

Definition at line 70 of file MonteSampler.hh.

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

Property name for printing.

Definition at line 135 of file MonteSampler.hh.

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

Returns requested precision on the mean.

Definition at line 75 of file MonteSampler.hh.

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

Sample data from a MonteCarlo calculation.

Reimplemented from CASM::MonteSampler.

Definition at line 67 of file MonteSampler.cc.

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

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

Definition at line 108 of file MonteSampler.hh.

Member Data Documentation

std::string CASM::ScalarMonteSampler::m_property_name
private

Definition at line 226 of file MonteSampler.hh.


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