boost::itl::interval< DomainT, Compare > Class Template Reference

A class template for intervals. More...

List of all members.

Public Types

typedef DomainT codomain_type
 The codomaintype is the same as domain_type.
typedef itl::difference
< DomainT >::type 
difference_type
 The difference type of an interval which is sometimes different form the domain_type.
typedef DomainT domain_type
 The domain type of the interval.
typedef DomainT element_type
 The element type of the interval.
typedef type interval_type
 The interval type is the interval's type.
typedef type segment_type
 The segment type is the interval's type.
typedef itl::size< DomainT >::type size_type
 The size type of an interval which is mostly std::size_t.

Public Member Functions

intervalas (bound_type bounded)
const std::string as_string () const
bound_type boundtype () const
size_type cardinality () const
void clear ()
bool contained_in (const interval &super) const
bool contains (const interval &sub) const
bool contains (const DomainT &x) const
bool distant_less (const interval &x2) const
bool empty () const
bool exclusive_less (const interval &x2) const
intervalextend (const interval &x2)
DomainT first () const
bool free_contains (const interval &sub) const
bool intersects (const interval &x2) const
 interval (const DomainT &low, const DomainT &up, itl::bound_type bounds=itl::closed_bounded)
 interval (const DomainT &val)
 interval ()
bool is (bound_type bounded) const
bool is_disjoint (const interval &x2) const
bool is_left (bound_type bounded) const
bool is_right (bound_type bounded) const
typedef ITL_COMPARE_DOMAIN (Compare, DomainT) domain_compare
 Compare order on the data.
DomainT last () const
intervalleft_extend (const interval &left_extension)
intervalleft_set (const interval &left)
intervalleft_subtract (const interval &left_minuend)
difference_type length () const
DomainT lower () const
bool lower_equal (const interval &x2) const
bool lower_less (const interval &x2) const
bool lower_less_equal (const interval &x2) const
intervaloperator&= (const interval &sectant)
bool proper_contains (const interval &sub) const
intervalright_extend (const interval &right_extension)
intervalright_set (const interval &right)
intervalright_subtract (const interval &right_minuend)
intervalset (const DomainT &low, const DomainT &up, bound_type bounds)
size_type size () const
interval span (const interval &rhs) const
bool touches (const interval &x2) const
DomainT upper () const
bool upper_equal (const interval &x2) const
bool upper_less (const interval &x2) const
bool upper_less_equal (const interval &x2) const

Static Public Member Functions

static interval closed (const DomainT &low, const DomainT &up)
static bool domain_equal (DomainP left, DomainP right)
static bool domain_less (DomainP left, DomainP right)
static bool domain_less_equal (DomainP left, DomainP right)
static interval leftopen (const DomainT &low, const DomainT &up)
static interval open (const DomainT &low, const DomainT &up)
static interval rightopen (const DomainT &low, const DomainT &up)
static interval whole ()


Detailed Description

template<class DomainT, ITL_COMPARE Compare = ITL_COMPARE_INSTANCE(std::less, DomainT)>
class boost::itl::interval< DomainT, Compare >

A class template for intervals.

Member Typedef Documentation

template<class DomainT , ITL_COMPARE Compare = ITL_COMPARE_INSTANCE(std::less, DomainT)>
typedef DomainT boost::itl::interval< DomainT, Compare >::domain_type

The domain type of the interval.

template<class DomainT , ITL_COMPARE Compare = ITL_COMPARE_INSTANCE(std::less, DomainT)>
typedef DomainT boost::itl::interval< DomainT, Compare >::codomain_type

The codomaintype is the same as domain_type.

template<class DomainT , ITL_COMPARE Compare = ITL_COMPARE_INSTANCE(std::less, DomainT)>
typedef DomainT boost::itl::interval< DomainT, Compare >::element_type

The element type of the interval.

