namespace alps {
template <class T=double, class SIGN=double>
class RecordableObservable
{
public:
typedef T value_type;
typedef SIGN sign_type;
RecordableObservable();
virtual void operator<<(const value_type& x) =0;
virtual void add(const value_type& x);
virtual void add(const value_type& x, sign_type s);
virtual bool is_thermalized() const =0;
};
}}
is the data type of the observable.typedef T value_type;
is the data type used to store signs in case of a simulation with a sign problem. It defaults to double.typedef SIGN sign_type;
The default constructor.RecordableObservable();
is a function that must be implemented by the derived class. It records a measurement/virtual void operator<<(const value_type& x) =0;
defaults to operator<<, recording a measurement.virtual void add(const value_type& x);
reords a measurement for a simulation with a sign problem. This needs to be overridden by an observable class supporting the sign problem. The default implementation calls add(x) if the sign s is one, and throws a std::logic_error otherwise.virtual void add(const value_type& x, sign_type s);
returns true if the observable has recorded measurements after the thermalization (equilibration) steps.virtual bool is_thermalized() const =0;
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)