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

Dimension change object (ap_dimchange_t wrapper). More...

#include <apxx_dimension.hh>

Inherits apron::use_malloc.

Public Member Functions

Constructors
 dimchange (size_t intdim=0, size_t realdim=0)
 Makes an uninitialized dimchange. More...
 
 dimchange (size_t intdim, size_t realdim, const ap_dim_t d[])
 Makes a dimchange initialized using the given array of indices (copied). More...
 
 dimchange (size_t intdim, size_t realdim, const std::vector< ap_dim_t > &d)
 Makes a dimchange initialized using the given vector of indices (copied). More...
 
 dimchange (const dimchange &x, bool inv=false)
 Makes a copy of a dimchange, copying the array, and optionally inverting the dimension change. More...
 
Destructor
 ~dimchange ()
 
Assignments
dimchangeoperator= (const dimchange &x)
 (Deep) copy. More...
 
dimchangeoperator= (const ap_dim_t d[])
 Assignment from an array of indices. More...
 
dimchangeoperator= (const std::vector< ap_dim_t > &d)
 Assignment from a vector of indices (no change in size). More...
 
Accesses
size_t get_intdim () const
 Returns the number of integer dimensions to add/remove. More...
 
size_t get_realdim () const
 Returns the number of real dimensions to add/remove. More...
 
ap_dim_t & operator[] (size_t dim)
 Returns a (modifiable) reference to an index in the underlying array. More...
 
const ap_dim_t & operator[] (size_t dim) const
 Returns a reference to a (checked) index in the underlying array. More...
 
ap_dim_t & get (size_t dim)
 Returns a (modifiable) reference to an index in the underlying array (bound-checked). More...
 
const ap_dim_t & get (size_t dim) const
 Returns a reference to a (checked) index in the underlying array (bound-checked). More...
 
Operators
void add_invert ()
 Inverts *this. More...
 
dimchange operator- () const
 Returns the inverse of *this. More...
 
C API compatibility
const ap_dimchange_t * get_ap_dimchange_t () const
 Returns a pointer to the internal APRON object stored in *this. More...
 
ap_dimchange_t * get_ap_dimchange_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_dimchange_t c
 Structure managed by APRON. More...
 

Printing

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

Detailed Description

Dimension change object (ap_dimchange_t wrapper).

dimchange objects are used to insert or remove dimensions at arbitrary positions in expressions, constraints, and domains. A dimchange object embeds the number of integer and real dimensions to add/remove, as well as an array of indices where to add/remove dimensions. The array should be sorted in increasing order.

Constructor & Destructor Documentation

◆ dimchange() [1/4]

apron::dimchange::dimchange ( size_t  intdim = 0,
size_t  realdim = 0 
)
inline

Makes an uninitialized dimchange.

◆ dimchange() [2/4]

dimchange::dimchange ( size_t  intdim,
size_t  realdim,
const ap_dim_t  d[] 
)
inline

Makes a dimchange initialized using the given array of indices (copied).

  • d should contain (at least) intdim+realdim dimensions.

◆ dimchange() [3/4]

dimchange::dimchange ( size_t  intdim,
size_t  realdim,
const std::vector< ap_dim_t > &  d 
)
inline

Makes a dimchange initialized using the given vector of indices (copied).

Exceptions
std::invalid_argumentif d contains less than intdim+realdim dimensions.

◆ dimchange() [4/4]

apron::dimchange::dimchange ( const dimchange x,
bool  inv = false 
)
inline

Makes a copy of a dimchange, copying the array, and optionally inverting the dimension change.

  • inv if inv==true, then the constructed dimchange is the inverse of x (see add_invert).

◆ ~dimchange()

dimchange::~dimchange ( )
inline

Member Function Documentation

◆ add_invert()

void dimchange::add_invert ( )
inline

Inverts *this.

If the dimchange was used to add some dimensions, it can now be used to remove the added dimensions (but not the converse).

◆ get() [1/2]

ap_dim_t & dimchange::get ( size_t  dim)
inline

Returns a (modifiable) reference to an index in the underlying array (bound-checked).

Exceptions
std::out_of_rangeis thrown if dim>=intdim+realdim.

◆ get() [2/2]

const ap_dim_t & dimchange::get ( size_t  dim) const
inline

Returns a reference to a (checked) index in the underlying array (bound-checked).

Exceptions
std::out_of_rangeis thrown if dim>=intdim+realdim.

◆ get_ap_dimchange_t() [1/2]

const ap_dimchange_t * dimchange::get_ap_dimchange_t ( ) const
inline

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

◆ get_ap_dimchange_t() [2/2]

ap_dimchange_t * dimchange::get_ap_dimchange_t ( )
inline

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

◆ get_intdim()

size_t dimchange::get_intdim ( ) const
inline

Returns the number of integer dimensions to add/remove.

◆ get_realdim()

size_t dimchange::get_realdim ( ) const
inline

Returns the number of real dimensions to add/remove.

◆ operator-()

dimchange dimchange::operator- ( ) const
inline

Returns the inverse of *this.

See add_invert.

◆ operator=() [1/3]

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

(Deep) copy.

◆ operator=() [2/3]

dimchange & dimchange::operator= ( const ap_dim_t  d[])
inline

Assignment from an array of indices.

  • d should contain (at least) intdim+realdim dimensions.

◆ operator=() [3/3]

dimchange & dimchange::operator= ( const std::vector< ap_dim_t > &  d)
inline

Assignment from a vector of indices (no change in size).

Exceptions
std::invalid_argumentif d contains less than intdim+realdim dimensions.

◆ operator[]() [1/2]

ap_dim_t & dimchange::operator[] ( size_t  dim)
inline

Returns a (modifiable) reference to an index in the underlying array.

  • dim should be strictly smaller than intdim+realdim (not bound-checked).

◆ operator[]() [2/2]

const ap_dim_t & dimchange::operator[] ( size_t  dim) const
inline

Returns a reference to a (checked) index in the underlying array.

  • dim should be strictly smaller than intdim+realdim (not bound-checked).

◆ print()

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

Prints to a C stream.

Friends And Related Function Documentation

◆ operator<<

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

Printing.

Variable naming can be configured through the varname stream modifier.

Member Data Documentation

◆ c

ap_dimchange_t apron::dimchange::c
protected

Structure managed by APRON.


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