template<class DomainT , ITL_COMPARE Compare = ITL_COMPARE_INSTANCE(std::less, DomainT)>
typedef type boost::itl::interval< DomainT, Compare >::segment_type

The segment type is the interval's type.

template<class DomainT , ITL_COMPARE Compare = ITL_COMPARE_INSTANCE(std::less, DomainT)>
typedef type boost::itl::interval< DomainT, Compare >::interval_type

The interval type is the interval's type.

template<class DomainT , ITL_COMPARE Compare = ITL_COMPARE_INSTANCE(std::less, DomainT)>
typedef itl::difference<DomainT>::type boost::itl::interval< DomainT, Compare >::difference_type

The difference type of an interval which is sometimes different form the domain_type.

template<class DomainT , ITL_COMPARE Compare = ITL_COMPARE_INSTANCE(std::less, DomainT)>
typedef itl::size<DomainT>::type boost::itl::interval< DomainT, Compare >::size_type

The size type of an interval which is mostly std::size_t.


Constructor & Destructor Documentation

template<class DomainT , ITL_COMPARE Compare = ITL_COMPARE_INSTANCE(std::less, DomainT)>
boost::itl::interval< DomainT, Compare >::interval (  )  [inline]

Default constructor; yields an empty interval [1,0]

template<class DomainT , ITL_COMPARE Compare = ITL_COMPARE_INSTANCE(std::less, DomainT)>
boost::itl::interval< DomainT, Compare >::interval ( const DomainT &  val  )  [inline, explicit]

Constructor for a closed singleton interval [val,val]

template<class DomainT , ITL_COMPARE Compare = ITL_COMPARE_INSTANCE(std::less, DomainT)>
boost::itl::interval< DomainT, Compare >::interval ( const DomainT &  low,
const DomainT &  up,
itl::bound_type  bounds = itl::closed_bounded 
) [inline]

Interval from low to up with bounds bounds


Member Function Documentation

template<class DomainT , ITL_COMPARE Compare = ITL_COMPARE_INSTANCE(std::less, DomainT)>
typedef boost::itl::interval< DomainT, Compare >::ITL_COMPARE_DOMAIN ( Compare  ,
DomainT   
)

Compare order on the data.

template<class DomainT , ITL_COMPARE Compare = ITL_COMPARE_INSTANCE(std::less, DomainT)>
static interval boost::itl::interval< DomainT, Compare >::closed ( const DomainT &  low,
const DomainT &  up 
) [inline, static]

Closed interval [low,up]

template<class DomainT , ITL_COMPARE Compare = ITL_COMPARE_INSTANCE(std::less, DomainT)>
static interval boost::itl::interval< DomainT, Compare >::rightopen ( const DomainT &  low,
const DomainT &  up 
) [inline, static]

Rightopen interval [low,up)

template<class DomainT , ITL_COMPARE Compare = ITL_COMPARE_INSTANCE(std::less, DomainT)>
static interval boost::itl::interval< DomainT, Compare >::leftopen ( const DomainT &  low,
const DomainT &  up 
) [inline, static]

Leftopen interval (low,up]

template<class DomainT , ITL_COMPARE Compare = ITL_COMPARE_INSTANCE(std::less, DomainT)>
static interval boost::itl::interval< DomainT, Compare >::open ( const DomainT &  low,
const DomainT &  up 
) [inline, static]

Open interval (low,up)

template<class DomainT , ITL_COMPARE Compare>
bool boost::itl::interval< DomainT, Compare >::empty (  )  const [inline]

Is the interval empty?

template<class DomainT , ITL_COMPARE Compare = ITL_COMPARE_INSTANCE(std::less, DomainT)>
void boost::itl::interval< DomainT, Compare >::clear (  )  [inline]

Set the interval empty

template<class DomainT , ITL_COMPARE Compare>
bool boost::itl::interval< DomainT, Compare >::contains ( const DomainT &  x  )  const [inline]

Does the interval contain x?

