| 36 | |
| 37 | template<class T, class Policies> |
| 38 | class interval |
| 39 | { |
| 40 | private: |
| 41 | struct interval_holder; |
| 42 | struct number_holder; |
| 43 | public: |
| 44 | typedef T base_type; |
| 45 | typedef Policies traits_type; |
| 46 | |
| 47 | T const &lower() const; |
| 48 | T const &upper() const; |
| 49 | |
| 50 | interval(); |
| 51 | interval(T const &v); |
| 52 | template<class T1> interval(T1 const &v); |
| 53 | interval(T const &l, T const &u); |
| 54 | template<class T1, class T2> interval(T1 const &l, T2 const &u); |
| 55 | interval(interval<T, Policies> const &r); |
| 56 | template<class Policies1> interval(interval<T, Policies1> const &r); |
| 57 | template<class T1, class Policies1> interval(interval<T1, Policies1> const &r); |
| 58 | |
| 59 | interval &operator=(T const &v); |
| 60 | template<class T1> interval &operator=(T1 const &v); |
| 61 | interval &operator=(interval<T, Policies> const &r); |
| 62 | template<class Policies1> interval &operator=(interval<T, Policies1> const &r); |
| 63 | template<class T1, class Policies1> interval &operator=(interval<T1, Policies1> const &r); |
| 64 | |
| 65 | void assign(const T& l, const T& u); |
| 66 | |
| 67 | static interval empty(); |
| 68 | static interval whole(); |
| 69 | static interval hull(const T& x, const T& y); |
| 70 | |
| 71 | interval& operator+= (const T& r); |
| 72 | interval& operator+= (const interval& r); |
| 73 | interval& operator-= (const T& r); |
| 74 | interval& operator-= (const interval& r); |
| 75 | interval& operator*= (const T& r); |
| 76 | interval& operator*= (const interval& r); |
| 77 | interval& operator/= (const T& r); |
| 78 | interval& operator/= (const interval& r); |
| 79 | |
| 80 | bool operator< (const interval_holder& r) const; |
| 81 | bool operator> (const interval_holder& r) const; |
| 82 | bool operator<= (const interval_holder& r) const; |
| 83 | bool operator>= (const interval_holder& r) const; |
| 84 | bool operator== (const interval_holder& r) const; |
| 85 | bool operator!= (const interval_holder& r) const; |
| 86 | |
| 87 | bool operator< (const number_holder& r) const; |
| 88 | bool operator> (const number_holder& r) const; |
| 89 | bool operator<= (const number_holder& r) const; |
| 90 | bool operator>= (const number_holder& r) const; |
| 91 | bool operator== (const number_holder& r) const; |
| 92 | bool operator!= (const number_holder& r) const; |
| 93 | |
| 94 | // the following is for internal use only, it is not a published interface |
| 95 | // nevertheless, it's public because friends don't always work correctly. |