Level 1 linear expression (ap_linexpr1_t wrapper).
More...
#include <apxx_linexpr1.hh>
Inherits apron::use_malloc.
|
| | 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.
|
| | linexpr1 (const environment &e, ap_linexpr_discr_t lin_discr=AP_LINEXPR_SPARSE, size_t size=0) |
| | Creates a new null expression.
|
| | linexpr1 (const linexpr1 &x) |
| | Makes a (deep) copy.
|
| | linexpr1 (const linexpr1 &x, const environment &e) |
| | Makes a (deep) copy of x and extends its environment.
|
| | ~linexpr1 () |
| | Frees all space for the expression and coefficients, and decrements the reference count of the environment.
|
| linexpr1 & | operator= (const linexpr1 &x) |
| | Makes a (deep) copy.
|
| void | extend_environment (const environment &e) |
| | Extends the environment of the expression.
|
| environment | get_environment () const |
| | Returns the environment of the expression (with incremented reference count).
|
| const linexpr0 & | get_linexpr0 () const |
| | Returns a reference to the underlying linexpr0.
|
| linexpr0 & | get_linexpr0 () |
| | Returns a modifiable reference to the underlying linexpr0.
|
| size_t | size () const |
| | Returns the number of coefficients in the expression.
|
| ap_linexpr_discr_t | get_discr () const |
| | Returns the type of underlying linexpr0.
|
| coeff & | get_cst () |
| | Returns a (modifiable) reference to the constant coefficient.
|
| const coeff & | get_cst () const |
| | Returns a reference to the constant coefficient.
|
| coeff & | operator[] (const var &v) |
| | Returns a (modifiable) reference to the coefficient corresponding to the given variable name.
|
| const coeff & | operator[] (const var &v) const |
| | Returns a reference to the coefficient corresponding to the given variable name.
|
| bool | is_integer () const |
| | Whether the expression only depends on integer variables.
|
| bool | is_real () const |
| | Whether the expression only depends on real variables.
|
| ap_linexpr_type_t | get_type () const |
| | Gets the type of the linear expression.
|
| bool | is_linear () const |
| | Whether all coefficients are scalar.
|
| bool | is_quasilinear () const |
| | Whether all coefficients are scalar, except maybe the constant one.
|
| iterator | begin () |
| | Returns a new iterator to traverse and mutate the linear expression.
|
| const_iterator | begin () const |
| | Returns a new constant iterator to traverse the linear expression.
|
| void | minimize () |
| | Minimizes all coefficients.
|
| const ap_linexpr1_t * | get_ap_linexpr1_t () const |
| | Returns a pointer to the internal APRON object stored in *this.
|
| ap_linexpr1_t * | get_ap_linexpr1_t () |
| | Returns a pointer to the internal APRON object stored in *this.
|
| void * | operator new (size_t sz) |
| void * | operator new[] (size_t sz) |
| void | operator delete (void *p) |
| void | operator delete[] (void *p) |
|
| | linexpr1 (ap_linexpr1_t &p) |
| | Internal use only. Shallow copy (no copy of linexpr0 or environment).
|
|
| ap_linexpr1_t | l |
| | Structure managed by APRON.
|
|
| void | print (FILE *stream=stdout) const |
| | Prints to a C stream.
|
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).
◆ linexpr1() [1/5]
| linexpr1::linexpr1 |
( |
ap_linexpr1_t & | p | ) |
|
|
inlineprotected |
Internal use only. Shallow copy (no copy of linexpr0 or environment).
◆ linexpr1() [2/5]
Creates a new expression from a linexpr0 (copied) and an environment (reference count incremented) associating names to dimensions in linexpr0.
◆ linexpr1() [3/5]
| linexpr1::linexpr1 |
( |
const environment & | e, |
|
|
ap_linexpr_discr_t | lin_discr = AP_LINEXPR_SPARSE, |
|
|
size_t | size = 0 ) |
|
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).
◆ linexpr1() [4/5]
| linexpr1::linexpr1 |
( |
const linexpr1 & | x | ) |
|
|
inline |
◆ linexpr1() [5/5]
| linexpr1::linexpr1 |
( |
const linexpr1 & | x, |
|
|
const environment & | e ) |
|
inline |
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. |
◆ ~linexpr1()
Frees all space for the expression and coefficients, and decrements the reference count of the environment.
◆ begin() [1/2]
Returns a new iterator to traverse and mutate the linear expression.
◆ begin() [2/2]
Returns a new constant iterator to traverse the linear expression.
◆ extend_environment()
| void linexpr1::extend_environment |
( |
const environment & | e | ) |
|
|
inline |
Extends the environment of the expression.
- Exceptions
-
| std::invalid_argument | if e is not a super-environment of that of *this. |
◆ get_ap_linexpr1_t() [1/2]
| ap_linexpr1_t * linexpr1::get_ap_linexpr1_t |
( |
| ) |
|
|
inline |
Returns a pointer to the internal APRON object stored in *this.
◆ get_ap_linexpr1_t() [2/2]
| const ap_linexpr1_t * linexpr1::get_ap_linexpr1_t |
( |
| ) |
const |
|
inline |
Returns a pointer to the internal APRON object stored in *this.
◆ get_cst() [1/2]
| coeff & linexpr1::get_cst |
( |
| ) |
|
|
inline |
Returns a (modifiable) reference to the constant coefficient.
◆ get_cst() [2/2]
| const coeff & linexpr1::get_cst |
( |
| ) |
const |
|
inline |
Returns a reference to the constant coefficient.
◆ get_discr()
| ap_linexpr_discr_t linexpr1::get_discr |
( |
| ) |
const |
|
inline |
Returns the type of underlying linexpr0.
- Returns
- Either
AP_LINEXPR_SPARSE or AP_LINEXPR_DENSE.
◆ get_environment()
Returns the environment of the expression (with incremented reference count).
◆ get_linexpr0() [1/2]
Returns a modifiable reference to the underlying linexpr0.
◆ get_linexpr0() [2/2]
| const linexpr0 & linexpr1::get_linexpr0 |
( |
| ) |
const |
|
inline |
Returns a reference to the underlying linexpr0.
◆ get_type()
| ap_linexpr_type_t linexpr1::get_type |
( |
| ) |
const |
|
inline |
Gets the type of the linear expression.
- Returns
- Either
AP_LINEXPR_INTLINEAR (coefficients are interval), AP_LINEXPR_QUASILINEAR (coefficients are scalar except the constant one), or AP_LINEXPR_LINEAR (all coefficients are scalar).
◆ is_integer()
| bool linexpr1::is_integer |
( |
| ) |
const |
|
inline |
Whether the expression only depends on integer variables.
◆ is_linear()
| bool linexpr1::is_linear |
( |
| ) |
const |
|
inline |
Whether all coefficients are scalar.
◆ is_quasilinear()
| bool linexpr1::is_quasilinear |
( |
| ) |
const |
|
inline |
Whether all coefficients are scalar, except maybe the constant one.
◆ is_real()
| bool linexpr1::is_real |
( |
| ) |
const |
|
inline |
Whether the expression only depends on real variables.
◆ minimize()
| void linexpr1::minimize |
( |
| ) |
|
|
inline |
Minimizes all coefficients.
In sparse expressions, also remove zero and unused (hole) coefficients to save space.
◆ operator=()
◆ operator[]() [1/2]
| coeff & apron::linexpr1::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. |
◆ operator[]() [2/2]
| const coeff & apron::linexpr1::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. |
◆ print()
| void linexpr1::print |
( |
FILE * | stream = stdout | ) |
const |
|
inline |
◆ size()
| size_t linexpr1::size |
( |
| ) |
const |
|
inline |
Returns the number of coefficients in the expression.
| ap_linexpr1_t apron::linexpr1::l |
|
protected |
Structure managed by APRON.
The documentation for this class was generated from the following files: