APRONXX
0.9.12
|
Iterator to traverse a constant linexpr1. More...
#include <apxx_linexpr1.hh>
Inherited by apron::linexpr1::iterator.
Public Member Functions | |
const_iterator (const linexpr1 &e) | |
Starts a new iterator to traverse the linear expression. More... | |
const_iterator (const const_iterator &i) | |
Duplicates the iterator. More... | |
const_iterator & | operator= (const const_iterator &i) |
Assigns the iterator. More... | |
const var & | get_var () const |
Returns the variable name of the coefficient at the current iterator position. More... | |
ap_dim_t | get_dim () const |
Returns the dimension of the coefficient at the current iterator position. More... | |
const coeff & | get_coeff () const |
Returns a reference to the coefficient at the current iterator position. More... | |
void | next () |
Moves the iterator to the following position. More... | |
void | operator++ () |
Moves the iterator to the following position. More... | |
bool | valid () const |
Whether we are at a valid position (true) or past the last iterator position (false). More... | |
Protected Member Functions | |
void | skip_AP_DIM_MAX () |
Internal use only. Skips free coefficients in sparse expressions. More... | |
const_iterator (ap_linexpr1_t *l) | |
Internal use only. More... | |
Protected Attributes | |
ap_linexpr1_t * | l |
Internal use only. Pointer to the underlying APRON structure. More... | |
ap_dim_t | pos |
Internal use only. Current index. More... | |
Iterator to traverse a constant linexpr1.
At each position, there is variable name and its corresponding coefficients. The expression is traversed in increasing order of integer variable names followed by real variable names also in increasing order.
To mutate a linear expression, use the iterator class instead.
Sample code:
|
inlineprotected |
Internal use only.
|
inline |
Starts a new iterator to traverse the linear expression.
|
inline |
Duplicates the iterator.
|
inline |
Returns a reference to the coefficient at the current iterator position.
std::out_of_range | if valid() returns false (we are past the last position). |
|
inline |
Returns the dimension of the coefficient at the current iterator position.
std::out_of_range | if valid() returns false (we are past the last position). |
|
inline |
Returns the variable name of the coefficient at the current iterator position.
std::out_of_range | if valid() returns false (we are past the last position). |
|
inline |
Moves the iterator to the following position.
|
inline |
Moves the iterator to the following position.
(Identical to next()).
|
inline |
Assigns the iterator.
|
inlineprotected |
Internal use only. Skips free coefficients in sparse expressions.
|
inline |
Whether we are at a valid position (true) or past the last iterator position (false).
|
protected |
Internal use only. Pointer to the underlying APRON structure.
|
protected |
Internal use only. Current index.