template<class DomainT , ITL_COMPARE Compare>
bool boost::itl::interval< DomainT, Compare >::contains ( const interval< DomainT, Compare > &  sub  )  const [inline]

*this is superset of sub

template<class DomainT , ITL_COMPARE Compare>
bool boost::itl::interval< DomainT, Compare >::contained_in ( const interval< DomainT, Compare > &  super  )  const [inline]

*this is subset of super

template<class DomainT , ITL_COMPARE Compare>
bool boost::itl::interval< DomainT, Compare >::free_contains ( const interval< DomainT, Compare > &  sub  )  const [inline]

sub is proper subset of *this and does not touch the borders of *this

template<class DomainT , ITL_COMPARE Compare>
bool boost::itl::interval< DomainT, Compare >::proper_contains ( const interval< DomainT, Compare > &  sub  )  const [inline]

sub is proper subset of *this

template<class DomainT , ITL_COMPARE Compare = ITL_COMPARE_INSTANCE(std::less, DomainT)>
bool boost::itl::interval< DomainT, Compare >::is_disjoint ( const interval< DomainT, Compare > &  x2  )  const [inline]

*this and x2 are disjoint; their intersection is empty

template<class DomainT , ITL_COMPARE Compare = ITL_COMPARE_INSTANCE(std::less, DomainT)>
bool boost::itl::interval< DomainT, Compare >::intersects ( const interval< DomainT, Compare > &  x2  )  const [inline]

*this and x2 have a non empty intersection

template<class DomainT , ITL_COMPARE Compare>
itl::size< DomainT >::type boost::itl::interval< DomainT, Compare >::cardinality (  )  const [inline]

Cardinality of the interval: The number of elements

template<class DomainT , ITL_COMPARE Compare>
interval< DomainT, Compare >::difference_type boost::itl::interval< DomainT, Compare >::length (  )  const [inline]

Arithmetic size of the interval

template<class DomainT , ITL_COMPARE Compare = ITL_COMPARE_INSTANCE(std::less, DomainT)>
size_type boost::itl::interval< DomainT, Compare >::size (  )  const [inline]

Size of the interval

template<class DomainT , ITL_COMPARE Compare = ITL_COMPARE_INSTANCE(std::less, DomainT)>
DomainT boost::itl::interval< DomainT, Compare >::lower (  )  const [inline]

Lower bound of the interval

template<class DomainT , ITL_COMPARE Compare = ITL_COMPARE_INSTANCE(std::less, DomainT)>
DomainT boost::itl::interval< DomainT, Compare >::upper (  )  const [inline]

Upper bound of the interval

template<class DomainT , ITL_COMPARE Compare>
DomainT boost::itl::interval< DomainT, Compare >::first (  )  const [inline]

First (smallest) element of the interval

template<class DomainT , ITL_COMPARE Compare>
DomainT boost::itl::interval< DomainT, Compare >::last (  )  const [inline]

Last (largest) element of the interval

template<class DomainT , ITL_COMPARE Compare = ITL_COMPARE_INSTANCE(std::less, DomainT)>
bound_type boost::itl::interval< DomainT, Compare >::boundtype (  )  const [inline]

Typ of interval bounds

template<class DomainT , ITL_COMPARE Compare>
interval< DomainT, Compare > & boost::itl::interval< DomainT, Compare >::extend ( const interval< DomainT, Compare > &  x2  )  [inline]

Extend *this to x2 yielding an interval from the minimum of lower bounds to the maximum of upper bounds

template<class DomainT , ITL_COMPARE Compare>
interval< DomainT, Compare > & boost::itl::interval< DomainT, Compare >::left_extend ( const interval< DomainT, Compare > &  left_extension  )  [inline]

Extend *this interval to the minimum of the lower bounds of this and left_extension.

template<class DomainT , ITL_COMPARE Compare>
interval< DomainT, Compare > & boost::itl::interval< DomainT, Compare >::right_extend ( const interval< DomainT, Compare > &  right_extension  )  [inline]

