Arageli::interval< T > Class Template Reference

Represents an interval (open, close or semi-open; it depends on performed operations). More...

#include <interval.hpp>

List of all members.

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>
intervaloperator= (const T1 &x)
template<typename T1>
intervaloperator= (const interval< T1 > &x)
intervaloperator= (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>
intervaloperator+= (const interval< T1 > &x)
template<typename T1>
intervaloperator-= (const interval< T1 > &x)
template<typename T1>
intervaloperator *= (const interval< T1 > &x)
template<typename T1>
intervaloperator/= (const interval< T1 > &x)
intervaloperator++ ()
intervaloperator-- ()
interval operator++ (int)
interval operator-- (int)
const intervaloperator+ () const
interval operator- () const


Detailed Description

template<typename T>
class Arageli::interval< T >

Represents an interval (open, close or semi-open; it depends on performed operations).

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.


Member Typedef Documentation

template<typename T>
typedef binary_function_traits<function_tag::minus, T, T>::result_type Arageli::interval< T >::difference_type

Type of difference between two objects of value_type.

Definition at line 70 of file interval.hpp.

template<typename T>
typedef T Arageli::interval< T >::value_type

Type of the limits.

Definition at line 67 of file interval.hpp.


Constructor & Destructor Documentation

template<typename T>
Arageli::interval< T >::interval (  )  [inline]

Interval with left == right == 0.

Definition at line 73 of file interval.hpp.

template<typename T>
template<typename T1>
Arageli::interval< T >::interval ( const T1 &  x  )  [inline]

Interval with left == right == x.

Definition at line 77 of file interval.hpp.

template<typename T>
template<typename T1, typename T2>
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.

template<typename T>
template<typename T1>
Arageli::interval< T >::interval ( const interval< T1 > &  x  )  [inline]

Interval as a copy of another interval.

Definition at line 86 of file interval.hpp.

template<typename T>
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.


Member Function Documentation

template<typename T>
T& Arageli::interval< T >::first (  )  [inline]

Definition at line 126 of file interval.hpp.

template<typename T>
const T& Arageli::interval< T >::first (  )  const [inline]

Definition at line 121 of file interval.hpp.

template<typename T>
template<typename T1>
bool Arageli::interval< T >::inside ( const T1 &  x  )  const [inline]

True iff x is strictly inside of the interval/segment.

Definition at line 156 of file interval.hpp.

template<typename T>
bool Arageli::interval< T >::is_empty (  )  const [inline]

Return true iff left > rigth.

Definition at line 135 of file interval.hpp.

template<typename T>
bool Arageli::interval< T >::is_negligible (  )  const [inline]

Return true iff left >= right.

Definition at line 138 of file interval.hpp.

template<typename T>
bool Arageli::interval< T >::is_point (  )  const [inline]

Return true iff left == rigth.

Definition at line 132 of file interval.hpp.

template<typename T>
interval_kind Arageli::interval< T >::kind (  )  const [inline]

Definition at line 140 of file interval.hpp.

template<typename T>
T& Arageli::interval< T >::left (  )  [inline]

Definition at line 127 of file interval.hpp.

template<typename T>
const T& Arageli::interval< T >::left (  )  const [inline]

Definition at line 122 of file interval.hpp.

template<typename T>
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.

template<typename T>
template<typename T1>
bool Arageli::interval< T >::on_limits ( const T1 &  x  )  const [inline]

Definition at line 151 of file interval.hpp.

template<typename T>
template<typename T1>
interval& Arageli::interval< T >::operator *= ( const interval< T1 > &  x  )  [inline]

Definition at line 173 of file interval.hpp.

template<typename T>
const interval& Arageli::interval< T >::operator+ (  )  const [inline]

Definition at line 186 of file interval.hpp.

template<typename T>
interval Arageli::interval< T >::operator++ ( int   )  [inline]

Definition at line 183 of file interval.hpp.

template<typename T>
interval& Arageli::interval< T >::operator++ (  )  [inline]

Definition at line 180 of file interval.hpp.

template<typename T>
template<typename T1>
interval& Arageli::interval< T >::operator+= ( const interval< T1 > &  x  )  [inline]

Definition at line 165 of file interval.hpp.

template<typename T>
interval Arageli::interval< T >::operator- (  )  const [inline]

Definition at line 187 of file interval.hpp.

template<typename T>
interval Arageli::interval< T >::operator-- ( int   )  [inline]

Definition at line 184 of file interval.hpp.

template<typename T>
interval& Arageli::interval< T >::operator-- (  )  [inline]

Definition at line 181 of file interval.hpp.

template<typename T>
template<typename T1>
interval& Arageli::interval< T >::operator-= ( const interval< T1 > &  x  )  [inline]

Definition at line 169 of file interval.hpp.

template<typename T>
template<typename T1>
interval& Arageli::interval< T >::operator/= ( const interval< T1 > &  x  )  [inline]

Definition at line 177 of file interval.hpp.

template<typename T>
interval& Arageli::interval< T >::operator= ( const char *  s  )  [inline]

Definition at line 114 of file interval.hpp.

template<typename T>
template<typename T1>
interval& Arageli::interval< T >::operator= ( const interval< T1 > &  x  )  [inline]

Definition at line 107 of file interval.hpp.

template<typename T>
template<typename T1>
interval& Arageli::interval< T >::operator= ( const T1 &  x  )  [inline]

Definition at line 99 of file interval.hpp.

template<typename T>
template<typename T1>
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.

template<typename T>
T& Arageli::interval< T >::right (  )  [inline]

Definition at line 129 of file interval.hpp.

template<typename T>
const T& Arageli::interval< T >::right (  )  const [inline]

Definition at line 124 of file interval.hpp.

template<typename T>
T& Arageli::interval< T >::second (  )  [inline]

Definition at line 128 of file interval.hpp.

template<typename T>
const T& Arageli::interval< T >::second (  )  const [inline]

Definition at line 123 of file interval.hpp.

template<typename T>
void Arageli::interval< T >::turn (  )  [inline]

Swaps left and right.

Definition at line 148 of file interval.hpp.


The documentation for this class was generated from the following file:
Generated on Thu Aug 31 17:38:24 2006 for Arageli by  doxygen 1.4.7