namespace alps {
template <class T> class SimpleObservableEvaluator;
template <class T>
class AbstractSimpleObservable: public Observable
{
public:
typedef T value_type;
typedef typename obs_value_traits<T>::result_type result_type;
typedef std::size_t count_type;
typedef typename obs_value_traits<T>::time_type time_type;
AbstractSimpleObservable(const std::string& name="");
virtual ~AbstractSimpleObservable();
virtual count_type count() const =0;
virtual result_type mean() const =0;
virtual result_type error() const =0;
virtual bool has_variance() const;
virtual result_type variance() const;
virtual bool has_minmax() const;
virtual value_type min() const;
virtual value_type max() const;
virtual bool has_tau() const;
virtual time_type tau() const;
virtual count_type bin_number() const;
virtual count_type bin_size() const;
virtual const value_type& bin_value(count_type n) const;
virtual count_type bin_number2() const;
virtual count_type bin_size2() const;
template <class S>
SimpleObservableEvaluator::value_type>
slice(S s, const std::string& newname="") const;
operator SimpleObservableEvaluator<value_type> () const;
};
}
is the data type of the observable.typedef T value_type;
is a type appropriate to store averages and errors of values of type value_type.typedef typename obs_value_traits<T>::result_type result_type;
is an integral type large enough to store the number of measurements for the observable.typedef std::size_t count_type;
is a type appropriate to store autocorrelation times.typedef typename obs_value_traits<T>::time_type time_type;
The constructor takes the name as argument.AbstractSimpleObservable(const std::string& name="");
returns the number of measurementsvirtual count_type count() const =0;
returns the mean value of the measurements.virtual result_type mean() const =0;
returns the best error estimate.virtual result_type error() const =0;
returns true if the variance is available.virtual bool has_variance() const;
returns the variance, if has_variance() evaluates to true. Otherwise a NoMeasurementsError is thrown.virtual result_type variance() const;
returns true if the minimum and maximum values are available.virtual bool has_minmax() const ;
return the minimum and maximum value, if has_minmax() evaluates to true. Otherwise a std::logic_error is thrown.virtual value_type min() const;
virtual value_type max() const;
returns true if the autocorrelation time is available.virtual bool has_tau() const;
returns the autocorrelation time, if has_tau() evaluates to true. Otherwise a std::logic_error is thrown.virtual time_type tau() const;
returns the number of available bins, if binning is implemented for the observable, or zero otherwise. A bin consists of the average of bin_size measurements.virtual uint32_t bin_number() const;
returns the number of measurements in a bin.virtual uint32_t bin_size();
returns the mean value of the measurements in a bin. n needs to be lass than bin_number() or undefined behavior can result.virtual const value_type& bin_value(uint32_t n) const =0;
returns the mean value of the squared measurements in a bin. n needs to be lass than bin_number() or undefined behavior can result.virtual const value_type& bin_value2(uint32_t n) const =0;
returns the number of available bins containing squares of the measurements, if binning is implemented for the observable, or zero otherwise.virtual uint32_t bin_number2() const =0;
returns an observable containing a slice (e.g. in case of an array-valued observable just one entry) of the observable.template <class S>SimpleObservableEvaluator ::value_type> slice(S s, const std::string& newname="") const;
returns an observable containing a slice (e.g. in case of an array-valued observable just one entry) of the observable, by calling slice(s).template <class S>
SimpleObservableEvaluator::value_type> operator[](S s) const;
creates a SimpleObservableEvaluator object, allowing calculations to be performed on the observable.operator SimpleObservableEvaluator<value_type> () const;
copyright (c) 1994-2010 by Matthias Troyer
Distributed under the Boost Software License, Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt)