OpenGM  2.3.x
Discrete Graphical Model Library
Public Member Functions | Protected Attributes | List of all members
opengm::IloNumArrayIterator Class Reference

Iterator to iterate over an array of type IloNumArray. More...

#include <lp_solver_cplex.hxx>

+ Inheritance diagram for opengm::IloNumArrayIterator:
+ Collaboration diagram for opengm::IloNumArrayIterator:

Public Member Functions

 IloNumArrayIterator ()
 Default constructor to create an empty IloNumArrayIterator. More...
 
 IloNumArrayIterator (const IloNumArray &array, const IloInt position=0)
 
bool operator!= (const IloNumArrayIterator &iter) const
 Comparison operator to test if two iterators point to different elements. More...
 
bool operator== (const IloNumArrayIterator &iter) const
 Comparison operator to test if two iterators point to the same element. More...
 
const IloNum & operator* () const
 The dereference operator provides constant access to the element at which the iterator is pointing. More...
 
const IloNum & operator[] (const IloInt n) const
 The subscript operator provides constant access to the element in the sequence which is n elements behind the element at which the iterator is pointing. More...
 
IloNumArrayIteratoroperator++ ()
 The increment operator increases the position at which the iterator is pointing by one. Hence the iterator will point to the next element in the sequence. More...
 
difference_type operator- (const IloNumArrayIterator &iter) const
 The difference operator computes the difference of two IloNumArrayIterators. More...
 

Protected Attributes

const IloNumArray * array_
 Constant pointer to the IloNumArray over which the iterator will iterate. More...
 
IloInt position_
 Index of the element in the sequence at which the iterator is pointing at the moment. More...
 

Detailed Description

Iterator to iterate over an array of type IloNumArray.

This class implements an iterator to iterate over the elements of an array of type IloNumArray. It provides only constant access to the elements.

Definition at line 16 of file lp_solver_cplex.hxx.

Constructor & Destructor Documentation

opengm::IloNumArrayIterator::IloNumArrayIterator ( )
inline

Default constructor to create an empty IloNumArrayIterator.

Definition at line 598 of file lp_solver_cplex.hxx.

opengm::IloNumArrayIterator::IloNumArrayIterator ( const IloNumArray &  array,
const IloInt  position = 0 
)
inline

Definition at line 603 of file lp_solver_cplex.hxx.

Member Function Documentation

bool opengm::IloNumArrayIterator::operator!= ( const IloNumArrayIterator iter) const
inline

Comparison operator to test if two iterators point to different elements.

Parameters
[in]iterThe iterator which will be tested for inequality.
Returns
True if the two iterators point to different elements, false otherwise.

Definition at line 608 of file lp_solver_cplex.hxx.

const IloNum & opengm::IloNumArrayIterator::operator* ( ) const
inline

The dereference operator provides constant access to the element at which the iterator is pointing.

Returns
Constant reference to the element at which the iterator is pointing.

Definition at line 616 of file lp_solver_cplex.hxx.

IloNumArrayIterator & opengm::IloNumArrayIterator::operator++ ( )
inline

The increment operator increases the position at which the iterator is pointing by one. Hence the iterator will point to the next element in the sequence.

Returns
Reference to the iterator which is now pointing to the next element in the sequence.

Definition at line 624 of file lp_solver_cplex.hxx.

IloNumArrayIterator::difference_type opengm::IloNumArrayIterator::operator- ( const IloNumArrayIterator iter) const
inline

The difference operator computes the difference of two IloNumArrayIterators.

Returns
Distance between two IloNumArrayIterators.

Definition at line 629 of file lp_solver_cplex.hxx.

bool opengm::IloNumArrayIterator::operator== ( const IloNumArrayIterator iter) const
inline

Comparison operator to test if two iterators point to the same element.

Parameters
[in]iterThe iterator which will be tested for equality.
Returns
True if the two iterators point to the same element, false otherwise.

Definition at line 612 of file lp_solver_cplex.hxx.

const IloNum & opengm::IloNumArrayIterator::operator[] ( const IloInt  n) const
inline

The subscript operator provides constant access to the element in the sequence which is n elements behind the element at which the iterator is pointing.

Parameters
[in]nThe offset for the element which will be accessed.
Returns
Constant reference to the element in the sequence which is n elements behind the element at which the iterator is pointing.

Definition at line 620 of file lp_solver_cplex.hxx.

Member Data Documentation

IloNumArrayIterator::array_
protected

Constant pointer to the IloNumArray over which the iterator will iterate.

Definition at line 37 of file lp_solver_cplex.hxx.

IloNumArrayIterator::position_
protected

Index of the element in the sequence at which the iterator is pointing at the moment.

Definition at line 38 of file lp_solver_cplex.hxx.