ALPS Home Libraries License Support People ALPS Web Site

PrevUpHomeNext

Class template AbstractSimpleObservable

alps::AbstractSimpleObservable

Synopsis

// In header: <alps/alea/abstractsimpleobservable.h>

template<typename T> 
class AbstractSimpleObservable : public alps::Observable {
public:
  // types
  typedef T                                                                   value_type;        // the data type of the observable 
  typedef average_type< T >::type                                             result_type;       // the data type of averages and errors 
  typedef alps::slice_index< result_type >::type                              slice_index;     
  typedef uint64_t                                                            count_type;        // the count data type: an integral type 
  typedef change_value_type< T, double >::type                                time_type;         // the data type for autocorrelation times 
  typedef change_value_type< T, int >::type                                   convergence_type;
  typedef change_value_type_replace_valarray< value_type, std::string >::type label_type;      

  // construct/copy/destruct
  AbstractSimpleObservable(const std::string & = "", 
                           const label_type & = label_type());
  ~AbstractSimpleObservable();

  // public member functions
  virtual count_type count() const = 0;
  virtual result_type mean() const = 0;
  virtual result_type variance() const;
  virtual result_type error() const = 0;
  virtual convergence_type converged_errors() const = 0;
  virtual bool has_minmax() const;
  virtual value_type min BOOST_PREVENT_MACRO_SUBSTITUTION() const;
  virtual value_type max BOOST_PREVENT_MACRO_SUBSTITUTION() const;
  virtual bool has_tau() const;
  virtual time_type tau() const;
  virtual bool has_variance() const;
  virtual count_type bin_number() const;
  virtual count_type max_bin_number() const;
  virtual count_type bin_size() const;
  virtual const value_type & bin_value(count_type) const;
  virtual count_type bin_number2() const;
  virtual const value_type & bin_value2(count_type) const;
  template<typename S> 
    SimpleObservableEvaluator< typename element_type< T >::type > 
    slice(S, const std::string & = "") const;
  template<typename S> 
    SimpleObservableEvaluator< typename element_type< T >::type > 
    operator[](S) const;
  void extract_timeseries(ODump &) const;
  virtual void 
  write_xml(oxstream &, 
            const boost::filesystem::path & = boost::filesystem::path()) const;
  void write_xml_scalar(oxstream &, const boost::filesystem::path &) const;
  void write_xml_vector(oxstream &, const boost::filesystem::path &) const;
  virtual std::string evaluation_method(Target) const;
  operator SimpleObservableEvaluator< value_type >() const;
  void set_label(const label_type &);
  const label_type & label() const;
  virtual void save(ODump &) const;
  virtual void load(IDump &);
  virtual void save(hdf5::archive &) const;
  virtual void load(hdf5::archive &);

  // private member functions
  virtual SimpleObservableEvaluator< value_type > make_evaluator() const;
  virtual void write_more_xml(oxstream &, slice_index = slice_index()) const;
};

Description

AbstractSimpleObservable public construct/copy/destruct

  1. AbstractSimpleObservable(const std::string & name = "", 
                             const label_type & l = label_type());
  2. ~AbstractSimpleObservable();

AbstractSimpleObservable public member functions

  1. virtual count_type count() const = 0;
    the number of measurements
  2. virtual result_type mean() const = 0;
    the mean value
  3. virtual result_type variance() const;
    the variance
  4. virtual result_type error() const = 0;
    the error
  5. virtual convergence_type converged_errors() const = 0;
  6. virtual bool has_minmax() const;
    is information about the minimum and maximum value available?
  7. virtual value_type min BOOST_PREVENT_MACRO_SUBSTITUTION() const;
    the minimum value
  8. virtual value_type max BOOST_PREVENT_MACRO_SUBSTITUTION() const;
    the maximum value
  9. virtual bool has_tau() const;
    is autocorrelation information available ?
  10. virtual time_type tau() const;
    the autocorrelation time, throws an exception if not available
  11. virtual bool has_variance() const;
    is variance available ?
  12. virtual count_type bin_number() const;
    the number of bins
  13. virtual count_type max_bin_number() const;
    the number of bins
  14. virtual count_type bin_size() const;
    the number of measurements per bin
  15. virtual const value_type & bin_value(count_type) const;
    the value of a bin
  16. virtual count_type bin_number2() const;
    the number of bins with squared values
  17. virtual const value_type & bin_value2(count_type) const;
    the squared value of a bin
  18. template<typename S> 
      SimpleObservableEvaluator< typename element_type< T >::type > 
      slice(S s, const std::string & newname = "") const;

    slice the data type using a single argument. This can easily be extended when needed to more data types.

    Parameters:

    newname

    optionally a new name for the slice. Default is the same name as the original observable

    s

    the slice

  19. template<typename S> 
      SimpleObservableEvaluator< typename element_type< T >::type > 
      operator[](S s) const;
  20. void extract_timeseries(ODump & dump) const;
  21. virtual void 
    write_xml(oxstream & oxs, 
              const boost::filesystem::path & fn_hdf5 = boost::filesystem::path()) const;

    output the result

  22. void write_xml_scalar(oxstream &, const boost::filesystem::path &) const;
  23. void write_xml_vector(oxstream &, const boost::filesystem::path &) const;
  24. virtual std::string evaluation_method(Target) const;
  25. operator SimpleObservableEvaluator< value_type >() const;
  26. void set_label(const label_type & l);
  27. const label_type & label() const;
  28. virtual void save(ODump & dump) const;
  29. virtual void load(IDump & dump);
  30. virtual void save(hdf5::archive &) const;
  31. virtual void load(hdf5::archive &);

AbstractSimpleObservable private member functions

  1. virtual SimpleObservableEvaluator< value_type > make_evaluator() const;
  2. virtual void write_more_xml(oxstream &, slice_index = slice_index()) const;
Copyright © 1994, 2002-2004, 2012 Matthias Troyer, Synge Todo, Maximilian Poprawe

PrevUpHomeNext