Go to the documentation of this file.
16 #ifndef __APXX_LINEXPR0_HH
17 #define __APXX_LINEXPR0_HH
19 #include "ap_linexpr0.h"
20 #include "ap_linearize.h"
70 linexpr0(ap_linexpr_discr_t discr=AP_LINEXPR_SPARSE,
size_t size=0);
95 linexpr0(
const std::vector<coeff>& coeffs,
const coeff& cst, ap_linexpr_discr_t discr=AP_LINEXPR_SPARSE);
207 void print(
char** name_of_dim = NULL, FILE* stream=stdout)
const;
222 bool is_real(
size_t intdim)
const;
244 #if 0 // overloaded to make constraints
bool valid() const
Whether we are at a valid position (true) or past the last iterator position (false).
Definition: apxx_linexpr0_inline.hh:424
ap_linexpr0_t * l
Internal use only. Pointer to the underlying APRON structure.
Definition: apxx_linexpr0.hh:294
const ap_linexpr0_t * get_ap_linexpr0_t() const
Returns a pointer to the internal APRON object stored in *this.
Definition: apxx_linexpr0_inline.hh:459
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()
Frees all space for the expression and coefficients.
Definition: apxx_linexpr0_inline.hh:120
const_iterator & operator=(const const_iterator &i)
Assigns the iterator.
Definition: apxx_linexpr0_inline.hh:378
Dimension change object (ap_dimchange_t wrapper).
Definition: apxx_dimension.hh:102
Coefficient (ap_coeff_t wrapper).
Definition: apxx_coeff.hh:36
Iterator to traverse a constant linexpr0.
Definition: apxx_linexpr0.hh:286
bool operator>(const abstract0 &x, const abstract0 &y)
Definition: apxx_abstract0_inline.hh:433
bool operator!=(const abstract0 &x, const abstract0 &y)
Definition: apxx_abstract0_inline.hh:416
ap_linexpr_discr_t get_discr() const
Returns the expression type.
Definition: apxx_linexpr0_inline.hh:172
ap_linexpr_type_t get_type() const
Gets the type of the linear expression.
Definition: apxx_linexpr0_inline.hh:272
friend class texpr0_tmp
Definition: apxx_linexpr0.hh:53
coeff & get_coeff() const
Returns a (modifiable) reference to the coefficient at the current iterator position.
Definition: apxx_linexpr0_inline.hh:406
const_iterator(ap_linexpr0_t *l)
Internal use only.
Represents a dimension (i.e., variable by index) in an expression tree.
Definition: apxx_texpr0.hh:33
coeff & get_cst()
Returns a (modifiable) reference to the constant coefficient.
Definition: apxx_linexpr0_inline.hh:178
bool is_real(size_t intdim) const
Whether only dimensions strictly smaller than intdim have a non-zero coefficient.
Definition: apxx_linexpr0_inline.hh:267
coeff & operator[](ap_dim_t dim)
Returns a (modifiable) reference to the coefficient corresponding to the given dimension.
Definition: apxx_linexpr0_inline.hh:188
linexpr0 & operator=(const linexpr0 &x)
Makes a (deep) copy.
Definition: apxx_linexpr0_inline.hh:129
void resize(size_t size)
Changes the number of coefficients in the expression. (Useful only for dense expressions....
Definition: apxx_linexpr0_inline.hh:143
void operator++()
Moves the iterator to the following position.
Definition: apxx_linexpr0_inline.hh:419
Inherited by most wrappers to map new and delete to malloc and free.
Definition: apxx_scalar.hh:69
friend int compare(const linexpr0 &x, const linexpr0 &y)
Lexicography ordering, terminating with constant coefficients.
friend std::ostream & operator<<(std::ostream &os, const linexpr0 &s)
Printing.
bool operator<=(const abstract0 &x, const abstract0 &y)
Definition: apxx_abstract0_inline.hh:421
ap_dim_t get_dim() const
Returns the dimension of the coefficient at the current iterator position.
Definition: apxx_linexpr0_inline.hh:392
bool operator<(const abstract0 &x, const abstract0 &y)
Definition: apxx_abstract0_inline.hh:438
Level 0 arbitrary expression tree (ap_texpr0_t wrapper).
Definition: apxx_texpr0.hh:92
iterator & operator=(const iterator &i)
Assigns the iterator.
Definition: apxx_linexpr0_inline.hh:385
void permute_dimensions(const dimperm &d)
Applies a permutation on coefficients.
Definition: apxx_linexpr0_inline.hh:153
Dimension permutation object (ap_dimperm_t wrapper).
Definition: apxx_dimension.hh:292
linexpr0(ap_linexpr0_t *p)
Internal use only. Shallow copy of structure followed by a free to take ownership of expression.
Definition: apxx_linexpr0_inline.hh:60
ap_dim_t pos
Internal use only. Current index.
Definition: apxx_linexpr0.hh:295
friend bool equal(const linexpr0 &x, const linexpr0 &y)
Structural, syntactical equality.
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).
iterator begin()
Returns a new iterator to traverse and mutate the linear expression.
Definition: apxx_linexpr0_inline.hh:429
void minimize()
Minimizes all coefficients.
Definition: apxx_linexpr0_inline.hh:444
linexpr0(ap_linexpr_discr_t discr=AP_LINEXPR_SPARSE, size_t size=0)
Creates a new expression.
bool operator==(const abstract0 &x, const abstract0 &y)
Definition: apxx_abstract0_inline.hh:409
bool is_integer(size_t intdim) const
Whether only dimensions greater than intdim have a non-zero coefficient.
Definition: apxx_linexpr0_inline.hh:262
Level 0 linear expression (ap_linexpr0_t wrapper).
Definition: apxx_linexpr0.hh:44
Iterator to traverse and mutate a linear expression.
Definition: apxx_linexpr0.hh:352
bool operator>=(const abstract0 &x, const abstract0 &y)
Definition: apxx_abstract0_inline.hh:428
void next()
Moves the iterator to the following position.
Definition: apxx_linexpr0_inline.hh:413
size_t size() const
Returns the number of coefficients in the expression.
Definition: apxx_linexpr0_inline.hh:164
iterator(ap_linexpr0_t *l)
Internal use only.
void skip_AP_DIM_MAX()
Internal use only. Skips free coefficients in sparse expressions.
Definition: apxx_linexpr0_inline.hh:342
const coeff & get_coeff() const
Returns a reference to the coefficient at the current iterator position.
Definition: apxx_linexpr0_inline.hh:399
void print(char **name_of_dim=NULL, FILE *stream=stdout) const
Prints to a C stream.
Definition: apxx_linexpr0_inline.hh:253
void add_dimensions(const dimchange &d)
Adds some dimensions, shifting coefficients if needed.
Definition: apxx_linexpr0_inline.hh:148
bool is_quasilinear() const
Whether all coefficients are scalar, except maybe the constant one.
Definition: apxx_linexpr0_inline.hh:282
Definition: apxx_abstract0.hh:27
ap_linexpr0_t l
Structure managed by APRON.
Definition: apxx_linexpr0.hh:48
bool is_linear() const
Whether all coefficients are scalar.
Definition: apxx_linexpr0_inline.hh:277
long hash() const
Returns a hash-code.
Definition: apxx_linexpr0_inline.hh:449