APRONXX  0.9.12
Protected Attributes | List of all members
apron::coeff Class Reference

Coefficient (ap_coeff_t wrapper). More...

#include <apxx_coeff.hh>

Inherits apron::use_malloc.

Public Member Functions

Constructors
 coeff ()
 Makes a double scalar coeff equal to 0.0. More...
 
 coeff (const coeff &x)
 Makes a copy of a coeff. More...
 
 coeff (const scalar &x)
 Makes a scalar coeff from a scalar (copied). More...
 
 coeff (int x)
 Makes a MPQ scalar coeff from a native integer. More...
 
 coeff (long x)
 Makes a MPQ scalar coeff from a native integer. More...
 
 coeff (double x)
 Makes a double scalar coeff from a double. More...
 
 coeff (const frac &x)
 Makes a MPQ scalar coeff from a fraction with native integer coefficients. More...
 
 coeff (const mpq_class &x)
 Makes a MPQ scalar coeff from a MPQ (copied). More...
 
 coeff (mpfr_t x)
 Makes a MPFR scalar coeff from a MPFR (copied). More...
 
 coeff (const interval &x)
 Makes an interval coeff from an interval (copied). More...
 
 coeff (const scalar &inf, const scalar &sup)
 Makes an interval coeff from two scalar bounds (copied). More...
 
 coeff (int inf, int sup)
 Makes an interval coeff with MPQ bounds from native integer bounds. More...
 
 coeff (long inf, long sup)
 Makes an interval coeff with MPQ bounds from native integer bounds. More...
 
 coeff (double inf, double sup)
 Makes an interval coeff with double bounds from double bounds. More...
 
 coeff (const frac &inf, const frac &sup)
 Makes an interval coeff with MPQ bounds from fractions with native integer coefficients. More...
 
 coeff (const mpq_class &inf, const mpq_class &sup)
 Makes an interval coeff with MPQ bounds from MPQ bounds (copied). More...
 
 coeff (mpfr_t inf, mpfr_t sup)
 Makes an interval coeff with MPFR bounds from MPFR bounds (copied). More...
 
 coeff (top t)
 Makes an interval coeff representing ]-oo,+oo[. More...
 
 coeff (bottom t)
 Makes an empty interval coeff [+1;-1]. More...
 
Destructor
 ~coeff ()
 
Accesses
ap_coeff_discr_t get_discr () const
 Whether the coeff is a scalar or an interval. More...
 
scalarget_scalar ()
 Returns a (modifiable) reference to the scalar contained in the coeff. More...
 
const scalarget_scalar () const
 Returns a reference to the scalar contained in the coeff. More...
 
intervalget_interval ()
 Returns a (modifiable) reference to the interval contained in the coeff. More...
 
const intervalget_interval () const
 Returns a reference to the interval contained in the coeff. More...
 
Operators
void reduce ()
 Converts a singleton intervals to scalar. More...
 
void neg ()
 Negates *this. More...
 
coeff operator- () const
 Returns the opposite of *this. More...
 
long hash () const
 Returns a hash code. More...
 
C API compatibility
const ap_coeff_t * get_ap_coeff_t () const
 Returns a pointer to the internal APRON object stored in *this. More...
 
ap_coeff_t * get_ap_coeff_t ()
 Returns a pointer to the internal APRON object stored in *this. More...
 
- 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 Attributes

ap_coeff_t c
 Structure managed by APRON. More...
 

Assignments

coeffoperator= (const coeff &x)
 Copies the coeff into *this (setting its type and value). More...
 
coeffoperator= (const scalar &x)
 Copies the scalar into *this, setting its type to scalar coeff. More...
 
coeffoperator= (int x)
 Assigns a native integer to *this, setting its type to MPQ scalar coeff. More...
 
coeffoperator= (long x)
 Assigns a native integer to *this, setting its type to MPQ scalar coeff. More...
 
coeffoperator= (double x)
 Assigns a double to *this, setting its type to double scalar coeff. More...
 
coeffoperator= (const frac &x)
 Assigns a native integer fraction to *this, setting its type to MPQ scalar coeff. More...
 
coeffoperator= (const mpq_class &x)
 Assigns a MPQ to *this, setting its type to MPQ scalar coeff and copying the MPQ. More...
 
coeffoperator= (mpfr_t x)
 Assigns a MPFR to *this, setting its type to MPFR scalar coeff and copying the MPFR. More...
 
coeffoperator= (const interval &x)
 Copies the interval into *this, setting its type to interval coeff. More...
 
coeffoperator= (top t)
 Set *this to the top interval (]-oo;+oo[), setting its type to interval coeff. More...
 
coeffoperator= (bottom t)
 Set *this to the empty interval ([+1;-1])., setting its type to interval coeff. More...
 
coeffset (const coeff &x)
 Copies the coeff into *this (setting its type and value). More...
 
coeffset (const scalar &x)
 Copies the scalar into *this, setting its type to scalar coeff. More...
 
coeffset (int x)
 Assigns a native integer to *this, setting its type to MPQ scalar coeff. More...
 
coeffset (long x)
 Assigns a native integer to *this, setting its type to MPQ scalar coeff. More...
 
coeffset (double x)
 Assigns a double to *this, setting its type to double scalar coeff. More...
 
coeffset (const frac &x)
 Assigns a native integer fraction to *this, setting its type to MPQ scalar coeff. More...
 
coeffset (const mpq_class &x)
 Assigns a MPQ to *this, setting its type to MPQ scalar coeff and copying the MPQ. More...
 
coeffset (mpfr_t x)
 Assigns a MPFR to *this, setting its type to MPFR scalar coeff and copying the MPFR. More...
 
coeffset (const interval &x)
 Copies the interval into *this, setting its type to interval coeff. More...
 
coeffset (const scalar &inf, const scalar &sup)
 Sets *this to an interval coeff with the given scalar bounds (copied). More...
 
coeffset (int inf, int sup)
 Sets *this to an interval coeff with MPQ scalar bounds. More...
 
coeffset (long inf, long sup)
 Sets *this to an interval coeff with MPQ scalar bounds. More...
 
coeffset (double inf, double sup)
 Sets *this to an interval coeff with double scalar bounds. More...
 
coeffset (const frac &inf, const frac &sup)
 Sets *this to an interval coeff with MPQ scalar bounds. More...
 
coeffset (const mpq_class &inf, const mpq_class &sup)
 Sets *this to an interval coeff with MPQ scalar bounds (copied). More...
 
coeffset (mpfr_t inf, mpfr_t sup)
 Sets *this to an interval coeff with MPFR scalar bounds (copied). More...
 
coeffset (top t)
 Sets *this to the top interval (]-oo;+oo[), setting its type to interval coeff. More...
 
coeffset (bottom t)
 Sets *this to the empty interval ([+1;-1])., setting its type to interval coeff. More...
 
void swap (coeff &a, coeff &b)
 Swaps the contents and type of both coeff. More...
 

Printing

void print (FILE *stream=stdout) const
 Prints to a C stream. More...
 
std::ostream & operator<< (std::ostream &os, const coeff &s)
 Printing. More...
 

Tests

bool is_zero () const
 Whether the coeff is the scalar 0 or the interval [0;0]. More...
 
int cmp (const coeff &a, const coeff &b)
 Non-total comparison. More...
 
bool operator== (const coeff &a, const coeff &b)
 Set equality. More...
 
bool operator!= (const coeff &a, const coeff &b)
 Set inequality. More...
 

Detailed Description

Coefficient (ap_coeff_t wrapper).

A coeff is either a scalar or an interval.

Constructor & Destructor Documentation

◆ coeff() [1/19]

coeff::coeff ( )
inline

Makes a double scalar coeff equal to 0.0.

◆ coeff() [2/19]

coeff::coeff ( const coeff x)
inline

Makes a copy of a coeff.

◆ coeff() [3/19]

coeff::coeff ( const scalar x)
inline

Makes a scalar coeff from a scalar (copied).

◆ coeff() [4/19]

coeff::coeff ( int  x)
inline

Makes a MPQ scalar coeff from a native integer.

◆ coeff() [5/19]

coeff::coeff ( long  x)
inline

Makes a MPQ scalar coeff from a native integer.

◆ coeff() [6/19]

coeff::coeff ( double  x)
inline

Makes a double scalar coeff from a double.

◆ coeff() [7/19]

coeff::coeff ( const frac x)
inline

Makes a MPQ scalar coeff from a fraction with native integer coefficients.

◆ coeff() [8/19]

coeff::coeff ( const mpq_class &  x)
inline

Makes a MPQ scalar coeff from a MPQ (copied).

◆ coeff() [9/19]

coeff::coeff ( mpfr_t  x)
inline

Makes a MPFR scalar coeff from a MPFR (copied).

◆ coeff() [10/19]

coeff::coeff ( const interval x)
inline

Makes an interval coeff from an interval (copied).

◆ coeff() [11/19]

coeff::coeff ( const scalar inf,
const scalar sup 
)
inline

Makes an interval coeff from two scalar bounds (copied).

◆ coeff() [12/19]

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

Makes an interval coeff with MPQ bounds from native integer bounds.

◆ coeff() [13/19]

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

Makes an interval coeff with MPQ bounds from native integer bounds.

◆ coeff() [14/19]

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

Makes an interval coeff with double bounds from double bounds.

◆ coeff() [15/19]

coeff::coeff ( const frac inf,
const frac sup 
)
inline

Makes an interval coeff with MPQ bounds from fractions with native integer coefficients.

◆ coeff() [16/19]

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

Makes an interval coeff with MPQ bounds from MPQ bounds (copied).

◆ coeff() [17/19]

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

Makes an interval coeff with MPFR bounds from MPFR bounds (copied).

◆ coeff() [18/19]

coeff::coeff ( top  t)
inline

Makes an interval coeff representing ]-oo,+oo[.

◆ coeff() [19/19]

coeff::coeff ( bottom  t)
inline

Makes an empty interval coeff [+1;-1].

◆ ~coeff()

coeff::~coeff ( )
inline

Member Function Documentation

◆ get_ap_coeff_t() [1/2]

const ap_coeff_t * coeff::get_ap_coeff_t ( ) const
inline

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

◆ get_ap_coeff_t() [2/2]

ap_coeff_t * coeff::get_ap_coeff_t ( )
inline

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

◆ get_discr()

ap_coeff_discr_t coeff::get_discr ( ) const
inline

Whether the coeff is a scalar or an interval.

Returns
Either AP_COEFF_SCALAR or AP_COEFF_INTERVAL.

◆ get_interval() [1/2]

interval & coeff::get_interval ( )
inline

Returns a (modifiable) reference to the interval contained in the coeff.

Exceptions
bad_discriminantwhen the coeff is not of interval type

◆ get_interval() [2/2]

const interval & coeff::get_interval ( ) const
inline

Returns a reference to the interval contained in the coeff.

Exceptions
bad_discriminantwhen the coeff is not of interval type

◆ get_scalar() [1/2]

scalar & coeff::get_scalar ( )
inline

Returns a (modifiable) reference to the scalar contained in the coeff.

Exceptions
bad_discriminantwhen the coeff is not of scalar type

◆ get_scalar() [2/2]

const scalar & coeff::get_scalar ( ) const
inline

Returns a reference to the scalar contained in the coeff.

Exceptions
bad_discriminantwhen the coeff is not of scalar type

◆ hash()

long coeff::hash ( ) const
inline

Returns a hash code.

◆ is_zero()

bool coeff::is_zero ( ) const
inline

Whether the coeff is the scalar 0 or the interval [0;0].

◆ neg()

void coeff::neg ( )
inline

Negates *this.

◆ operator-()

coeff coeff::operator- ( ) const
inline

Returns the opposite of *this.

◆ operator=() [1/11]

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

Copies the coeff into *this (setting its type and value).

◆ operator=() [2/11]

coeff & coeff::operator= ( const scalar x)
inline

Copies the scalar into *this, setting its type to scalar coeff.

◆ operator=() [3/11]

coeff & coeff::operator= ( int  x)
inline

Assigns a native integer to *this, setting its type to MPQ scalar coeff.

◆ operator=() [4/11]

coeff & coeff::operator= ( long  x)
inline

Assigns a native integer to *this, setting its type to MPQ scalar coeff.

◆ operator=() [5/11]

coeff & coeff::operator= ( double  x)
inline

Assigns a double to *this, setting its type to double scalar coeff.

◆ operator=() [6/11]

coeff & coeff::operator= ( const frac x)
inline

Assigns a native integer fraction to *this, setting its type to MPQ scalar coeff.

◆ operator=() [7/11]

coeff & coeff::operator= ( const mpq_class &  x)
inline

Assigns a MPQ to *this, setting its type to MPQ scalar coeff and copying the MPQ.

◆ operator=() [8/11]

coeff & coeff::operator= ( mpfr_t  x)
inline

Assigns a MPFR to *this, setting its type to MPFR scalar coeff and copying the MPFR.

◆ operator=() [9/11]

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

Copies the interval into *this, setting its type to interval coeff.

◆ operator=() [10/11]

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

Set *this to the top interval (]-oo;+oo[), setting its type to interval coeff.

◆ operator=() [11/11]

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

Set *this to the empty interval ([+1;-1])., setting its type to interval coeff.

◆ print()

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

Prints to a C stream.

◆ reduce()

void coeff::reduce ( )
inline

Converts a singleton intervals to scalar.

◆ set() [1/18]

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

Copies the coeff into *this (setting its type and value).

Returns
*this.

◆ set() [2/18]

coeff & coeff::set ( const scalar x)
inline

Copies the scalar into *this, setting its type to scalar coeff.

Returns
*this.

◆ set() [3/18]

coeff & coeff::set ( int  x)
inline

Assigns a native integer to *this, setting its type to MPQ scalar coeff.

Returns
*this.

◆ set() [4/18]

coeff & coeff::set ( long  x)
inline

Assigns a native integer to *this, setting its type to MPQ scalar coeff.

Returns
*this.

◆ set() [5/18]

coeff & coeff::set ( double  x)
inline

Assigns a double to *this, setting its type to double scalar coeff.

Returns
*this.

◆ set() [6/18]

coeff & coeff::set ( const frac x)
inline

Assigns a native integer fraction to *this, setting its type to MPQ scalar coeff.

Returns
*this.

◆ set() [7/18]

coeff & coeff::set ( const mpq_class &  x)
inline

Assigns a MPQ to *this, setting its type to MPQ scalar coeff and copying the MPQ.

Returns
*this.

◆ set() [8/18]

coeff & coeff::set ( mpfr_t  x)
inline

Assigns a MPFR to *this, setting its type to MPFR scalar coeff and copying the MPFR.

Returns
*this.

◆ set() [9/18]

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

Copies the interval into *this, setting its type to interval coeff.

Returns
*this.

◆ set() [10/18]

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

Sets *this to an interval coeff with the given scalar bounds (copied).

Returns
*this.

◆ set() [11/18]

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

Sets *this to an interval coeff with MPQ scalar bounds.

Returns
*this.

◆ set() [12/18]

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

Sets *this to an interval coeff with MPQ scalar bounds.

Returns
*this.

◆ set() [13/18]

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

Sets *this to an interval coeff with double scalar bounds.

Returns
*this.

◆ set() [14/18]

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

Sets *this to an interval coeff with MPQ scalar bounds.

Returns
*this.

◆ set() [15/18]

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

Sets *this to an interval coeff with MPQ scalar bounds (copied).

Returns
*this.

◆ set() [16/18]

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

Sets *this to an interval coeff with MPFR scalar bounds (copied).

Returns
*this.

◆ set() [17/18]

coeff & coeff::set ( top  t)
inline

Sets *this to the top interval (]-oo;+oo[), setting its type to interval coeff.

Returns
*this.

◆ set() [18/18]

coeff & coeff::set ( bottom  t)
inline

Sets *this to the empty interval ([+1;-1])., setting its type to interval coeff.

Returns
*this.

Friends And Related Function Documentation

◆ cmp

int cmp ( const coeff a,
const coeff b 
)
friend

Non-total comparison.

◆ operator!=

bool operator!= ( const coeff a,
const coeff b 
)
friend

Set inequality.

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const coeff s 
)
friend

Printing.

◆ operator==

bool operator== ( const coeff a,
const coeff b 
)
friend

Set equality.

◆ swap

void swap ( coeff a,
coeff b 
)
friend

Swaps the contents and type of both coeff.

Member Data Documentation

◆ c

ap_coeff_t apron::coeff::c
protected

Structure managed by APRON.


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