ALPS Project: alea library

Header file alea/simpleobservable.h

This header contains the class to record standard Monte Carlo measurements.

Synopsis

namespace alps {

template <class T=double>
class SimpleObservable
: public AbstractSimpleObservable<T>,
public RecordableObservable<T>
{
public:
typedef T value_type;
typedef ... time_type;
typedef ... count_type;
typedef ... result_type;
typedef BINNING binning_type;

enum { version=...};

SimpleObservable(const std::string& name="" ,uint32_t s=0);
  SimpleObservable(const std::string& name ,const binning_type&);

uint32_t version_id() const;

Observable* clone() const;

void output(std::ostream&) const;
void reset(bool =false);

result_type mean() const;
bool has_variance() const;
result_type variance() const;
result_type error() const;
count_type count() const;
bool has_minmax() const;
value_type min() const;
value_type max() const;
bool has_tau() const;
time_type tau() const;

virtual bool is_thermalized() const;
uint32_t get_thermalization() const;
bool can_set_thermalization() const;

void operator<<(const T& x);

count_type bin_size() const;
void set_bin_size(count_type s);
count_type bin_number() const;
count_type bin_number2() const;
count_type max_bin_number() const;
void set_bin_number(count_type n);
const value_type& bin_value(count_type n) const;
const value_type& bin_value2(count_type n) const;

void save(ODump& dump) const;
void load(IDump& dump);

void compact();
};

}

The SimpleObservable class

is the actual class for standard observables to perform measurements with. It is templated on the data type for the measurements and on the binning strategy In addition to implementations to all virtual function members of the base classes RecordableObservable. AbstractSimpleObservable, and indirectly from Observable it provides the following members:
typedef BINNING binning_type;
the binning strategy type.
enum { version=...};
a compile-time constant, same as version_id
BasicSimpleObservable(const std::string& name ,const binning_type&);
BasicSimpleObservable(const std::string& name ,uint32_t s=0);
The constructors take a second argument which is used to initialize the binning startegies. See the documentation for binning strategies for more information.

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)