ALPS Home Libraries License Support People ALPS Web Site

PrevUpHomeNext

Class template half_integer

alps::half_integer

Synopsis

// In header: <alps/model/half_integer.h>

template<typename I> 
class half_integer {
public:
  // types
  typedef I integer_type;

  // member classes/structs/unions

  struct to_distinguish {
  };

  // construct/copy/destruct
  half_integer();
  template<typename J> half_integer(const half_integer< J > &);
  template<typename J> 
    half_integer(J, 
                 typename boost::enable_if< boost::is_integral< J > >::type * = 0);
  template<typename J> 
    half_integer(J, 
                 typename boost::enable_if< boost::mpl::and_< boost::is_float< J >, boost::mpl::not_< boost::is_same< J, double > > > >::type * = 0);
  half_integer(double);
  half_integer(integer_type, const to_distinguish &);

  // public member functions
  double to_double() const;
  integer_type to_integer() const;
  void set_half(integer_type);
  integer_type get_twice() const;
  bool is_odd() const;
  bool is_even() const;
  template<typename J> bool operator==(const half_integer< J > &) const;
  template<typename J> bool operator!=(const half_integer< J > &) const;
  template<typename J> bool operator<(const half_integer< J > &) const;
  template<typename J> bool operator>(const half_integer< J > &) const;
  template<typename J> bool operator<=(const half_integer< J > &) const;
  template<typename J> bool operator>=(const half_integer< J > &) const;
  bool operator==(double) const;
  bool operator!=(double) const;
  bool operator<(double) const;
  bool operator>(double) const;
  bool operator<=(double) const;
  bool operator>=(double) const;
  half_integer operator-() const;
  half_integer & operator++();
  half_integer & operator--();
  half_integer operator++(int);
  half_integer operator--(int);
  template<typename J> half_integer & operator+=(const half_integer< J > &);
  template<typename J> half_integer & operator-=(const half_integer< J > &);
  half_integer & operator+=(double);
  half_integer & operator-=(double);
  template<typename J> half_integer operator+(const half_integer< J > &) const;
  template<typename J> half_integer operator-(const half_integer< J > &) const;
  half_integer operator+(double) const;
  half_integer operator-(double) const;
  integer_type distance(const half_integer &) const;
  half_integer abs() const;

  // public static functions
  static half_integer max BOOST_PREVENT_MACRO_SUBSTITUTION();
  static half_integer min BOOST_PREVENT_MACRO_SUBSTITUTION();
};

Description

half_integer public construct/copy/destruct

  1. half_integer();
  2. template<typename J> half_integer(const half_integer< J > & x);
  3. template<typename J> 
      half_integer(J x, 
                   typename boost::enable_if< boost::is_integral< J > >::type * = 0);
  4. template<typename J> 
      half_integer(J x, 
                   typename boost::enable_if< boost::mpl::and_< boost::is_float< J >, boost::mpl::not_< boost::is_same< J, double > > > >::type * = 0);
  5. half_integer(double x);
  6. half_integer(integer_type i, const to_distinguish &);

half_integer public member functions

  1. double to_double() const;
  2. integer_type to_integer() const;
  3. void set_half(integer_type x);
  4. integer_type get_twice() const;
  5. bool is_odd() const;
  6. bool is_even() const;
  7. template<typename J> bool operator==(const half_integer< J > & rhs) const;
  8. template<typename J> bool operator!=(const half_integer< J > & rhs) const;
  9. template<typename J> bool operator<(const half_integer< J > & rhs) const;
  10. template<typename J> bool operator>(const half_integer< J > & rhs) const;
  11. template<typename J> bool operator<=(const half_integer< J > & rhs) const;
  12. template<typename J> bool operator>=(const half_integer< J > & rhs) const;
  13. bool operator==(double rhs) const;
  14. bool operator!=(double rhs) const;
  15. bool operator<(double rhs) const;
  16. bool operator>(double rhs) const;
  17. bool operator<=(double rhs) const;
  18. bool operator>=(double rhs) const;
  19. half_integer operator-() const;
  20. half_integer & operator++();
  21. half_integer & operator--();
  22. half_integer operator++(int);
  23. half_integer operator--(int);
  24. template<typename J> half_integer & operator+=(const half_integer< J > & x);
  25. template<typename J> half_integer & operator-=(const half_integer< J > & x);
  26. half_integer & operator+=(double x);
  27. half_integer & operator-=(double x);
  28. template<typename J> half_integer operator+(const half_integer< J > & x) const;
  29. template<typename J> half_integer operator-(const half_integer< J > & x) const;
  30. half_integer operator+(double x) const;
  31. half_integer operator-(double x) const;
  32. integer_type distance(const half_integer & x) const;
  33. half_integer abs() const;

half_integer public static functions

  1. static half_integer max BOOST_PREVENT_MACRO_SUBSTITUTION();
  2. static half_integer min BOOST_PREVENT_MACRO_SUBSTITUTION();
Copyright © 1994, 2002-2005 Matthias Troyer, Synge Todo

PrevUpHomeNext