APRONXX 0.9.15
|
Level 1 environment (ap_environment_t wrapper). More...
#include <apxx_environment.hh>
Inherits apron::use_malloc.
Public Member Functions | |
Constructors | |
environment () | |
Creates a new empty environment. | |
environment (const std::vector< var > &intdim, const std::vector< var > &realdim) | |
Creates a new environment with given integer and real variable names (copied). | |
environment (const var *intdim, size_t intdim_size, const var *realdim, size_t realdim_size) | |
Creates a new environment with given integer and real variable names (copied). | |
environment (const environment &x) | |
Creates a copy (i.e., increments the reference counter). | |
Destructor | |
~environment () | |
Decrements the reference counter and, if null, actually frees the environment. | |
Assignment | |
const environment & | operator= (const environment &x) |
Assignment (reference counter manipulation). | |
Accesses | |
size_t | intdim () const |
Returns the number of integer dimensions in the environment. | |
size_t | realdim () const |
Returns the number of real dimensions in the environment. | |
bool | contains (const var &x) const |
Whether the environment contains the variable name x. | |
ap_dim_t | operator[] (const var &x) const |
Returns the dimension associated with the variable name. | |
const var & | operator[] (ap_dim_t d) const |
Returns the variable name at a given dimension (no bound-check). | |
ap_dim_t | get_dim (const var &x) const |
Returns the dimension associated with a variable name. | |
const var & | get_var (ap_dim_t d) const |
Returns the variable name at a given dimension (bound-checked). | |
std::vector< var > | get_vars () const |
Returns (a copy of) the full map from dimensions to variable names. | |
C API compatibility | |
const ap_environment_t * | get_ap_environment_t () const |
Returns a pointer to the internal APRON object pointed by *this. | |
ap_environment_t * | get_ap_environment_t () |
Returns a pointer to the internal APRON object pointed by *this. | |
![]() | |
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 | |
environment (ap_environment_t *x) | |
Used internally only. Wraps the APRON object in an environment object (no copy, no change in reference counter). | |
Protected Attributes | |
ap_environment_t * | e |
Operations | |
environment | add (const std::vector< var > &intdim, const std::vector< var > &realdim) const |
Returns a copy of the environment with some integer and/or real variable names added. | |
environment | add (const var *intdim, size_t intdim_size, const var *realdim, size_t realdim_size) const |
Returns a copy of the environment with intdim_size integer and realdim_size real variable names added. | |
environment | add (const std::vector< var > &intdim, const std::vector< var > &realdim, dimperm &perm) const |
Returns a copy of the environment with some integer and/or real variable names added. | |
environment | add (const var *intdim, size_t intdim_size, const var *realdim, size_t realdim_size, dimperm &perm) const |
Returns a copy of the environment with intdim_size integer and realdim_size real variable names added. | |
environment | remove (const std::vector< var > &dims) const |
Returns a copy of the environment with some variable names removed. | |
environment | remove (const var *dims, size_t dims_size) const |
Returns a copy of the environment with dims_size variable names removed. | |
environment | rename (const std::vector< std::pair< var, var > > &dims) const |
Returns a copy of the environment with some variable names substituted. | |
environment | rename (const var *before, const var *after, size_t dims_size) const |
Returns a copy of the environment with dims_size variable names substituted. | |
environment | rename (const std::vector< std::pair< var, var > > &dims, dimperm &perm) const |
Returns a copy of the environment with some variable names substituted. | |
environment | rename (const var *before, const var *after, size_t dims_size, dimperm &perm) const |
Returns a copy of the environment with dims_size variable names substituted. | |
Printing | |
void | print (FILE *stream=stdout) const |
Prints to a C stream. | |
Level 1 environment (ap_environment_t wrapper).
An environment associates dimensions to integer and real variable names (var). It stores a number intdim of integer dimensions, a number realdim of real dimensions, and an array of size intdim+realdim variable names indexed by dimensions. Dimensions 0 to intdim-1 are associated to integer variables while dimensions intdim to intdim+realdim-1 are associated to real variables. Variables in both slices [0;intdim-1] and [intdim;intdim+realdim-1] are always sorted in strictly increasing order. (Recall that variables have the following user-specified functions: copy, deallocation, comparison, conversion to string.) This invariant is automatically enforced by the library by performing dimension permutations after variable name addition, deletion, or renaming. Thus, such an operation can change the dimension associated to existing variable names.
Environments are reference-counted and the API is fully functional (i.e., functions do not change *this but return a new object instead).
|
inlineprotected |
Used internally only. Wraps the APRON object in an environment object (no copy, no change in reference counter).
|
inline |
Creates a new empty environment.
|
inline |
Creates a new environment with given integer and real variable names (copied).
std::invalid_argument | if variable names are not distinct. |
|
inline |
Creates a new environment with given integer and real variable names (copied).
std::invalid_argument | if variable names are not distinct. |
|
inline |
Creates a copy (i.e., increments the reference counter).
|
inline |
Decrements the reference counter and, if null, actually frees the environment.
|
inline |
Returns a copy of the environment with some integer and/or real variable names added.
std::invalid_argument | if the resulting environment has duplicate variable names. |
|
inline |
Returns a copy of the environment with some integer and/or real variable names added.
Sets perm to the dimension permutation that has been performed after appending variable names at the end of integer (resp. real) dimensions to get them sorted again.
std::invalid_argument | if the resulting environment has duplicate variable names. |
|
inline |
Returns a copy of the environment with intdim_size integer and realdim_size real variable names added.
std::invalid_argument | if the resulting environment has duplicate variable names. |
|
inline |
Returns a copy of the environment with intdim_size integer and realdim_size real variable names added.
Sets perm to the dimension permutation that has been performed after appending variable names at the end of integer (resp. real) dimensions to get them sorted again.
std::invalid_argument | if the resulting environment has duplicate variable names. |
|
inline |
Whether the environment contains the variable name x.
|
inline |
Returns a pointer to the internal APRON object pointed by *this.
|
inline |
Returns a pointer to the internal APRON object pointed by *this.
|
inline |
Returns the dimension associated with a variable name.
std::invalid_argument | if there is no such variable name in the environment. |
|
inline |
Returns the variable name at a given dimension (bound-checked).
std::out_of_range | if the dimension is larger than the environment size. |
|
inline |
Returns (a copy of) the full map from dimensions to variable names.
|
inline |
Returns the number of integer dimensions in the environment.
|
inline |
Assignment (reference counter manipulation).
|
inline |
Returns the variable name at a given dimension (no bound-check).
|
inline |
Returns the dimension associated with the variable name.
std::invalid_argument | if there is no such variable name in the environment. |
|
inline |
Prints to a C stream.
|
inline |
Returns the number of real dimensions in the environment.
|
inline |
Returns a copy of the environment with some variable names removed.
std::invalid_argument | if some variable name does not exist. |
|
inline |
Returns a copy of the environment with dims_size variable names removed.
std::invalid_argument | if some variable name does not exist. |
|
inline |
Returns a copy of the environment with some variable names substituted.
dims[i].first is replaced with dims[i].second.
std::invalid_argument | if some variable name does not exist. |
|
inline |
Returns a copy of the environment with some variable names substituted.
dims[i].first is replaced with dims[i].second. Sets perm to the dimension permutation that has been performed after renaming the variable names in-place to get them sorted again.
std::invalid_argument | if some variable name does not exist. |
|
inline |
Returns a copy of the environment with dims_size variable names substituted.
before[i] is replaced with after[i]. Both array should contain dims_size elements.
std::invalid_argument | if some variable name does not exist. |
|
inline |
Returns a copy of the environment with dims_size variable names substituted.
before[i] is replaced with after[i]. Both array should contain dims_size elements. Sets perm to the dimension permutation that has been performed after renaming the variable names in-place to get them sorted again.
std::invalid_argument | if some variable name does not exist. |
|
protected |