APRONXX
0.9.12
|
Interval (ap_interval_t wrapper). More...
#include <apxx_interval.hh>
Inherits apron::use_malloc.
Public Types | |
enum | order { INCLUDED = -1, EQUAL = 0, CONTAINS = 1, LESS = -2, GREATER = 2 } |
Returned by ordering functions. More... | |
Public Member Functions | |
Constructors | |
interval () | |
Makes a new interval [0,0] with double bounds. More... | |
interval (const interval &x) | |
Makes a copy of an interval (bounds are copied). More... | |
interval (const scalar &inf, const scalar &sup) | |
Makes a new interval with the specified scalar bounds (copied). More... | |
interval (int inf, int sup) | |
Makes a new interval with the specified integer bounds, using MPQ scalars. More... | |
interval (long inf, long sup) | |
Makes a new interval with the specified integer bounds, using MPQ scalars. More... | |
interval (double inf, double sup) | |
Makes a new interval with the specified double bounds, using double scalars. More... | |
interval (const frac &inf, const frac &sup) | |
Makes a new interval with the specified fraction bounds, using MPQ scalars. More... | |
interval (const mpq_class &inf, const mpq_class &sup) | |
Makes a new interval with the specified MPQ bounds (copied), using MPQ scalars. More... | |
interval (mpfr_t inf, mpfr_t sup) | |
Makes a new interval with the specified MPFR bounds (copied), using MPFR scalars. More... | |
interval (top t) | |
Makes a new interval representing ]-oo,+oo[. More... | |
interval (bottom t) | |
Makes a new empty interval [+1;-1]. More... | |
Destructor | |
~interval () | |
Accesses | |
scalar & | get_inf () |
Gets a (modifiable) reference to the lower bound. More... | |
scalar & | get_sup () |
Gets a (modifiable) reference to the upper bound. More... | |
const scalar & | get_inf () const |
Gets a reference to the lower bound. More... | |
const scalar & | get_sup () const |
Gets a reference to the upper bound. More... | |
Operators | |
void | neg () |
Negates *this. More... | |
interval | operator- () const |
Returns a new interval which is the opposite of *this. More... | |
long | hash () const |
Returns a hash code. More... | |
C API compatibility | |
const ap_interval_t * | get_ap_interval_t () const |
Returns a pointer to the internal APRON object stored in *this. More... | |
ap_interval_t * | get_ap_interval_t () |
Returns a pointer to the internal APRON object stored in *this. More... | |
![]() | |
void * | operator new (size_t sz) |
void * | operator new[] (size_t sz) |
void | operator delete (void *p) |
void | operator delete[] (void *p) |
Protected Member Functions | |
void | init () |
Internal initialisation. More... | |
interval (ap_interval_t *i) | |
Internal use only. Take ownership of an object created by ap_interval_alloc. More... | |
Protected Attributes | |
ap_interval_t | c |
Structure managed by APRON. More... | |
Assignments | |
void | swap (interval &a, interval &b) |
Swaps the contents of two intervals. More... | |
interval & | operator= (const interval &x) |
Copies an interval into *this. More... | |
interval & | operator= (top t) |
Sets *this to top (]-oo;+oo[), no change in scalar types. More... | |
interval & | operator= (bottom t) |
Sets *this to empty ([+1;-1]), no change in scalar types. More... | |
interval & | set (const interval &x) |
Copies an interval into *this. More... | |
interval & | set (const scalar &inf, const scalar &sup) |
Sets *this to [inf;sup], copying both scalar bounds. More... | |
interval & | set (int inf, int sup) |
Sets *this to [inf;sup], using MPQ scalar bounds. More... | |
interval & | set (long inf, long sup) |
Sets *this to [inf;sup], using MPQ scalar bounds. More... | |
interval & | set (double inf, double sup) |
Sets *this to [inf;sup], using double scalar bounds. More... | |
interval & | set (const frac &inf, const frac &sup) |
Sets *this to [inf;sup], using MPQ scalar bounds. More... | |
interval & | set (const mpq_class &inf, const mpq_class &sup) |
Sets *this to [inf;sup], using MPQ scalar bounds (copied). More... | |
interval & | set (mpfr_t inf, mpfr_t sup) |
Sets *this to [inf;sup], using MPFR scalar bounds (copied). More... | |
interval & | set (top t) |
Sets *this to top (]-oo;+oo[). More... | |
interval & | set (bottom t) |
Sets *this to empty ([+1;-1]). More... | |
Printing | |
std::ostream & | operator<< (std::ostream &os, const interval &s) |
Printing. More... | |
void | print (FILE *stream=stdout) const |
Prints to a C stream. More... | |
Tests | |
bool | operator<= (const interval &a, const interval &b) |
Set inclusion. More... | |
bool | operator>= (const interval &a, const interval &b) |
Set inclusion. More... | |
bool | operator< (const interval &a, const interval &b) |
Strict set inclusion. More... | |
bool | operator> (const interval &a, const interval &b) |
Strict set inclusion. More... | |
bool | operator== (const interval &a, const interval &b) |
Set equality. More... | |
bool | operator!= (const interval &a, const interval &b) |
Set disequality. More... | |
order | cmp (const interval &a, const interval &b) |
Interval ordering. More... | |
bool | is_top () const |
Whether *this equals ]-oo;+oo[. More... | |
bool | is_bottom () const |
Whether *this represents an empty interval. More... | |
Interval (ap_interval_t wrapper).
An interval is represented using two scalar bounds (of double or MPQ type).
|
inlineprotected |
Internal use only. Take ownership of an object created by ap_interval_alloc.
|
inline |
Makes a new interval [0,0] with double bounds.
|
inline |
Makes a copy of an interval (bounds are copied).
Makes a new interval with the specified scalar bounds (copied).
|
inline |
Makes a new interval with the specified integer bounds, using MPQ scalars.
|
inline |
Makes a new interval with the specified integer bounds, using MPQ scalars.
|
inline |
Makes a new interval with the specified double bounds, using double scalars.
Makes a new interval with the specified fraction bounds, using MPQ scalars.
|
inline |
Makes a new interval with the specified MPQ bounds (copied), using MPQ scalars.
|
inline |
Makes a new interval with the specified MPFR bounds (copied), using MPFR scalars.
|
inline |
Makes a new interval representing ]-oo,+oo[.
|
inline |
Makes a new empty interval [+1;-1].
|
inline |
|
inline |
Returns a pointer to the internal APRON object stored in *this.
|
inline |
Returns a pointer to the internal APRON object stored in *this.
|
inline |
Gets a (modifiable) reference to the lower bound.
|
inline |
Gets a reference to the lower bound.
|
inline |
Gets a (modifiable) reference to the upper bound.
|
inline |
Gets a reference to the upper bound.
|
inline |
Returns a hash code.
|
inlineprotected |
Internal initialisation.
|
inline |
Whether *this represents an empty interval.
|
inline |
Whether *this equals ]-oo;+oo[.
|
inline |
Negates *this.
|
inline |
Returns a new interval which is the opposite of *this.
Sets *this to top (]-oo;+oo[), no change in scalar types.
Sets *this to empty ([+1;-1]), no change in scalar types.
|
inline |
Prints to a C stream.
Sets *this to [inf;sup], copying both scalar bounds.
|
inline |
Sets *this to [inf;sup], using MPQ scalar bounds.
|
inline |
Sets *this to [inf;sup], using MPQ scalar bounds.
|
inline |
Sets *this to [inf;sup], using double scalar bounds.
Sets *this to [inf;sup], using MPQ scalar bounds.
|
inline |
Sets *this to [inf;sup], using MPQ scalar bounds (copied).
|
inline |
Sets *this to [inf;sup], using MPFR scalar bounds (copied).
|
friend |
Printing.
|
protected |
Structure managed by APRON.