PPL  1.2
Parma_Polyhedra_Library::Dense_Row::iterator Class Reference

#include <Dense_Row_defs.hh>

Collaboration diagram for Parma_Polyhedra_Library::Dense_Row::iterator:

Public Types

typedef std::bidirectional_iterator_tag iterator_category
 
typedef Coefficient value_type
 
typedef std::ptrdiff_t difference_type
 
typedef value_typepointer
 
typedef value_typereference
 

Public Member Functions

 iterator ()
 
 iterator (Dense_Row &r, dimension_type i)
 
Coefficientoperator* ()
 
Coefficient_traits::const_reference operator* () const
 
dimension_type index () const
 Returns the index of the element pointed to by *this. More...
 
iteratoroperator++ ()
 
iterator operator++ (int)
 
iteratoroperator-- ()
 
iterator operator-- (int)
 
bool operator== (const iterator &x) const
 
bool operator!= (const iterator &x) const
 
 operator const_iterator () const
 
bool OK () const
 

Private Attributes

Dense_Rowrow
 
dimension_type idx
 

Detailed Description

Definition at line 432 of file Dense_Row_defs.hh.

Member Typedef Documentation

Definition at line 437 of file Dense_Row_defs.hh.

typedef std::bidirectional_iterator_tag Parma_Polyhedra_Library::Dense_Row::iterator::iterator_category

Definition at line 435 of file Dense_Row_defs.hh.

Constructor & Destructor Documentation

Parma_Polyhedra_Library::Dense_Row::iterator::iterator ( )
inline

Definition at line 348 of file Dense_Row_inlines.hh.

References OK().

Parma_Polyhedra_Library::Dense_Row::iterator::iterator ( Dense_Row r,
dimension_type  i 
)
inline

Definition at line 354 of file Dense_Row_inlines.hh.

References OK().

Member Function Documentation

dimension_type Parma_Polyhedra_Library::Dense_Row::iterator::index ( ) const
inline

Returns the index of the element pointed to by *this.

If itr is a valid iterator for row, row[itr.index()] is equivalent to *itr.

Returns
the index of the element pointed to by *this.

Definition at line 372 of file Dense_Row_inlines.hh.

372  {
373  return idx;
374 }
bool Parma_Polyhedra_Library::Dense_Row::iterator::OK ( ) const
inline

Definition at line 422 of file Dense_Row_inlines.hh.

References Parma_Polyhedra_Library::Dense_Row::size().

Referenced by iterator().

422  {
423  if (row == NULL) {
424  return true;
425  }
426  // i can be equal to row.size() for past-the-end iterators
427  return (idx <= row->size());
428 }
dimension_type size() const
Gives the number of coefficients currently in use.
Parma_Polyhedra_Library::Dense_Row::iterator::operator const_iterator ( ) const
inline

Definition at line 417 of file Dense_Row_inlines.hh.

417  {
418  return const_iterator(*row, idx);
419 }
bool Parma_Polyhedra_Library::Dense_Row::iterator::operator!= ( const iterator x) const
inline

Definition at line 412 of file Dense_Row_inlines.hh.

412  {
413  return !(*this == x);
414 }
Coefficient & Parma_Polyhedra_Library::Dense_Row::iterator::operator* ( )
inline

Definition at line 360 of file Dense_Row_inlines.hh.

References Parma_Polyhedra_Library::Dense_Row::size().

360  {
361  PPL_ASSERT(idx < row->size());
362  return (*row)[idx];
363 }
dimension_type size() const
Gives the number of coefficients currently in use.
Coefficient_traits::const_reference Parma_Polyhedra_Library::Dense_Row::iterator::operator* ( ) const
inline

Definition at line 366 of file Dense_Row_inlines.hh.

References Parma_Polyhedra_Library::Dense_Row::size().

366  {
367  PPL_ASSERT(idx < row->size());
368  return (*row)[idx];
369 }
dimension_type size() const
Gives the number of coefficients currently in use.
Dense_Row::iterator & Parma_Polyhedra_Library::Dense_Row::iterator::operator++ ( )
inline

Definition at line 377 of file Dense_Row_inlines.hh.

References Parma_Polyhedra_Library::Dense_Row::OK(), and Parma_Polyhedra_Library::Dense_Row::size().

377  {
378  PPL_ASSERT(idx < row->size());
379  ++idx;
380  PPL_ASSERT(OK());
381  return *this;
382 }
dimension_type size() const
Gives the number of coefficients currently in use.
Dense_Row::iterator Parma_Polyhedra_Library::Dense_Row::iterator::operator++ ( int  )
inline

Definition at line 385 of file Dense_Row_inlines.hh.

385  {
386  iterator tmp(*this);
387  ++(*this);
388  return tmp;
389 }
Dense_Row::iterator & Parma_Polyhedra_Library::Dense_Row::iterator::operator-- ( )
inline

Definition at line 392 of file Dense_Row_inlines.hh.

References Parma_Polyhedra_Library::Dense_Row::OK().

392  {
393  PPL_ASSERT(idx > 0);
394  --idx;
395  PPL_ASSERT(OK());
396  return *this;
397 }
Dense_Row::iterator Parma_Polyhedra_Library::Dense_Row::iterator::operator-- ( int  )
inline

Definition at line 400 of file Dense_Row_inlines.hh.

400  {
401  iterator tmp(*this);
402  --(*this);
403  return tmp;
404 }
bool Parma_Polyhedra_Library::Dense_Row::iterator::operator== ( const iterator x) const
inline

Definition at line 407 of file Dense_Row_inlines.hh.

References idx, and row.

407  {
408  return (row == x.row) && (idx == x.idx);
409 }

Member Data Documentation

dimension_type Parma_Polyhedra_Library::Dense_Row::iterator::idx
private

Definition at line 471 of file Dense_Row_defs.hh.

Referenced by operator==().

Dense_Row* Parma_Polyhedra_Library::Dense_Row::iterator::row
private

Definition at line 470 of file Dense_Row_defs.hh.

Referenced by operator==().


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