APRONXX
0.9.12
|
Level 1 linear expression (ap_linexpr1_t wrapper). More...
#include <apxx_linexpr1.hh>
Inherits apron::use_malloc.
Classes | |
class | const_iterator |
Iterator to traverse a constant linexpr1. More... | |
class | iterator |
Iterator to traverse and mutate a linear expression. More... | |
Public Member Functions | |
Constructors | |
linexpr1 (const environment &e, const linexpr0 &x) | |
Creates a new expression from a linexpr0 (copied) and an environment (reference count incremented) associating names to dimensions in linexpr0. More... | |
linexpr1 (const environment &e, ap_linexpr_discr_t lin_discr=AP_LINEXPR_SPARSE, size_t size=0) | |
Creates a new null expression. More... | |
linexpr1 (const linexpr1 &x) | |
Makes a (deep) copy. More... | |
linexpr1 (const linexpr1 &x, const environment &e) | |
Makes a (deep) copy of x and extends its environment. More... | |
Destructor | |
~linexpr1 () | |
Frees all space for the expression and coefficients, and decrements the reference count of the environment. More... | |
Assignment | |
linexpr1 & | operator= (const linexpr1 &x) |
Makes a (deep) copy. More... | |
Dimension operations | |
void | extend_environment (const environment &e) |
Extends the environment of the expression. More... | |
Accesses, size | |
environment | get_environment () const |
Returns the environment of the expression (with incremented reference count). More... | |
const linexpr0 & | get_linexpr0 () const |
Returns a reference to the underlying linexpr0. More... | |
linexpr0 & | get_linexpr0 () |
Returns a modifiable reference to the underlying linexpr0. More... | |
size_t | size () const |
Returns the number of coefficients in the expression. More... | |
ap_linexpr_discr_t | get_discr () const |
Returns the type of underlying linexpr0. More... | |
coeff & | get_cst () |
Returns a (modifiable) reference to the constant coefficient. More... | |
const coeff & | get_cst () const |
Returns a reference to the constant coefficient. More... | |
coeff & | operator[] (const var &v) |
Returns a (modifiable) reference to the coefficient corresponding to the given variable name. More... | |
const coeff & | operator[] (const var &v) const |
Returns a reference to the coefficient corresponding to the given variable name. More... | |
Tests | |
bool | is_integer () const |
Whether the expression only depends on integer variables. More... | |
bool | is_real () const |
Whether the expression only depends on real variables. More... | |
ap_linexpr_type_t | get_type () const |
Gets the type of the linear expression. More... | |
bool | is_linear () const |
Whether all coefficients are scalar. More... | |
bool | is_quasilinear () const |
Whether all coefficients are scalar, except maybe the constant one. More... | |
Iterator | |
iterator | begin () |
Returns a new iterator to traverse and mutate the linear expression. More... | |
const_iterator | begin () const |
Returns a new constant iterator to traverse the linear expression. More... | |
Operators | |
void | minimize () |
Minimizes all coefficients. More... | |
C API compatibility | |
const ap_linexpr1_t * | get_ap_linexpr1_t () const |
Returns a pointer to the internal APRON object stored in *this. More... | |
ap_linexpr1_t * | get_ap_linexpr1_t () |
Returns a pointer to the internal APRON object stored in *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 | |
linexpr1 (ap_linexpr1_t &p) | |
Internal use only. Shallow copy (no copy of linexpr0 or environment). More... | |
Protected Attributes | |
ap_linexpr1_t | l |
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 linexpr1 &s) |
Printing. More... | |
Level 1 linear expression (ap_linexpr1_t wrapper).
Level 1 version of linear expressions with scalar or interval coefficients (coeff). Terms are indexed using variable names (var) instead of dimensions (ap_dim_t). Internally, a linexpr1 wraps together a linexpr0 (memory managed) and an environment (holding a reference count).
|
inlineprotected |
Internal use only. Shallow copy (no copy of linexpr0 or environment).
|
inline |
|
inline |
Creates a new null expression.
e
associates a variable name to each dimension. discr
whether the expression is sparse (AP_LINEXPR_SPARSE
) or dense (AP_LINEXPR_DENSE
). size
, for AP_LINEXPR_SPARSE
expressions, is the initial number of dimensions in the underlying linexpr0 (new dimensions being added as needed); ignored for AP_LINEXPR_DENSE
expressions (the size being always the size of the environment).
|
inline |
Makes a (deep) copy.
|
inline |
Makes a (deep) copy of x and extends its environment.
std::invalid_argument | if e is not a super-environment of that of x. |
|
inline |
Frees all space for the expression and coefficients, and decrements the reference count of the environment.
|
inline |
Returns a new iterator to traverse and mutate the linear expression.
|
inline |
Returns a new constant iterator to traverse the linear expression.
|
inline |
Extends the environment of the expression.
std::invalid_argument | if e is not a super-environment of that of *this. |
|
inline |
Returns a pointer to the internal APRON object stored in *this.
|
inline |
Returns a pointer to the internal APRON object stored in *this.
|
inline |
Returns a (modifiable) reference to the constant coefficient.
|
inline |
Returns a reference to the constant coefficient.
|
inline |
Returns the type of underlying linexpr0.
AP_LINEXPR_SPARSE
or AP_LINEXPR_DENSE
.
|
inline |
Returns the environment of the expression (with incremented reference count).
|
inline |
Returns a reference to the underlying linexpr0.
|
inline |
Returns a modifiable reference to the underlying linexpr0.
|
inline |
Gets the type of the linear expression.
AP_LINEXPR_INTLINEAR
(coefficients are interval), AP_LINEXPR_QUASILINEAR
(coefficients are scalar except the constant one), or AP_LINEXPR_LINEAR
(all coefficients are scalar).
|
inline |
Whether the expression only depends on integer variables.
|
inline |
Whether all coefficients are scalar.
|
inline |
Whether all coefficients are scalar, except maybe the constant one.
|
inline |
Whether the expression only depends on real variables.
|
inline |
Minimizes all coefficients.
In sparse expressions, also remove zero and unused (hole) coefficients to save space.
Returns a (modifiable) reference to the coefficient corresponding to the given variable name.
std::invalid_argument | if the variable name is not present in the environment. |
Returns a reference to the coefficient corresponding to the given variable name.
std::invalid_argument | if the variable name is not present in the environment. |
|
inline |
Prints to a C stream.
|
inline |
Returns the number of coefficients in the expression.
|
friend |
Printing.
|
protected |
Structure managed by APRON.