Extend *this interval to the maximum of the upper bounds of this and right_extension.

template<class DomainT , ITL_COMPARE Compare>
interval< DomainT, Compare > & boost::itl::interval< DomainT, Compare >::left_set ( const interval< DomainT, Compare > &  left  )  [inline]

Set the lower bound and bound type according to interval left.

template<class DomainT , ITL_COMPARE Compare>
interval< DomainT, Compare > & boost::itl::interval< DomainT, Compare >::right_set ( const interval< DomainT, Compare > &  right  )  [inline]

Set the upper bound and bound type according to interval right.

template<class DomainT , ITL_COMPARE Compare = ITL_COMPARE_INSTANCE(std::less, DomainT)>
interval boost::itl::interval< DomainT, Compare >::span ( const interval< DomainT, Compare > &  rhs  )  const [inline]

Interval spanning from lower bound of *this interval to the upper bound of rhs. Bordertypes according to the lower bound of *this and the upper bound of rhs.

template<class DomainT , ITL_COMPARE Compare>
interval< DomainT, Compare > & boost::itl::interval< DomainT, Compare >::left_subtract ( const interval< DomainT, Compare > &  left_minuend  )  [inline]

subtract left_minuend from *this interval on it's left side.

*this = *this - left_minuend; //on the left.
...      d) : *this
... c)      : left_minuend
     [c  d) : *this

template<class DomainT , ITL_COMPARE Compare>
interval< DomainT, Compare > & boost::itl::interval< DomainT, Compare >::right_subtract ( const interval< DomainT, Compare > &  right_minuend  )  [inline]

subtract right_minuend from *this interval on it's right side.

