Parma_Polyhedra_Library::Interval Class Reference
[C++ Language Interface]

A interval over the set of rational numbers. More...

#include <Interval.defs.hh>

Collaboration diagram for Parma_Polyhedra_Library::Interval:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Interval ()
 Constructs the universe interval $(-\infty, +\infty) = \Qset$.
bool is_empty () const
 Returns true if and only if *this is empty.
const LBoundarylower_bound () const
 Returns a const reference to the interval's lower bound.
LBoundarylower_bound ()
 Returns a reference to the interval's lower bound.
const UBoundaryupper_bound () const
 Returns a const reference to the interval's upper bound.
UBoundaryupper_bound ()
 Returns a reference to the interval's upper bound.
void raise_lower_bound (LBoundary new_lower)
 Raises the interval's lower bound, if new_lower is higher than the current one.
void lower_upper_bound (UBoundary new_upper)
 Lowers the interval's upper bound, if new_upper is lower than the current one.
void set_empty ()
 Turns *this into the empty interval.
bool OK () const
 Checks if all the invariants are satisfied.

Private Attributes

LBoundary lower
 The interval's lower bound.
UBoundary upper
 The interval's upper bound.


Detailed Description

A interval over the set of rational numbers.

An object of class Interval represents a closed/half-closed/open interval over the set of rational numbers $\Qset$.

Note that, even though the implementation is capable to represent any interval on the set of extended rational numbers, the available public methods only allows for the construction and manipulation of intervals over $\Qset$. Namely, it is not possible to create a non-empty interval having a closed bound whose value is $-\infty$ or $+\infty$.

Definition at line 156 of file Interval.defs.hh.


Constructor & Destructor Documentation

Parma_Polyhedra_Library::Interval::Interval (  )  [inline]

Constructs the universe interval $(-\infty, +\infty) = \Qset$.

Definition at line 76 of file Interval.inlines.hh.


Member Function Documentation

bool Parma_Polyhedra_Library::Interval::is_empty (  )  const [inline]

Returns true if and only if *this is empty.

Definition at line 82 of file Interval.inlines.hh.

References lower, and upper.

Referenced by interval_term(), and set_empty().

00082                          {
00083   return lower > upper;
00084 }

const LBoundary & Parma_Polyhedra_Library::Interval::lower_bound (  )  const [inline]

Returns a const reference to the interval's lower bound.

Definition at line 87 of file Interval.inlines.hh.

References lower.

Referenced by Parma_Polyhedra_Library::Bounding_Box::CC76_widening_assign(), and interval_term().

00087                             {
00088   return lower;
00089 }

LBoundary & Parma_Polyhedra_Library::Interval::lower_bound (  )  [inline]

Returns a reference to the interval's lower bound.

Definition at line 92 of file Interval.inlines.hh.

References lower.

00092                       {
00093   return lower;
00094 }

const UBoundary & Parma_Polyhedra_Library::Interval::upper_bound (  )  const [inline]

Returns a const reference to the interval's upper bound.

Definition at line 97 of file Interval.inlines.hh.

References upper.

Referenced by Parma_Polyhedra_Library::Bounding_Box::CC76_widening_assign(), and interval_term().

00097                             {
00098   return upper;
00099 }

UBoundary & Parma_Polyhedra_Library::Interval::upper_bound (  )  [inline]

Returns a reference to the interval's upper bound.

Definition at line 102 of file Interval.inlines.hh.

References upper.

00102                       {
00103   return upper;
00104 }

void Parma_Polyhedra_Library::Interval::raise_lower_bound ( LBoundary  new_lower  )  [inline]

Raises the interval's lower bound, if new_lower is higher than the current one.

Definition at line 107 of file Interval.inlines.hh.

References lower.

00107                                                {
00108   if (new_lower > lower)
00109     lower = new_lower;
00110 }

void Parma_Polyhedra_Library::Interval::lower_upper_bound ( UBoundary  new_upper  )  [inline]

Lowers the interval's upper bound, if new_upper is lower than the current one.

Definition at line 113 of file Interval.inlines.hh.

References upper.

00113                                                {
00114   if (new_upper < upper)
00115     upper = new_upper;
00116 }

void Parma_Polyhedra_Library::Interval::set_empty (  )  [inline]

bool Parma_Polyhedra_Library::Interval::OK (  )  const

Checks if all the invariants are satisfied.

Definition at line 53 of file Interval.cc.

References lower, Parma_Polyhedra_Library::UBoundary::OK(), Parma_Polyhedra_Library::LBoundary::OK(), and upper.

00053                       {
00054   return lower.OK() && upper.OK();
00055 }


Member Data Documentation

The interval's lower bound.

Definition at line 196 of file Interval.defs.hh.

Referenced by is_empty(), lower_bound(), OK(), raise_lower_bound(), and set_empty().

The interval's upper bound.

Definition at line 199 of file Interval.defs.hh.

Referenced by is_empty(), lower_upper_bound(), OK(), set_empty(), and upper_bound().


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

Generated on Wed Jul 16 22:55:50 2008 for PPL by  doxygen 1.5.6