namespace alps { template <class T> class SimpleObservableEvaluator : public AbstractSimpleObservable<T> { public: typedef T value_type; typedef ... time_type; typedef std::size_t count_type; typedef ... result_type; enum { version=...}; SimpleObservableEvaluator(std::string=""); SimpleObservableEvaluator(const Observable&, std::string n=""); const SimpleObservableEvaluator<T>& operator = (const AbstractSimpleObservable<T>& obs); SimpleObservableEvaluator<T>& operator<< (const AbstractSimpleObservable<T>& obs) template <class S> SimpleObservableEvaluator<typename obs_value_slice<T,S>::value_type> slice(S ,const std::string="") const; SimpleObservableEvaluator<T> operator-() const; template <class X> const SimpleObservableEvaluator<T>& operator+=(X); template <class X> const SimpleObservableEvaluator<T>& operator-=(X); template <class X> const SimpleObservableEvaluator<T>& operator*=(X); template <class X> const SimpleObservableEvaluator<T>& operator/=(X); const SimpleObservableEvaluator<T>& operator+=(const SimpleObservableEvaluator<T>&); const SimpleObservableEvaluator<T>& operator-=(const SimpleObservableEvaluator<T>&); template <class X> const SimpleObservableEvaluator<T>& operator*=(const SimpleObservableEvaluator<X>&); template <class X> const SimpleObservableEvaluator<T>& operator/=(const SimpleObservableEvaluator<X>&); }; template <class T, class Y> inline SimpleObservableEvaluator<T> operator+(const SimpleObservableEvaluator<T>& x, const Y& y); template <class T, class Y> inline SimpleObservableEvaluator<T> operator-(const SimpleObservableEvaluator<T>& x, const Y& y); template <class T, class Y> inline SimpleObservableEvaluator<T> operator*(const SimpleObservableEvaluator<T>& x, const Y& y); template <class T, class Y> inline SimpleObservableEvaluator<T> operator/(const SimpleObservableEvaluator<T>& x, const Y& y); template <class T> inline SimpleObservableEvaluator<T> operator+(const T& x, const SimpleObservableEvaluator<T>& y); template <class T> inline SimpleObservableEvaluator<T> operator-(const T& x, const SimpleObservableEvaluator<T>& y); template <class T> inline SimpleObservableEvaluator<T> operator*(const T& x, const SimpleObservableEvaluator<T>& y); template <class T> inline SimpleObservableEvaluator<T> operator/(const T& x, const SimpleObservableEvaluator<T>& y); template <class T> alps::SimpleObservableEvaluator<T> exp (const alps::SimpleObservableEvaluator<T>& x); template <class T> alps::SimpleObservableEvaluator<T> log (const alps::SimpleObservableEvaluator<T>& x); template <class T> alps::SimpleObservableEvaluator<T> sqrt (const alps::SimpleObservableEvaluator<T>& x); template <class T> alps::SimpleObservableEvaluator<T> sin (const alps::SimpleObservableEvaluator<T>& x); template <class T> alps::SimpleObservableEvaluator<T> cos (const alps::SimpleObservableEvaluator<T>& x); typedef SimpleObservableEvaluator<double> RealObsevaluator; typedef SimpleObservableEvaluator<int32_t> IntObsevaluator; typedef SimpleObservableEvaluator<std::complex<double> > ComplexObsevaluator; typedef SimpleObservableEvaluator<std::valarray<double> > RealVectorObsevaluator; }
It can be constructed from any SimpleObservable.
In addition to the same evaluation interface as AbstractSimpleObservable, the SimpleObservableEvaluator objects can be merged from more than one Monte Carlo simulation, and arithmetic evaluations like sums and products can be performed.
Depending on the original binning strategy, a full and reliable error analysis using jack-knife is possible on functions of one or more variables.
In addition to the basic algebraic operations, such as addition, subtraction, multiplication and division of observables and observables and of observables and scalars (or objects of type value_type) a few basic functions are implemented for the SimpleObservableEvaluator:
The following additional members are defined
is a compile-time constant, same as version_id().enum { version=...};
the default constructor with an optional argument to name the observable.SimpleObservableEvaluator(std::string n="");
creates a SimpleObservableEvaluator from an Observable, optionally renaming it.SimpleObservableEvaluator(const Observable&, std::string n="");
assigns an observable to the SimpleObservableEvaluator.const SimpleObservableEvaluator<T>& operator = (const AbstractSimpleObservable<T>& obs);
merges additional observables (e.g. from additional Monte carlo simulations for the same system) to the SimpleObservableEvaluator, to facilitate an evaluation of the combined measurements.SimpleObservableEvaluator<T>& operator<< (const AbstractSimpleObservable<T>& obs)
extracts a slice from a SimpleObservableEvaluator. E.g. for a vector-valued observable an evaluator for just one index can be extracted. The slice can optionally be given a new name.template <class S> SimpleObservableEvaluator<typename obs_value_slice<T,S>::value_type> slice(S ,const std::string n="") const;
are typdedefs for the commonly used SimpleObservableEvaluators.typedef SimpleObservableEvaluator<double> RealObsevaluator; typedef SimpleObservableEvaluator<int32_t> IntObsevaluator; typedef SimpleObservableEvaluator<std::complex<double> > ComplexObsevaluator; typedef SimpleObservableEvaluator<std::valarray<double> > RealVectorObsevaluator;
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)