*this = *this - right_minuend; //on the right side.
[a      ...  : *this
     [b ...  : right_minuend
[a  b)       : *this

template<class DomainT , ITL_COMPARE Compare = ITL_COMPARE_INSTANCE(std::less, DomainT)>
interval& boost::itl::interval< DomainT, Compare >::operator&= ( const interval< DomainT, Compare > &  sectant  )  [inline]

Intersection with the interval x2; assign result to isec

template<class DomainT , ITL_COMPARE Compare>
const std::string boost::itl::interval< DomainT, Compare >::as_string (  )  const [inline]

Object as string

template<class DomainT , ITL_COMPARE Compare = ITL_COMPARE_INSTANCE(std::less, DomainT)>
bool boost::itl::interval< DomainT, Compare >::is ( bound_type  bounded  )  const [inline]

What type is the interval?

interval.is(closed_bounded); //[x, y] a closed interval
interval.is(right_open);     //[x, y) a right-open interval (also left-closed interval)
interval.is(left_open);      //(x, y] a left-open interval  (also right-closed interval)
interval.is(open_bounded);   //(x, y) an open interval

template<class DomainT , ITL_COMPARE Compare = ITL_COMPARE_INSTANCE(std::less, DomainT)>
bool boost::itl::interval< DomainT, Compare >::is_left ( bound_type  bounded  )  const [inline]

What bound type is the left interval border?

interval.is_left(closed_bounded); //[x, y] or [x, y)
interval.is_left(open_bounded);   //(x, y] or (x, y)

template<class DomainT , ITL_COMPARE Compare = ITL_COMPARE_INSTANCE(std::less, DomainT)>
bool boost::itl::interval< DomainT, Compare >::is_right ( bound_type  bounded  )  const [inline]

What bound type is the right interval border?

interval.is_right(closed_bounded); //[x, y] or (x, y]
interval.is_right(open_bounded);   //[x, y) or (x, y)

template<class DomainT , ITL_COMPARE Compare>
bool boost::itl::interval< DomainT, Compare >::touches ( const interval< DomainT, Compare > &  x2  )  const [inline]

There is no gap between *this and x2 but they have no element in common

template<class DomainT , ITL_COMPARE Compare>
bool boost::itl::interval< DomainT, Compare >::exclusive_less ( const interval< DomainT, Compare > &  x2  )  const [inline]

Maximal element of *this is less than the minimal element of x2

template<class DomainT , ITL_COMPARE Compare>
bool boost::itl::interval< DomainT, Compare >::distant_less ( const interval< DomainT, Compare > &  x2  )  const [inline]

Maximal element of *this is less than the minimal element of x2 and there is at least one element in between.

template<class DomainT , ITL_COMPARE Compare = ITL_COMPARE_INSTANCE(std::less, DomainT)>
interval& boost::itl::interval< DomainT, Compare >::set ( const DomainT &  low,
const DomainT &  up,
bound_type  bounds 
) [inline]

Set *this interval to from low to up with boundtype bounds

template<class DomainT , ITL_COMPARE Compare>
interval< DomainT, Compare > & boost::itl::interval< DomainT, Compare >::as ( bound_type  bounded  )  [inline]

Transforms the interval to the bound-type bounded without changing it's content. Requires Integral<domain_type>.

interval.as(closed_bounded).is(closed_bounded) &&
interval.as(right_open).is(right_open) &&
interval.as(left_open).is(left_open) &&
interval.as(open_bounded).is(open_bounded)

template<class DomainT , ITL_COMPARE Compare = ITL_COMPARE_INSTANCE(std::less, DomainT)>
static interval boost::itl::interval< DomainT, Compare >::whole (  )  [inline, static]

An interval that covers the complete range of it's domain_type

template<class DomainT , ITL_COMPARE Compare>
bool boost::itl::interval< DomainT, Compare >::lower_less ( const interval< DomainT, Compare > &  x2  )  const [inline]

First element of *this is less than first element of x2

template<class DomainT , ITL_COMPARE Compare>
bool boost::itl::interval< DomainT, Compare >::upper_less ( const interval< DomainT, Compare > &  x2  )  const [inline]

Last element of *this is less than last element of x2

template<class DomainT , ITL_COMPARE Compare>
bool boost::itl::interval< DomainT, Compare >::lower_less_equal ( const interval< DomainT, Compare > &  x2  )  const [inline]

First element of *this is less than or equal to the first element of x2

template<class DomainT , ITL_COMPARE Compare>
bool boost::itl::interval< DomainT, Compare >::upper_less_equal ( const interval< DomainT, Compare > &  x2  )  const [inline]

Last element of *this is less than or equal to the last element of x2

template<class DomainT , ITL_COMPARE Compare>
bool boost::itl::interval< DomainT, Compare >::lower_equal ( const interval< DomainT, Compare > &  x2  )  const [inline]

First element of *this is equal to the first element of x2

template<class DomainT , ITL_COMPARE Compare>
bool boost::itl::interval< DomainT, Compare >::upper_equal ( const interval< DomainT, Compare > &  x2  )  const [inline]

Last element of *this is equal to the last element of x2

template<class DomainT , ITL_COMPARE Compare = ITL_COMPARE_INSTANCE(std::less, DomainT)>
static bool boost::itl::interval< DomainT, Compare >::domain_less ( DomainP  left,
DomainP  right 
) [inline, static]

Less compare of interval elements.

template<class DomainT , ITL_COMPARE Compare = ITL_COMPARE_INSTANCE(std::less, DomainT)>
static bool boost::itl::interval< DomainT, Compare >::domain_less_equal ( DomainP  left,
DomainP  right 
) [inline, static]

Less or equal compare of interval elements.

template<class DomainT , ITL_COMPARE Compare = ITL_COMPARE_INSTANCE(std::less, DomainT)>
static bool boost::itl::interval< DomainT, Compare >::domain_equal ( DomainP  left,
DomainP  right 
) [inline, static]

Equality compare of interval elements.


The documentation for this class was generated from the following file:

Generated on Wed Jan 13 18:35:04 2010 for Interval Template Library by  doxygen 1.5.7.1