|
|
| texpr0 (const builder &x) |
| Makes an expression tree from a temporary (performing a deep copy). More...
|
|
| texpr0 (const texpr0 &x) |
| Makes a (deep) copy of the expression tree. More...
|
|
| texpr0 (const const_iterator &x) |
| Makes a (deep) copy of the expression tree. More...
|
|
| texpr0 (const linexpr0 &l) |
| Makes an expression tree from a linear expression (copying coefficients). More...
|
|
| texpr0 (const texpr0 &x, const dimchange &d, bool add=true) |
| Makes a (deep) copy of the expression, and then add or remove some dimensions. More...
|
|
| texpr0 (const texpr0 &x, const dimperm &d) |
| Makes a (deep) copy of the expression, and then permutes dimensions. More...
|
|
| texpr0 (const texpr0 &x, ap_dim_t dim, const texpr0 &dst) |
| Makes a (deep) copy of x and substitutes each occurrence of dim with (a fresh copy of) dst. More...
|
|
|
| ~texpr0 () |
| Frees the memory occupied by the expression (and, recursively, all sub-expressions). More...
|
|
|
texpr0 & | operator= (const texpr0 &x) |
| Makes a (deep) copy of the expression. More...
|
|
texpr0 & | operator= (const const_iterator &x) |
| Makes a (deep) copy of the expression. More...
|
|
texpr0 & | operator= (const builder &x) |
| Assigns from a temporary expression, performing a deep copy and deleting the previous value of *this. More...
|
|
texpr0 & | operator= (const linexpr0 &x) |
| Makes *this equal to the linear expression x (coefficients are copied), deleting the previous value of *this. More...
|
|
|
const_iterator | root () const |
| Returns a new iterator at the root of a constant expression tree. More...
|
|
iterator | root () |
| Returns a new iterator at the root of a mutable expression tree. More...
|
|
|
bool | equal (const texpr0 &x) const |
| Whether two expressions are syntactically, structurally equal. More...
|
|
bool | is_zero () const |
| Whether the expression is a single coefficient node with 0 value. More...
|
|
size_t | depth () const |
| Returns the depth of the expression tree (counting only operator nodes). More...
|
|
size_t | size () const |
| Returns the number of operator nodes in the expression tree. More...
|
|
ap_dim_t | max_dim () const |
| Returns the maximal dimension occurring in the expression (or 0 if there is no variable). More...
|
|
bool | has_dim (ap_dim_t d) const |
| Whether the given dimension occurs in the expression. More...
|
|
std::vector< ap_dim_t > | dimlist () const |
| Returns a list of all dimensions occurring in the expression (in strict increasing order) More...
|
|
bool | is_interval_cst () const |
| Whether the expression is constant (i.e., has no dimension leaves). More...
|
|
bool | is_interval_linear () const |
| Whether the expression is linear and there is no rounding. More...
|
|
bool | is_interval_polynomial () const |
| Whether the expression is polynomial and there is no rounding. More...
|
|
bool | is_interval_polyfrac () const |
| Whether the expression is a polynomial fraction and there is no rounding. More...
|
|
bool | is_scalar () const |
| Whether all occurring constants are scalar. More...
|
|
|
void | substitute (ap_dim_t dim, const texpr0 &dst) |
| Substitutes each occurrence of dim with (a fresh copy of) dst. More...
|
|
long | hash () const |
| Returns a hash code. More...
|
|
|
void | add_dimensions (const dimchange &d) |
| Adds some dimensions, shifting dimension if needed. More...
|
|
void | remove_dimensions (const dimchange &d) |
| Removes some dimensions, shifting dimension if needed. More...
|
|
void | permute_dimensions (const dimperm &d) |
| Permutes dimensions. More...
|
|
|
ap_texpr0_t * | get_ap_texpr0_t () |
| Returns a pointer to the internal APRON object stored in *this. More...
|
|
const ap_texpr0_t * | get_ap_texpr0_t () const |
| 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) |
|
Level 0 arbitrary expression tree (ap_texpr0_t wrapper).
A texpr0 represents an expression tree. Leaves include dimensions (i.e., variables by index) as well as constants (coefficients). Binary operators include addition, subtraction, multiplication, division, and modulo. Unary operators include opposite, square root, and typecast. Additionally, all operators are tagged with a destination type: perfect integers, reals, or floating-point numbers (of various bit-size). For integer and floating-point operators, a rounding direction can be specified (as well as 'any direction'). The concrete semantics of all operators is to first perform the operation on perfect reals (typecast being the identity operator here), and then round the result to the destination type in the specified direction.
A texpr0 manages a whole expression tree: assignment, copy, and destruction are deep (recursive).
Complex expression trees can be constructed using the standard +, -, *, /, % operators, as well as functions such as add, mul, div, etc. (allowing to set the destination type and rounding direction).
texpr0 x = dim(1) + dim(2) * 5;
Temporaries created by the operators have the texpr0::builder type. See the texpr0::builder class documentation for the details on operator arguments.
Expression trees can be visited and/or modified using the texpr0::iterator type.