Level 1 generator (ap_generator1_t wrapper).
More...
#include <apxx_generator1.hh>
Inherits apron::use_malloc.
|
ap_generator1_t | l |
| Structure managed by APRON. More...
|
|
Level 1 generator (ap_generator1_t wrapper).
Level 1 version of linear generators with scalar coefficients (coeff). Terms are indexed using variable names (var) instead of dimensions (ap_dim_t). Internally, a generator1 wraps together a generator0 (memory managed) and an environment (holding a reference count).
generator1::generator1 |
( |
ap_generator1_t |
p | ) |
|
|
inlineprotected |
Internal use only. Shallow copy (no copy of generator0 or environment).
Creates a new generator from a generator0 (copied) and an environment (reference count incremented) associating names to dimensions in generator0.
apron::generator1::generator1 |
( |
const environment & |
e, |
|
|
ap_gentyp_t |
gentyp = AP_GEN_RAY |
|
) |
| |
|
inline |
Creates a new generator from an empty linear expression.
The linear expression is created sparse and empty (has_linexpr returns true).
e
associates a variable name to each dimension (reference counter incremented).
gentyp
can be AP_GEN_LINE, AP_GEN_RAY, AP_GEN_VERTEX, AP_GEN_LINEMOD, or AP_GEN_RAYMOD.
generator1::generator1 |
( |
ap_gentyp_t |
gentyp, |
|
|
const linexpr1 & |
lin |
|
) |
| |
|
inline |
Creates a new generator from a linear expression (copied).
e
associates a variable name to each dimension (reference counter incremented).
gentyp
can be AP_GEN_LINE, AP_GEN_RAY, AP_GEN_VERTEX, AP_GEN_LINEMOD, or AP_GEN_RAYMOD.
- Warning
lin
should have only scalar (non-interval) coefficients (unchecked).
(Deep) copy of a generator.
Makes a (deep) copy of x and extends its environment.
- Exceptions
-
std::invalid_argument | if e is not a super-environment of that of x. |
generator1::~generator1 |
( |
| ) |
|
|
inline |
Frees all space for the generator, and decrements the reference count of the environment.
void generator1::extend_environment |
( |
const environment & |
e | ) |
|
|
inline |
Extends the environment of the generator.
- Exceptions
-
std::invalid_argument | if e is not a super-environment of that of *this. |
const ap_generator1_t * apron::generator1::get_ap_generator1_t |
( |
| ) |
const |
|
inline |
Returns a pointer to the internal APRON object stored in *this.
ap_generator1_t * generator1::get_ap_generator1_t |
( |
| ) |
|
|
inline |
Returns a pointer to the internal APRON object stored in *this.
coeff & generator1::get_cst |
( |
| ) |
|
|
inline |
Returns a (modifiable) reference to the constant coefficient.
- Exceptions
-
std::invalid_argument | if no valid linear expression has been defined. |
const coeff & apron::generator1::get_cst |
( |
| ) |
const |
|
inline |
Returns a reference to the constant coefficient.
- Exceptions
-
std::invalid_argument | if no valid linear expression has been defined. |
Returns the environment of the generator (with incremented reference count).
const generator0 & apron::generator1::get_generator0 |
( |
| ) |
const |
|
inline |
Returns a (modifiable) reference to the underlying generator0.
ap_gentyp_t & generator1::get_gentyp |
( |
| ) |
|
|
inline |
Returns a (modifiable) reference to the constraint type.
- Returns
- either AP_GEN_LINE, AP_GEN_RAY, AP_GEN_VERTEX, AP_GEN_LINEMOD, or AP_GEN_RAYMOD.
const ap_gentyp_t & apron::generator1::get_gentyp |
( |
| ) |
const |
|
inline |
Returns a reference to the constraint type.
- Returns
- either AP_GEN_LINE, AP_GEN_RAY, AP_GEN_VERTEX, AP_GEN_LINEMOD, or AP_GEN_RAYMOD.
linexpr1 generator1::get_linexpr |
( |
| ) |
const |
|
inline |
Returns a copy of the underlying linear expression.
- Exceptions
-
std::invalid_argument | if no valid linear expression has been defined. |
bool generator1::has_linexpr |
( |
| ) |
const |
|
inline |
Whether the generator has a valid linear expression.
- Note
- The only way the linear expression may be invalid is when accessing fields of uninitialised (or enlarged) generator1_array.
coeff & apron::generator1::operator[] |
( |
const var & |
v | ) |
|
|
inline |
Returns a (modifiable) reference to the coefficient corresponding to the given variable name.
- Exceptions
-
std::invalid_argument | if the variable name is not present in the environment. |
std::invalid_argument | if no valid linear expression has been defined. |
const coeff & apron::generator1::operator[] |
( |
const var & |
v | ) |
const |
|
inline |
Returns a reference to the coefficient corresponding to the given variable name.
- Exceptions
-
std::invalid_argument | if the variable name is not present in the environment. |
std::invalid_argument | if no valid linear expression has been defined. |
void generator1::print |
( |
FILE * |
stream = stdout | ) |
const |
|
inline |
void generator1::set_linexpr |
( |
const linexpr1 & |
c | ) |
|
|
inline |
Sets the underlying linear expression to c (copied).
Does not fail as get_linexpr can: if the generator was created without an underlying expression, it is created.
- Warning
c
should have only scalar (non-interval) coefficients (unchecked).
-
assumes that c and *this have equal environments (unchecked).
size_t generator1::size |
( |
| ) |
const |
|
inline |
Returns the size of the underlying linear expression.
- Exceptions
-
std::invalid_argument | if no valid linear expression has been defined. |
std::ostream& operator<< |
( |
std::ostream & |
os, |
|
|
const generator1 & |
s |
|
) |
| |
|
friend |
ap_generator1_t apron::generator1::l |
|
protected |
Structure managed by APRON.
The documentation for this class was generated from the following files: