APRONXX  0.9.12
Protected Member Functions | Protected Attributes | List of all members
apron::tcons1_array Class Reference

Array of arbitrary constraints (ap_tcons1_array_t wrapper). More...

#include <apxx_tcons1.hh>

Inherits apron::use_malloc.

Public Member Functions

Constructors
 tcons1_array (const environment &e, const tcons0_array &x)
 Creates a new constraint array from a tcons0_array (copied) and an environment (reference count incremented) associating names to dimensions. More...
 
 tcons1_array (const environment &e, size_t size)
 Creates a new array of the given size containing uninitialized constraints. More...
 
 tcons1_array (const tcons1_array &x)
 (Deep) copy. More...
 
 tcons1_array (const tcons1_array &x, const environment &e)
 Makes a (deep) copy of the array and extends the environment. More...
 
 tcons1_array (size_t size, const tcons1 x[])
 Creates a tcons1_array from an array (of size >0) of constraints of the given size (copied). More...
 
 tcons1_array (const std::vector< tcons1 > &x)
 Creates a tcons1_array from an vector (of size >0) of constraints of the given size (copied). More...
 
Destructor
 ~tcons1_array ()
 Frees the space used by the array and all its constraints. More...
 
Assignments
tcons1_arrayoperator= (const tcons1_array &x)
 (Deep) copy. More...
 
tcons1_arrayoperator= (const tcons1 x[])
 Copies the constraints from the array into *this. More...
 
tcons1_arrayoperator= (const std::vector< tcons1 > &x)
 
Dimension operations
void resize (size_t size)
 Resizes the array. More...
 
void extend_environment (const environment &e)
 Extends the environment of all expressions in array. More...
 
Accesses
size_t size () const
 Returns the size of the array. More...
 
environment get_environment () const
 Returns the environment shared by all constraints (with incremented reference count). More...
 
const tcons0_arrayget_tcons0_array () const
 Returns a reference to the underlying tcons0_array. More...
 
tcons0_arrayget_tcons0_array ()
 Returns a (modifiable) reference to the underlying tcons0_array. More...
 
tcons1 get (size_t i) const
 Returns a copy of the constraint at index i. More...
 
void set (size_t i, const tcons1 &x)
 Changes the constraint at index i. More...
 
Conversion
 operator std::vector< tcons1 > () const
 Returns a copy of the constraints in the form of a vector. More...
 
C API compatibility
const ap_tcons1_array_t * get_ap_tcons1_array_t () const
 Returns a pointer to the internal APRON object stored in *this. More...
 
ap_tcons1_array_t * get_ap_tcons1_array_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 Member Functions

 tcons1_array (ap_tcons1_array_t &a)
 Internal use only. Performs a shallow copy and takes ownership of the contents. More...
 

Protected Attributes

ap_tcons1_array_t a
 Structure managed by APRON. More...
 

Printing

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

Detailed Description

Array of arbitrary constraints (ap_tcons1_array_t wrapper).

A tcons1_array represents an array of constraints on arbitrary expressions. An constraints share the same environment.

Constructor & Destructor Documentation

◆ tcons1_array() [1/7]

tcons1_array::tcons1_array ( ap_tcons1_array_t &  a)
inlineprotected

Internal use only. Performs a shallow copy and takes ownership of the contents.

◆ tcons1_array() [2/7]

tcons1_array::tcons1_array ( const environment e,
const tcons0_array x 
)
inline

Creates a new constraint array from a tcons0_array (copied) and an environment (reference count incremented) associating names to dimensions.

◆ tcons1_array() [3/7]

tcons1_array::tcons1_array ( const environment e,
size_t  size 
)
inline

Creates a new array of the given size containing uninitialized constraints.

has_modulo and has_texpr will return false on all elements of the array.

◆ tcons1_array() [4/7]

tcons1_array::tcons1_array ( const tcons1_array x)
inline

(Deep) copy.

◆ tcons1_array() [5/7]

tcons1_array::tcons1_array ( const tcons1_array x,
const environment e 
)
inline

Makes a (deep) copy of the array and extends the environment.

Exceptions
std::invalid_argumentif e is not a super-environment of that of x.

◆ tcons1_array() [6/7]

apron::tcons1_array::tcons1_array ( size_t  size,
const tcons1  x[] 
)
inline

Creates a tcons1_array from an array (of size >0) of constraints of the given size (copied).

Warning
assumes that all constraints have the same environment (unchecked).
Exceptions
std::invalid_argumentif size<1.

◆ tcons1_array() [7/7]

tcons1_array::tcons1_array ( const std::vector< tcons1 > &  x)
inline

Creates a tcons1_array from an vector (of size >0) of constraints of the given size (copied).

Warning
assumes that all constraints have the same environment (unchecked).
Exceptions
std::invalid_argumentif vector size<1.

◆ ~tcons1_array()

tcons1_array::~tcons1_array ( )
inline

Frees the space used by the array and all its constraints.

Member Function Documentation

◆ extend_environment()

void tcons1_array::extend_environment ( const environment e)
inline

Extends the environment of all expressions in array.

Exceptions
std::invalid_argumentif e is not a super-environment of that of *this.

◆ get()

tcons1 tcons1_array::get ( size_t  i) const
inline

Returns a copy of the constraint at index i.

Exceptions
std::out_of_rangeif i exceeds the dimension of the array.

◆ get_ap_tcons1_array_t() [1/2]

const ap_tcons1_array_t * tcons1_array::get_ap_tcons1_array_t ( ) const
inline

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

◆ get_ap_tcons1_array_t() [2/2]

ap_tcons1_array_t * tcons1_array::get_ap_tcons1_array_t ( )
inline

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

◆ get_environment()

environment tcons1_array::get_environment ( ) const
inline

Returns the environment shared by all constraints (with incremented reference count).

◆ get_tcons0_array() [1/2]

const tcons0_array & tcons1_array::get_tcons0_array ( ) const
inline

Returns a reference to the underlying tcons0_array.

◆ get_tcons0_array() [2/2]

tcons0_array & tcons1_array::get_tcons0_array ( )
inline

Returns a (modifiable) reference to the underlying tcons0_array.

◆ operator std::vector< tcons1 >()

tcons1_array::operator std::vector< tcons1 > ( ) const
inline

Returns a copy of the constraints in the form of a vector.

◆ operator=() [1/3]

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

(Deep) copy.

◆ operator=() [2/3]

tcons1_array & tcons1_array::operator= ( const tcons1  x[])
inline

Copies the constraints from the array into *this.

Warning
assumes that all constraints have the same environment (unchecked).
  • x should contain (at least) size elements.

◆ operator=() [3/3]

tcons1_array & tcons1_array::operator= ( const std::vector< tcons1 > &  x)
inline

Copies the constraints from the vector into the array, changing its size if needed.

Warning
assumes that all constraints have the same environment (unchecked).

◆ print()

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

Prints to a C stream.

◆ resize()

void tcons1_array::resize ( size_t  size)
inline

Resizes the array.

◆ set()

void tcons1_array::set ( size_t  i,
const tcons1 x 
)
inline

Changes the constraint at index i.

Warning
assumes that x and *this have equal environments.
Exceptions
std::out_of_rangeif i exceeds the dimension of the array.

◆ size()

size_t tcons1_array::size ( ) const
inline

Returns the size of the array.

Friends And Related Function Documentation

◆ operator<<

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

Printing.

Exceptions
std::invalid_argumentan underlying expression is missing, or an auxiliary scalar is missing (for modulo constraint).

Member Data Documentation

◆ a

ap_tcons1_array_t apron::tcons1_array::a
protected

Structure managed by APRON.


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