#include <interval.hpp>
Public Types | |
typedef T | value_type |
Type of the limits. | |
typedef binary_function_traits< function_tag::minus, T, T >::result_type | difference_type |
Type of difference between two objects of value_type. | |
Public Member Functions | |
interval () | |
Interval with left == right == 0. | |
template<typename T1> | |
interval (const T1 &x) | |
Interval with left == right == x. | |
template<typename T1, typename T2> | |
interval (const T1 &first_a, const T2 &second_a) | |
Interval from first_a to second_a. It can be empty, that's first_a > second_a. | |
template<typename T1> | |
interval (const interval< T1 > &x) | |
Interval as a copy of another interval. | |
interval (const char *s) | |
Initialization from a string. | |
template<typename T1> | |
interval & | operator= (const T1 &x) |
template<typename T1> | |
interval & | operator= (const interval< T1 > &x) |
interval & | operator= (const char *s) |
const T & | first () const |
const T & | left () const |
const T & | second () const |
const T & | right () const |
T & | first () |
T & | left () |
T & | second () |
T & | right () |
bool | is_point () const |
Return true iff left == rigth. | |
bool | is_empty () const |
Return true iff left > rigth. | |
bool | is_negligible () const |
Return true iff left >= right. | |
interval_kind | kind () const |
binary_function_traits< function_tag::minus, T, T >::result_type | length () const |
Length of the interval as a difference between right and left limts. It can be negative. | |
void | turn () |
Swaps left and right. | |
template<typename T1> | |
bool | on_limits (const T1 &x) const |
template<typename T1> | |
bool | inside (const T1 &x) const |
True iff x is strictly inside of the interval/segment. | |
template<typename T1> | |
bool | outside (const T1 &x) const |
True iff x is strictly outside of the interval/segment. | |
template<typename T1> | |
interval & | operator+= (const interval< T1 > &x) |
template<typename T1> | |
interval & | operator-= (const interval< T1 > &x) |
template<typename T1> | |
interval & | operator *= (const interval< T1 > &x) |
template<typename T1> | |
interval & | operator/= (const interval< T1 > &x) |
interval & | operator++ () |
interval & | operator-- () |
interval | operator++ (int) |
interval | operator-- (int) |
const interval & | operator+ () const |
interval | operator- () const |
The class holds a pair of values --- the limits of the interval: left and right (or first and second). This class is appropriate for doing interval arithmetic. Empty interval is valid state; it represents by left > right values.
Definition at line 57 of file interval.hpp.
typedef binary_function_traits<function_tag::minus, T, T>::result_type Arageli::interval< T >::difference_type |
typedef T Arageli::interval< T >::value_type |
Arageli::interval< T >::interval | ( | ) | [inline] |
Arageli::interval< T >::interval | ( | const T1 & | x | ) | [inline] |
Arageli::interval< T >::interval | ( | const T1 & | first_a, | |
const T2 & | second_a | |||
) | [inline] |
Interval from first_a to second_a. It can be empty, that's first_a > second_a.
Definition at line 81 of file interval.hpp.
Arageli::interval< T >::interval | ( | const interval< T1 > & | x | ) | [inline] |
Arageli::interval< T >::interval | ( | const char * | s | ) | [inline] |
Initialization from a string.
The interval can represented as a string in shape "x", "(x)" or "(x, x)". See operator>> for details.
Definition at line 92 of file interval.hpp.
T& Arageli::interval< T >::first | ( | ) | [inline] |
Definition at line 126 of file interval.hpp.
const T& Arageli::interval< T >::first | ( | ) | const [inline] |
Definition at line 121 of file interval.hpp.
bool Arageli::interval< T >::inside | ( | const T1 & | x | ) | const [inline] |
bool Arageli::interval< T >::is_empty | ( | ) | const [inline] |
bool Arageli::interval< T >::is_negligible | ( | ) | const [inline] |
bool Arageli::interval< T >::is_point | ( | ) | const [inline] |
interval_kind Arageli::interval< T >::kind | ( | ) | const [inline] |
Definition at line 140 of file interval.hpp.
T& Arageli::interval< T >::left | ( | ) | [inline] |
Definition at line 127 of file interval.hpp.
const T& Arageli::interval< T >::left | ( | ) | const [inline] |
Definition at line 122 of file interval.hpp.
binary_function_traits<function_tag::minus, T, T>::result_type Arageli::interval< T >::length | ( | ) | const [inline] |
Length of the interval as a difference between right and left limts. It can be negative.
Definition at line 145 of file interval.hpp.
bool Arageli::interval< T >::on_limits | ( | const T1 & | x | ) | const [inline] |
Definition at line 151 of file interval.hpp.
interval& Arageli::interval< T >::operator *= | ( | const interval< T1 > & | x | ) | [inline] |
Definition at line 173 of file interval.hpp.
const interval& Arageli::interval< T >::operator+ | ( | ) | const [inline] |
Definition at line 186 of file interval.hpp.
interval Arageli::interval< T >::operator++ | ( | int | ) | [inline] |
Definition at line 183 of file interval.hpp.
interval& Arageli::interval< T >::operator++ | ( | ) | [inline] |
Definition at line 180 of file interval.hpp.
interval& Arageli::interval< T >::operator+= | ( | const interval< T1 > & | x | ) | [inline] |
Definition at line 165 of file interval.hpp.
interval Arageli::interval< T >::operator- | ( | ) | const [inline] |
Definition at line 187 of file interval.hpp.
interval Arageli::interval< T >::operator-- | ( | int | ) | [inline] |
Definition at line 184 of file interval.hpp.
interval& Arageli::interval< T >::operator-- | ( | ) | [inline] |
Definition at line 181 of file interval.hpp.
interval& Arageli::interval< T >::operator-= | ( | const interval< T1 > & | x | ) | [inline] |
Definition at line 169 of file interval.hpp.
interval& Arageli::interval< T >::operator/= | ( | const interval< T1 > & | x | ) | [inline] |
Definition at line 177 of file interval.hpp.
interval& Arageli::interval< T >::operator= | ( | const char * | s | ) | [inline] |
Definition at line 114 of file interval.hpp.
interval& Arageli::interval< T >::operator= | ( | const interval< T1 > & | x | ) | [inline] |
Definition at line 107 of file interval.hpp.
interval& Arageli::interval< T >::operator= | ( | const T1 & | x | ) | [inline] |
Definition at line 99 of file interval.hpp.
bool Arageli::interval< T >::outside | ( | const T1 & | x | ) | const [inline] |
True iff x is strictly outside of the interval/segment.
Definition at line 161 of file interval.hpp.
T& Arageli::interval< T >::right | ( | ) | [inline] |
Definition at line 129 of file interval.hpp.
const T& Arageli::interval< T >::right | ( | ) | const [inline] |
Definition at line 124 of file interval.hpp.
T& Arageli::interval< T >::second | ( | ) | [inline] |
Definition at line 128 of file interval.hpp.
const T& Arageli::interval< T >::second | ( | ) | const [inline] |
Definition at line 123 of file interval.hpp.
void Arageli::interval< T >::turn | ( | ) | [inline] |