APRONXX
0.9.12
|
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. More... | |
environment (const std::vector< var > &intdim, const std::vector< var > &realdim) | |
Creates a new environment with given integer and real variable names (copied). More... | |
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). More... | |
environment (const environment &x) | |
Creates a copy (i.e., increments the reference counter). More... | |
Destructor | |
~environment () | |
Decrements the reference counter and, if null, actually frees the environment. More... | |
Assignment | |
const environment & | operator= (const environment &x) |
Assignment (reference counter manipulation). More... | |
Accesses | |
size_t | intdim () const |
Returns the number of integer dimensions in the environment. More... | |
size_t | realdim () const |
Returns the number of real dimensions in the environment. More... | |
bool | contains (const var &x) const |
Whether the environment contains the variable name x. More... | |
ap_dim_t | operator[] (const var &x) const |
Returns the dimension associated with the variable name. More... | |
const var & | operator[] (ap_dim_t d) const |
Returns the variable name at a given dimension (no bound-check). More... | |
ap_dim_t | get_dim (const var &x) const |
Returns the dimension associated with a variable name. More... | |
const var & | get_var (ap_dim_t d) const |
Returns the variable name at a given dimension (bound-checked). More... | |
std::vector< var > | get_vars () const |
Returns (a copy of) the full map from dimensions to variable names. More... | |
C API compatibility | |
const ap_environment_t * | get_ap_environment_t () const |
Returns a pointer to the internal APRON object pointed by *this. More... | |
ap_environment_t * | get_ap_environment_t () |
Returns a pointer to the internal APRON object pointed by *this. More... | |
![]() | |
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). More... | |
Protected Attributes | |
ap_environment_t * | e |
Friends | |
Tests | |
bool | operator== (const environment &x, const environment &y) |
Equality testing. More... | |
bool | operator!= (const environment &x, const environment &y) |
Disequality testing. More... | |
bool | operator<= (const environment &x, const environment &y) |
Inclusion testing. More... | |
bool | operator>= (const environment &x, const environment &y) |
Inclusion testing. More... | |
int | cmp (const environment &x, const environment &y) |
Environment comparison. More... | |
Operations | |
environment | lce (const environment &x, const environment &y) |
Returns the least common environment of two environments. More... | |
environment | lce (const environment &x, const environment &y, dimchange &chgx, dimchange &chgy) |
Returns the least common environment of two environments. More... | |
environment | lce (const std::vector< environment > &x) |
Returns the least common environment of a vector of environments. More... | |
environment | lce (const environment *env, size_t env_size) |
Returns the least common environment of an array env of env_size environments. More... | |
environment | lce (const std::vector< environment > &x, std::vector< dimchange > &chg) |
Returns the least common environment of a vector of environments. More... | |
environment | lce (const environment *env, dimchange *chg, size_t env_size) |
Returns the least common environment of an array env of env_size environments. More... | |
dimchange | get_dimchange (const environment &x, const environment &y) |
Returns the dimension change to transform an environment x into a super-environment y. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
environment | remove (const std::vector< var > &dims) const |
Returns a copy of the environment with some variable names removed. More... | |
environment | remove (const var *dims, size_t dims_size) const |
Returns a copy of the environment with dims_size variable names removed. More... | |
environment | rename (const std::vector< std::pair< var, var > > &dims) const |
Returns a copy of the environment with some variable names substituted. More... | |
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. More... | |
environment | rename (const std::vector< std::pair< var, var > > &dims, dimperm &perm) const |
Returns a copy of the environment with some variable names substituted. More... | |
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. More... | |
Printing | |
std::ostream & | operator<< (std::ostream &os, const environment &s) |
Printing. More... | |
void | print (FILE *stream=stdout) const |
Prints to a C stream. More... | |
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 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 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.
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 dimension associated with the variable name.
std::invalid_argument | if there is no such variable name in the environment. |
|
inline |
Returns the variable name at a given dimension (no bound-check).
|
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 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 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. 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. |
|
friend |
Environment comparison.
|
friend |
Returns the dimension change to transform an environment x into a super-environment y.
std::invalid_argument | if x is not a subset of y, or if x and chg have different size. |
|
friend |
Returns the least common environment of two environments.
std::invalid_argument | if some variable name has different type in both environments |
|
friend |
Returns the least common environment of two environments.
Sets chgx (resp. chgy) to the dimension transformation that has been performed after appending the required variable names to x (resp. y) to keep them sorted.
std::invalid_argument | if some variable name has different type in both environments |
|
friend |
Returns the least common environment of a vector of environments.
std::invalid_argument | if some variable name has different type in different environments |
|
friend |
Returns the least common environment of an array env of env_size environments.
std::invalid_argument | if some variable name has different type in different environments |
|
friend |
Returns the least common environment of a vector of environments.
Sets chg[i] to the dimension transformation that has been performed after appending the required variable names to x[i] to keep them sorted. chg must have space for at least env_size elements.
std::invalid_argument | if some variable name has different type in different environments |
|
friend |
Returns the least common environment of an array env of env_size environments.
Sets chg[i] to the dimension transformation that has been performed after appending the required variable names to x[i] to keep them sorted. chg must have space for at least env_size elements.
std::invalid_argument | if some variable name has different type in different environments |
|
friend |
Disequality testing.
|
friend |
Printing.
|
friend |
Inclusion testing.
|
friend |
Equality testing.
|
friend |
Inclusion testing.
|
protected |