| APRONXX 0.9.15
    | 
Level 0 linear expression (ap_linexpr0_t wrapper). More...
#include <apxx_linexpr0.hh>
Inherits apron::use_malloc.
| Classes | |
| class | const_iterator | 
| Iterator to traverse a constant linexpr0.  More... | |
| class | iterator | 
| Iterator to traverse and mutate a linear expression.  More... | |
| Public Member Functions | |
| Constructors | |
| linexpr0 (ap_linexpr_discr_t discr=AP_LINEXPR_SPARSE, size_t size=0) | |
| Creates a new expression. | |
| linexpr0 (const linexpr0 &x) | |
| Makes a (deep) copy. | |
| linexpr0 (const linexpr0 &x, const dimchange &d) | |
| Makes a (deep) copy, and adds some dimensions (shifting coefficients if needed). | |
| linexpr0 (const linexpr0 &x, const dimperm &d) | |
| Makes a (deep) copy, and applies a permutation on coefficients. | |
| linexpr0 (size_t size, const coeff coeffs[], const coeff &cst, ap_linexpr_discr_t discr=AP_LINEXPR_SPARSE) | |
| Makes a new linear expression with the given size and coefficients (copied). | |
| linexpr0 (const std::vector< coeff > &coeffs, const coeff &cst, ap_linexpr_discr_t discr=AP_LINEXPR_SPARSE) | |
| Makes a new linear expression with the given coefficients (copied). | |
| linexpr0 (size_t size, const coeff coeffs[], const ap_dim_t dims[], const coeff &cst) | |
| Makes a new linear expression with the given size and coefficients (copied). | |
| Destructor | |
| ~linexpr0 () | |
| Frees all space for the expression and coefficients. | |
| Assignment | |
| linexpr0 & | operator= (const linexpr0 &x) | 
| Makes a (deep) copy. | |
| Dimension operations | |
| void | resize (size_t size) | 
| Changes the number of coefficients in the expression. (Useful only for dense expressions.) | |
| void | add_dimensions (const dimchange &d) | 
| Adds some dimensions, shifting coefficients if needed. | |
| void | permute_dimensions (const dimperm &d) | 
| Applies a permutation on coefficients. | |
| Accesses, size | |
| size_t | size () const | 
| Returns the number of coefficients in the expression. | |
| ap_linexpr_discr_t | get_discr () const | 
| Returns the expression type. | |
| 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[] (ap_dim_t dim) | 
| Returns a (modifiable) reference to the coefficient corresponding to the given dimension. | |
| const coeff & | operator[] (ap_dim_t dim) const | 
| Returns a reference to the coefficient corresponding to the given dimension. | |
| Iterator | |
| 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. | |
| Operators | |
| void | minimize () | 
| Minimizes all coefficients. | |
| long | hash () const | 
| Returns a hash-code. | |
| C API compatibility | |
| const ap_linexpr0_t * | get_ap_linexpr0_t () const | 
| Returns a pointer to the internal APRON object stored in *this. | |
| ap_linexpr0_t * | get_ap_linexpr0_t () | 
| Returns a pointer to the internal APRON object stored in *this. | |
|  Public Member Functions inherited from apron::use_malloc | |
| 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 | |
| linexpr0 (ap_linexpr0_t *p) | |
| Internal use only. Shallow copy of structure followed by a free to take ownership of expression. | |
| Protected Attributes | |
| ap_linexpr0_t | l | 
| Structure managed by APRON. | |
| Printing | |
| void | print (char **name_of_dim=NULL, FILE *stream=stdout) const | 
| Prints to a C stream. | |
| Tests | |
| bool | is_integer (size_t intdim) const | 
| Whether only dimensions greater than intdimhave a non-zero coefficient. | |
| bool | is_real (size_t intdim) const | 
| Whether only dimensions strictly smaller than intdimhave a non-zero coefficient. | |
| 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. | |
Level 0 linear expression (ap_linexpr0_t wrapper).
A linexpr0 object represents a linear expression with scalar or interval coefficients (coeff). They have a constant coefficient, plus a coefficient for each represented dimension. An expression can be either sparse (AP_LINEXPR_SPARSE) or dense (AP_LINEXPR_DENSE). Dense expressions use an array of coefficients to represent dimensions from 0 up to the expression size. Sparse expressions can have 'holes' between coefficients and grow automatically when a coefficient for a non-existing dimension is accessed. 
| 
 | inlineprotected | 
Internal use only. Shallow copy of structure followed by a free to take ownership of expression.
| 
 | inline | 
Creates a new expression.
discr whether the expression is sparse (AP_LINEXPR_SPARSE) or dense (AP_LINEXPR_DENSE). size is the initial number of dimensions. | 
 | inline | 
Makes a (deep) copy.
Makes a (deep) copy, and adds some dimensions (shifting coefficients if needed).
Makes a (deep) copy, and applies a permutation on coefficients.
| 
 | inline | 
Makes a new linear expression with the given size and coefficients (copied).
discr whether the expression is sparse (AP_LINEXPR_SPARSE) or dense (AP_LINEXPR_DENSE). coeffs has size size, coeffs[i] corresponds to the coefficient for dimension i. cst corresponds to the constant coefficient. | 
 | inline | 
Makes a new linear expression with the given coefficients (copied).
discr whether the expression is sparse (AP_LINEXPR_SPARSE) or dense (AP_LINEXPR_DENSE). coeffs vector of coefficients, coeffs[i] corresponds to the coefficient for dimension i. cst corresponds to the constant coefficient. | 
 | inline | 
Makes a new linear expression with the given size and coefficients (copied).
The expression is always sparse.
coeffs has size size, coeffs[i] corresponds to the coefficient for dimension dims[i]; dims is a list of size dimensions (sorted in increasing order) cst corresponds to the constant coefficient. | 
 | inline | 
Frees all space for the expression and coefficients.
| 
 | inline | 
Adds some dimensions, shifting coefficients if needed.
| 
 | inline | 
Returns a new iterator to traverse and mutate the linear expression.
| 
 | inline | 
Returns a new constant iterator to traverse the linear expression.
| 
 | 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 expression type.
AP_LINEXPR_SPARSE or AP_LINEXPR_DENSE. | 
 | 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 | 
Returns a hash-code.
| 
 | inline | 
Whether only dimensions greater than intdim have a non-zero coefficient. 
| 
 | inline | 
Whether all coefficients are scalar.
| 
 | inline | 
Whether all coefficients are scalar, except maybe the constant one.
| 
 | inline | 
Whether only dimensions strictly smaller than intdim have a non-zero coefficient. 
| 
 | inline | 
Minimizes all coefficients.
In sparse expressions, also remove zero and unused (hole) coefficients to save space.
| 
 | inline | 
Returns a (modifiable) reference to the coefficient corresponding to the given dimension.
Always succeeds if the expression is sparse: if the dimension has no coefficient yet, it is created and returned (linear time in the worst case).
| std::out_of_range | if the expression is dense and the dimension exceeds the size of the expression. | 
| 
 | inline | 
Returns a reference to the coefficient corresponding to the given dimension.
| 
 | inline | 
Applies a permutation on coefficients.
| 
 | inline | 
Prints to a C stream.
| 
 | inline | 
Changes the number of coefficients in the expression. (Useful only for dense expressions.)
| 
 | inline | 
Returns the number of coefficients in the expression.
| 
 | protected | 
Structure managed by APRON.