#include <Interval.defs.hh>
Public Member Functions | |
Interval () | |
Constructs the universe interval ![]() | |
bool | is_empty () const |
Returns true if and only if *this is empty. | |
const LBoundary & | lower_bound () const |
Returns a const reference to the interval's lower bound. | |
LBoundary & | lower_bound () |
Returns a reference to the interval's lower bound. | |
const UBoundary & | upper_bound () const |
Returns a const reference to the interval's upper bound. | |
UBoundary & | upper_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. |
An object of class Interval represents a closed/half-closed/open interval over the set of rational numbers .
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 . Namely, it is not possible to create a non-empty interval having a closed bound whose value is
or
.
Definition at line 156 of file Interval.defs.hh.
Parma_Polyhedra_Library::Interval::Interval | ( | ) | [inline] |
Constructs the universe interval .
Definition at line 76 of file Interval.inlines.hh.
00077 : lower(ERational(MINUS_INFINITY), LBoundary::OPEN), 00078 upper(ERational(PLUS_INFINITY), UBoundary::OPEN) { 00079 }
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.
Referenced by interval_term(), and set_empty().
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.
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.
void Parma_Polyhedra_Library::Interval::set_empty | ( | ) | [inline] |
Turns *this
into the empty interval.
Definition at line 119 of file Interval.inlines.hh.
References is_empty(), lower, Parma_Polyhedra_Library::MINUS_INFINITY, Parma_Polyhedra_Library::UBoundary::OPEN, Parma_Polyhedra_Library::LBoundary::OPEN, Parma_Polyhedra_Library::PLUS_INFINITY, and upper.
00119 { 00120 lower = LBoundary(ERational(PLUS_INFINITY), LBoundary::OPEN); 00121 upper = UBoundary(ERational(MINUS_INFINITY), UBoundary::OPEN); 00122 assert(is_empty()); 00123 }
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.
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().