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

Iterator to traverse a constant linexpr0. More...

#include <apxx_linexpr0.hh>

Inherited by apron::linexpr0::iterator.

Public Member Functions

 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

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...
 

Protected Attributes

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 a constant linexpr0.

At each position, there is dimension and its corresponding coefficients. For sparse expressions, there can be a gap between the dimension at two successive position (holes are skipped.) In all cases, the expression is traversed in increasing dimension order.

To mutate a linear expression, use the iterator class instead.

Sample code:

for (linexpr0::const_iterator i = m.begin();i.valid();++i) cout << i.get_coeff() << " ";

Constructor & Destructor Documentation

◆ const_iterator() [1/3]

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

Internal use only.

◆ const_iterator() [2/3]

linexpr0::const_iterator::const_iterator ( const linexpr0 e)
inline

Starts a new iterator to traverse the linear expression.

◆ const_iterator() [3/3]

linexpr0::const_iterator::const_iterator ( const const_iterator i)
inline

Duplicates the iterator.

Member Function Documentation

◆ get_coeff()

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

Returns a reference to the coefficient at the current iterator position.

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

◆ get_dim()

ap_dim_t linexpr0::const_iterator::get_dim ( ) const
inline

Returns the dimension of the coefficient at the current iterator position.

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

◆ next()

void linexpr0::const_iterator::next ( )
inline

Moves the iterator to the following position.

◆ operator++()

void linexpr0::const_iterator::operator++ ( )
inline

Moves the iterator to the following position.

(Identical to next()).

◆ operator=()

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

Assigns the iterator.

◆ skip_AP_DIM_MAX()

void linexpr0::const_iterator::skip_AP_DIM_MAX ( )
inlineprotected

Internal use only. Skips free coefficients in sparse expressions.

◆ valid()

bool linexpr0::const_iterator::valid ( ) const
inline

Whether we are at a valid position (true) or past the last iterator position (false).

Member Data Documentation

◆ l

ap_linexpr0_t* apron::linexpr0::const_iterator::l
protected

Internal use only. Pointer to the underlying APRON structure.

◆ pos

ap_dim_t apron::linexpr0::const_iterator::pos
protected

Internal use only. Current index.


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