APRONXX 0.9.15
apron::interval Class Reference

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.
 
 interval (const interval &x)
 Makes a copy of an interval (bounds are copied).
 
 interval (const scalar &inf, const scalar &sup)
 Makes a new interval with the specified scalar bounds (copied).
 
 interval (int inf, int sup)
 Makes a new interval with the specified integer bounds, using MPQ scalars.
 
 interval (long inf, long sup)
 Makes a new interval with the specified integer bounds, using MPQ scalars.
 
 interval (double inf, double sup)
 Makes a new interval with the specified double bounds, using double scalars.
 
 interval (const frac &inf, const frac &sup)
 Makes a new interval with the specified fraction bounds, using MPQ scalars.
 
 interval (const mpq_class &inf, const mpq_class &sup)
 Makes a new interval with the specified MPQ bounds (copied), using MPQ scalars.
 
 interval (mpfr_t inf, mpfr_t sup)
 Makes a new interval with the specified MPFR bounds (copied), using MPFR scalars.
 
 interval (top t)
 Makes a new interval representing ]-oo,+oo[.
 
 interval (bottom t)
 Makes a new empty interval [+1;-1].
 
Destructor
 ~interval ()
 
Accesses
scalarget_inf ()
 Gets a (modifiable) reference to the lower bound.
 
scalarget_sup ()
 Gets a (modifiable) reference to the upper bound.
 
const scalarget_inf () const
 Gets a reference to the lower bound.
 
const scalarget_sup () const
 Gets a reference to the upper bound.
 
Operators
void neg ()
 Negates *this.
 
interval operator- () const
 Returns a new interval which is the opposite of *this.
 
long hash () const
 Returns a hash code.
 
C API compatibility
const ap_interval_t * get_ap_interval_t () const
 Returns a pointer to the internal APRON object stored in *this.
 
ap_interval_t * get_ap_interval_t ()
 Returns a pointer to the internal APRON object stored in *this.
 
- Public Member Functions inherited from apron::use_malloc
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.
 
 interval (ap_interval_t *i)
 Internal use only. Take ownership of an object created by ap_interval_alloc.
 

Protected Attributes

ap_interval_t c
 Structure managed by APRON.
 

Assignments

intervaloperator= (const interval &x)
 Copies an interval into *this.
 
intervaloperator= (top t)
 Sets *this to top (]-oo;+oo[), no change in scalar types.
 
intervaloperator= (bottom t)
 Sets *this to empty ([+1;-1]), no change in scalar types.
 
intervalset (const interval &x)
 Copies an interval into *this.
 
intervalset (const scalar &inf, const scalar &sup)
 Sets *this to [inf;sup], copying both scalar bounds.
 
intervalset (int inf, int sup)
 Sets *this to [inf;sup], using MPQ scalar bounds.
 
intervalset (long inf, long sup)
 Sets *this to [inf;sup], using MPQ scalar bounds.
 
intervalset (double inf, double sup)
 Sets *this to [inf;sup], using double scalar bounds.
 
intervalset (const frac &inf, const frac &sup)
 Sets *this to [inf;sup], using MPQ scalar bounds.
 
intervalset (const mpq_class &inf, const mpq_class &sup)
 Sets *this to [inf;sup], using MPQ scalar bounds (copied).
 
intervalset (mpfr_t inf, mpfr_t sup)
 Sets *this to [inf;sup], using MPFR scalar bounds (copied).
 
intervalset (top t)
 Sets *this to top (]-oo;+oo[).
 
intervalset (bottom t)
 Sets *this to empty ([+1;-1]).
 

Printing

void print (FILE *stream=stdout) const
 Prints to a C stream.
 

Tests

bool is_top () const
 Whether *this equals ]-oo;+oo[.
 
bool is_bottom () const
 Whether *this represents an empty interval.
 

Detailed Description

Interval (ap_interval_t wrapper).

An interval is represented using two scalar bounds (of double or MPQ type).

Member Enumeration Documentation

◆ order

Returned by ordering functions.

Enumerator
INCLUDED 

Means i1 is included in i2.

EQUAL 

Means i1 equals i2.

CONTAINS 

Means i2 is included in i1.

LESS 

Means min i1 <= min i2.

GREATER 

Means min i1 >= min i2.

Constructor & Destructor Documentation

◆ interval() [1/12]

interval::interval ( ap_interval_t * i)
inlineprotected

Internal use only. Take ownership of an object created by ap_interval_alloc.

◆ interval() [2/12]

interval::interval ( )
inline

Makes a new interval [0,0] with double bounds.

◆ interval() [3/12]

interval::interval ( const interval & x)
inline

Makes a copy of an interval (bounds are copied).

◆ interval() [4/12]

interval::interval ( const scalar & inf,
const scalar & sup )
inline

Makes a new interval with the specified scalar bounds (copied).

◆ interval() [5/12]

interval::interval ( int inf,
int sup )
inline

Makes a new interval with the specified integer bounds, using MPQ scalars.

◆ interval() [6/12]

interval::interval ( long inf,
long sup )
inline

Makes a new interval with the specified integer bounds, using MPQ scalars.

◆ interval() [7/12]

interval::interval ( double inf,
double sup )
inline

Makes a new interval with the specified double bounds, using double scalars.

◆ interval() [8/12]

interval::interval ( const frac & inf,
const frac & sup )
inline

Makes a new interval with the specified fraction bounds, using MPQ scalars.

◆ interval() [9/12]

interval::interval ( const mpq_class & inf,
const mpq_class & sup )
inline

Makes a new interval with the specified MPQ bounds (copied), using MPQ scalars.

◆ interval() [10/12]

interval::interval ( mpfr_t inf,
mpfr_t sup )
inline

Makes a new interval with the specified MPFR bounds (copied), using MPFR scalars.

◆ interval() [11/12]

interval::interval ( top t)
inline

Makes a new interval representing ]-oo,+oo[.

◆ interval() [12/12]

interval::interval ( bottom t)
inline

Makes a new empty interval [+1;-1].

◆ ~interval()

interval::~interval ( )
inline

Member Function Documentation

◆ get_ap_interval_t() [1/2]

ap_interval_t * interval::get_ap_interval_t ( )
inline

Returns a pointer to the internal APRON object stored in *this.

◆ get_ap_interval_t() [2/2]

const ap_interval_t * interval::get_ap_interval_t ( ) const
inline

Returns a pointer to the internal APRON object stored in *this.

◆ get_inf() [1/2]

scalar & interval::get_inf ( )
inline

Gets a (modifiable) reference to the lower bound.

◆ get_inf() [2/2]

const scalar & interval::get_inf ( ) const
inline

Gets a reference to the lower bound.

◆ get_sup() [1/2]

scalar & interval::get_sup ( )
inline

Gets a (modifiable) reference to the upper bound.

◆ get_sup() [2/2]

const scalar & interval::get_sup ( ) const
inline

Gets a reference to the upper bound.

◆ hash()

long interval::hash ( ) const
inline

Returns a hash code.

◆ init()

void interval::init ( )
inlineprotected

Internal initialisation.

◆ is_bottom()

bool interval::is_bottom ( ) const
inline

Whether *this represents an empty interval.

◆ is_top()

bool interval::is_top ( ) const
inline

Whether *this equals ]-oo;+oo[.

◆ neg()

void interval::neg ( )
inline

Negates *this.

◆ operator-()

interval interval::operator- ( ) const
inline

Returns a new interval which is the opposite of *this.

◆ operator=() [1/3]

interval & interval::operator= ( bottom t)
inline

Sets *this to empty ([+1;-1]), no change in scalar types.

◆ operator=() [2/3]

interval & interval::operator= ( const interval & x)
inline

Copies an interval into *this.

◆ operator=() [3/3]

interval & interval::operator= ( top t)
inline

Sets *this to top (]-oo;+oo[), no change in scalar types.

◆ print()

void interval::print ( FILE * stream = stdout) const
inline

Prints to a C stream.

◆ set() [1/10]

interval & interval::set ( bottom t)
inline

Sets *this to empty ([+1;-1]).

Returns
*this.

◆ set() [2/10]

interval & interval::set ( const frac & inf,
const frac & sup )
inline

Sets *this to [inf;sup], using MPQ scalar bounds.

Returns
*this.

◆ set() [3/10]

interval & interval::set ( const interval & x)
inline

Copies an interval into *this.

Returns
*this.

◆ set() [4/10]

interval & interval::set ( const mpq_class & inf,
const mpq_class & sup )
inline

Sets *this to [inf;sup], using MPQ scalar bounds (copied).

Returns
*this.

◆ set() [5/10]

interval & interval::set ( const scalar & inf,
const scalar & sup )
inline

Sets *this to [inf;sup], copying both scalar bounds.

Returns
*this.

◆ set() [6/10]

interval & interval::set ( double inf,
double sup )
inline

Sets *this to [inf;sup], using double scalar bounds.

Returns
*this.

◆ set() [7/10]

interval & interval::set ( int inf,
int sup )
inline

Sets *this to [inf;sup], using MPQ scalar bounds.

Returns
*this.

◆ set() [8/10]

interval & interval::set ( long inf,
long sup )
inline

Sets *this to [inf;sup], using MPQ scalar bounds.

Returns
*this.

◆ set() [9/10]

interval & interval::set ( mpfr_t inf,
mpfr_t sup )
inline

Sets *this to [inf;sup], using MPFR scalar bounds (copied).

Returns
*this.

◆ set() [10/10]

interval & interval::set ( top t)
inline

Sets *this to top (]-oo;+oo[).

Returns
*this.

Member Data Documentation

◆ c

ap_interval_t apron::interval::c
protected

Structure managed by APRON.


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