ALPS Home Libraries License Support People ALPS Web Site

PrevUpHomeNext

Class template AbstractSignedObservable

alps::AbstractSignedObservable

Synopsis

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

template<typename OBS, typename SIGN = double> 
class AbstractSignedObservable :
  public alps::AbstractSimpleObservable< OBS::value_type >
{
public:
  // types
  typedef OBS                                           observable_type; 
  typedef SIGN                                          sign_type;       
  typedef observable_type::value_type                   value_type;        // the data type of the observable 
  typedef average_type< value_type >::type              result_type;       // the data type of averages and errors 
  typedef AbstractSimpleObservable< value_type >        base_type;       
  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< value_type, double >::type time_type;         // the data type for autocorrelation times 
  typedef change_value_type< value_type, int >::type    convergence_type;
  typedef super_type::label_type                        label_type;      

  // construct/copy/destruct
  AbstractSignedObservable(const OBS &, const std::string & = "Sign");
  AbstractSignedObservable(const std::string & = "", 
                           const std::string & = "Sign", 
                           const label_type & = label_type());
  AbstractSignedObservable(const std::string &, const char *, 
                           const label_type & = label_type());
  template<typename OBS2> 
    AbstractSignedObservable(const AbstractSignedObservable< OBS2, SIGN > &);
  template<typename ARG> 
    AbstractSignedObservable(const std::string &, const ARG &, 
                             const label_type & = label_type());
  template<typename ARG> 
    AbstractSignedObservable(const std::string &, std::string &, const ARG &, 
                             const label_type & = label_type());
  ~AbstractSignedObservable();

  // public member functions
   BOOST_STATIC_CONSTANT(int, version = observable_type::version+(1<< 24));
  uint32_t version_id() const;
  ALPS_DUMMY_VOID reset(bool);
  ALPS_DUMMY_VOID output(std::ostream &) const;
  void output_scalar(std::ostream &) const;
  void output_vector(std::ostream &) const;
  void write_xml(oxstream &, const boost::filesystem::path &) const;
  count_type count() const;
  result_type mean() const;
  result_type error() const;
  convergence_type converged_errors() const;
  SimpleObservableEvaluator< value_type > make_evaluator() const;
  template<typename S> 
    AbstractSignedObservable< SimpleObservableEvaluator< typename element_type< value_type >::type >, SIGN > 
    slice(S, const std::string & = "") const;
  template<typename S> 
    AbstractSignedObservable< SimpleObservableEvaluator< typename element_type< value_type >::type >, SIGN > 
    operator[](S) const;
  void save(ODump &) const;
  void load(IDump &);
  void save(hdf5::archive &) const;
  void load(hdf5::archive &);
  Observable * clone() const;
  bool is_signed() const;
  void set_sign_name(const std::string &);
  void set_sign(const Observable &);
  void clear_sign();
  const Observable & sign() const;
  const std::string sign_name() const;
  const Observable & signed_observable() const;
  uint32_t number_of_runs() const;
  Observable * get_run(uint32_t) const;

  // protected member functions
  Observable * convert_mergeable() const;
  void write_more_xml(oxstream &, slice_index) const;
  void merge(const Observable &);
  bool can_merge() const;
  bool can_merge(const Observable &) const;
};

Description

AbstractSignedObservable public construct/copy/destruct

  1. AbstractSignedObservable(const OBS & obs, const std::string & s = "Sign");
  2. AbstractSignedObservable(const std::string & name = "", 
                             const std::string & s = "Sign", 
                             const label_type & l = label_type());
  3. AbstractSignedObservable(const std::string & name, const char * s, 
                             const label_type & l = label_type());
  4. template<typename OBS2> 
      AbstractSignedObservable(const AbstractSignedObservable< OBS2, SIGN > & o);
  5. template<typename ARG> 
      AbstractSignedObservable(const std::string & name, const ARG & arg, 
                               const label_type & l = label_type());
  6. template<typename ARG> 
      AbstractSignedObservable(const std::string & name, std::string & s, 
                               const ARG & arg, 
                               const label_type & l = label_type());
  7. ~AbstractSignedObservable();

AbstractSignedObservable public member functions

  1.  BOOST_STATIC_CONSTANT(int, version = observable_type::version+(1<< 24));
  2. uint32_t version_id() const;
    return a version ID uniquely identifying the class
  3. ALPS_DUMMY_VOID reset(bool equilibrated);

    reset the observable

  4. ALPS_DUMMY_VOID output(std::ostream &) const;

    output the result

  5. void output_scalar(std::ostream &) const;
  6. void output_vector(std::ostream &) const;
  7. void write_xml(oxstream & oxs, const boost::filesystem::path & fn_hdf5) const;

    output the result

  8. count_type count() const;
    the number of measurements
  9. result_type mean() const;
    the mean value
  10. result_type error() const;
    the error
  11. convergence_type converged_errors() const;
  12. SimpleObservableEvaluator< value_type > make_evaluator() const;
  13. template<typename S> 
      AbstractSignedObservable< SimpleObservableEvaluator< typename element_type< value_type >::type >, SIGN > 
      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

  14. template<typename S> 
      AbstractSignedObservable< SimpleObservableEvaluator< typename element_type< value_type >::type >, SIGN > 
      operator[](S s) const;
  15. void save(ODump & dump) const;
  16. void load(IDump & dump);
  17. void save(hdf5::archive &) const;
  18. void load(hdf5::archive &);
  19. Observable * clone() const;

    clones the observable

  20. bool is_signed() const;
    is the observable signed?
  21. void set_sign_name(const std::string & signname);
    set the name of the observable containing the sign for this observable
  22. void set_sign(const Observable & sign);
    set the observable containing the sign
  23. void clear_sign();
    clear any previosuly set sign observable
  24. const Observable & sign() const;
    get a reference to the sign observable
  25. const std::string sign_name() const;
    get the name of the observable containing the sign
  26. const Observable & signed_observable() const;
  27. uint32_t number_of_runs() const;
    get the number of runs which performed measurements for this observable
  28. Observable * get_run(uint32_t) const;
    extract an observable from a specific run only

AbstractSignedObservable protected member functions

  1. Observable * convert_mergeable() const;
    create a copy of the observable that can be merged
  2. void write_more_xml(oxstream & oxs, slice_index it) const;
  3. void merge(const Observable & o);
  4. bool can_merge() const;
    can this observable be merged with one of the same type
  5. bool can_merge(const Observable &) const;
    can this observable be merged with one of the given type
Copyright © 1994, 2002-2004, 2012 Matthias Troyer, Synge Todo, Maximilian Poprawe

PrevUpHomeNext