APRONXX  0.9.12
Public Member Functions | Protected Member Functions | List of all members
apron::linexpr0::iterator Class Reference

Iterator to traverse and mutate a linear expression. More...

#include <apxx_linexpr0.hh>

Inherits apron::linexpr0::const_iterator.

Public Member Functions

 iterator (linexpr0 &e)
 Starts a new iterator to traverse the linear expression. More...
 
 iterator (const iterator &i)
 Duplicates the iterator. More...
 
iteratoroperator= (const iterator &i)
 Assigns the iterator. More...
 
coeffget_coeff () const
 Returns a (modifiable) reference to the coefficient at the current iterator position. More...
 
- Public Member Functions inherited from apron::linexpr0::const_iterator
 const_iterator (const linexpr0 &e)
 Starts a new iterator to traverse the linear expression. More...
 
 const_iterator (const const_iterator &i)
 Duplicates the iterator. More...
 
const_iteratoroperator= (const const_iterator &i)
 Assigns the iterator. More...
 
ap_dim_t get_dim () const
 Returns the dimension of the coefficient at the current iterator position. More...
 
const coeffget_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

 iterator (ap_linexpr0_t *l)
 Internal use only. More...
 
- Protected Member Functions inherited from apron::linexpr0::const_iterator
void skip_AP_DIM_MAX ()
 Internal use only. Skips free coefficients in sparse expressions. More...
 
 const_iterator (ap_linexpr0_t *l)
 Internal use only. More...
 

Additional Inherited Members

- Protected Attributes inherited from apron::linexpr0::const_iterator
ap_linexpr0_t * l
 Internal use only. Pointer to the underlying APRON structure. More...
 
ap_dim_t pos
 Internal use only. Current index. More...
 

Detailed Description

Iterator to traverse and mutate a linear expression.

As const_iterator, but for non-constant linexpr0.

Caution: do not modify the expression during traversal, except through the iterator.

Sample code:

for (linexpr0::iterator i = m.begin();i.valid();++i) i.get_coeff().neg();

Constructor & Destructor Documentation

◆ iterator() [1/3]

apron::linexpr0::iterator::iterator ( ap_linexpr0_t *  l)
inlineprotected

Internal use only.

◆ iterator() [2/3]

linexpr0::iterator::iterator ( linexpr0 e)
inline

Starts a new iterator to traverse the linear expression.

◆ iterator() [3/3]

linexpr0::iterator::iterator ( const iterator i)
inline

Duplicates the iterator.

Member Function Documentation

◆ get_coeff()

coeff & linexpr0::iterator::get_coeff ( ) const
inline

Returns a (modifiable) reference to the coefficient at the current iterator position.

Exceptions
std::out_of_rangeif valid() returns false (we are past the last position).

◆ operator=()

linexpr0::iterator & linexpr0::iterator::operator= ( const iterator i)
inline

Assigns the iterator.


The documentation for this class was generated from the following files: