17 #ifndef QMCPLUSPLUS_SCALAR_ESTIMATORBASE_H 18 #define QMCPLUSPLUS_SCALAR_ESTIMATORBASE_H 23 #if !defined(REMOVE_TRACEMANAGER) 29 class ObservableHelper;
65 virtual std::string
getName()
const = 0;
72 inline std::pair<RealType, RealType>
operator[](
int i)
const {
return scalars[i].mean_and_variance(); }
80 for (
int i = 0; i <
scalars.size(); i++)
89 for (
int i = 0; i <
scalars.size(); i++)
101 template<
typename IT>
106 for (
int i = 0; i <
scalars.size(); i++)
109 *first_sq++ =
scalars[i].mean2();
124 template<
typename IT>
128 for (
int i = 0; i <
scalars.size(); i++)
130 *first++ +=
scalars[i].result();
A set of walkers that are to be advanced by Metropolis Monte Carlo.
helper functions for EinsplineSetBuilder
std::pair< RealType, RealType > operator[](int i) const
retrun mean and variance
void takeBlockAverage(IT first, IT first_sq)
take block average and write to common containers for values and squared values
virtual bool isMainEstimator() const
Is this estimator a main estimator i.e. the estimator required for a particular driver.
virtual std::string getName() const =0
virtual const std::string & getSubTypeStr() const =0
String representation of the derived type of the ScalarEstimator.
int FirstIndex
first index within an record of the first element handled by an object
QMCTraits::FullPrecRealType RealType
RealType average(int i=0) const
return average of the
std::vector< accumulator_type > scalars
scalars to be measured
virtual void registerObservables(std::vector< ObservableHelper > &h5dec, hdf_archive &file)=0
add descriptors of observables to utilize hdf5
virtual int size() const
return the size of scalars it manages
void takeBlockAverage(IT first)
take block average and write to a common container
void addAccumulated(IT first)
add the block accumulated scalars
WalkerList_t::const_iterator const_iterator
const_iterator of Walker container
virtual ~ScalarEstimatorBase()
RealType variance(int i=0) const
return a variance
virtual void accumulate(const MCWalkerConfiguration &W, WalkerIterator first, WalkerIterator last, RealType wgt)=0
a virtual function to accumulate observables or collectables
std::vector< accumulator_type > scalars_saved
scalars saved
void clear()
clear the scalars to collect
WalkerConfigurations::Walker_t Walker_t
std::vector< std::reference_wrapper< T > > RefVector
virtual void add2Record(RecordNamedProperty< RealType > &record)=0
add the content of the scalar estimator to the record
MCWalkerConfiguration::const_iterator WalkerIterator
QTFull::RealType FullPrecRealType
Abstract class for an estimator of a scalar operator.
virtual ScalarEstimatorBase * clone()=0
clone the object
int LastIndex
last index within an record of the first element handled by an object
Declaration of a MCWalkerConfiguration.
A container class to represent a walker.
Define and declare accumulator_set.