PPL  1.2
Parma_Polyhedra_Library::Dense_Row::const_iterator Class Reference

#include <Dense_Row_defs.hh>

Collaboration diagram for Parma_Polyhedra_Library::Dense_Row::const_iterator:

Public Types

typedef const Coefficient value_type
 
typedef std::ptrdiff_t difference_type
 
typedef value_typepointer
 
typedef Coefficient_traits::const_reference reference
 

Public Member Functions

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

Private Attributes

const Dense_Rowrow
 
dimension_type idx
 

Detailed Description

Definition at line 474 of file Dense_Row_defs.hh.

Member Typedef Documentation

typedef Coefficient_traits::const_reference Parma_Polyhedra_Library::Dense_Row::const_iterator::reference

Definition at line 480 of file Dense_Row_defs.hh.

Constructor & Destructor Documentation

Parma_Polyhedra_Library::Dense_Row::const_iterator::const_iterator ( )
inline

Definition at line 432 of file Dense_Row_inlines.hh.

References OK().

Parma_Polyhedra_Library::Dense_Row::const_iterator::const_iterator ( const Dense_Row r,
dimension_type  i 
)
inline

Definition at line 438 of file Dense_Row_inlines.hh.

References OK().

Member Function Documentation

dimension_type Parma_Polyhedra_Library::Dense_Row::const_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 451 of file Dense_Row_inlines.hh.

451  {
452  return idx;
453 }
bool Parma_Polyhedra_Library::Dense_Row::const_iterator::OK ( ) const
inline

Definition at line 496 of file Dense_Row_inlines.hh.

References Parma_Polyhedra_Library::Dense_Row::size().

Referenced by const_iterator().

496  {
497  if (row == NULL) {
498  return true;
499  }
500  // i can be equal to row.size() for past-the-end iterators
501  return (idx <= row->size());
502 }
dimension_type size() const
Gives the number of coefficients currently in use.
bool Parma_Polyhedra_Library::Dense_Row::const_iterator::operator!= ( const const_iterator x) const
inline

Definition at line 491 of file Dense_Row_inlines.hh.

491  {
492  return !(*this == x);
493 }
Coefficient_traits::const_reference Parma_Polyhedra_Library::Dense_Row::const_iterator::operator* ( ) const
inline

Definition at line 445 of file Dense_Row_inlines.hh.

References Parma_Polyhedra_Library::Dense_Row::size().

445  {
446  PPL_ASSERT(idx < row->size());
447  return (*row)[idx];
448 }
dimension_type size() const
Gives the number of coefficients currently in use.
Dense_Row::const_iterator & Parma_Polyhedra_Library::Dense_Row::const_iterator::operator++ ( )
inline

Definition at line 456 of file Dense_Row_inlines.hh.

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

456  {
457  PPL_ASSERT(idx < row->size());
458  ++idx;
459  PPL_ASSERT(OK());
460  return *this;
461 }
dimension_type size() const
Gives the number of coefficients currently in use.
Dense_Row::const_iterator Parma_Polyhedra_Library::Dense_Row::const_iterator::operator++ ( int  )
inline

Definition at line 464 of file Dense_Row_inlines.hh.

464  {
465  const_iterator tmp(*this);
466  ++(*this);
467  return tmp;
468 }
Dense_Row::const_iterator & Parma_Polyhedra_Library::Dense_Row::const_iterator::operator-- ( )
inline

Definition at line 471 of file Dense_Row_inlines.hh.

References Parma_Polyhedra_Library::Dense_Row::OK().

471  {
472  PPL_ASSERT(idx > 0);
473  --idx;
474  PPL_ASSERT(OK());
475  return *this;
476 }
Dense_Row::const_iterator Parma_Polyhedra_Library::Dense_Row::const_iterator::operator-- ( int  )
inline

Definition at line 479 of file Dense_Row_inlines.hh.

479  {
480  const_iterator tmp(*this);
481  --(*this);
482  return tmp;
483 }
bool Parma_Polyhedra_Library::Dense_Row::const_iterator::operator== ( const const_iterator x) const
inline

Definition at line 486 of file Dense_Row_inlines.hh.

References idx, and row.

486  {
487  return (row == x.row) && (idx == x.idx);
488 }

Member Data Documentation

dimension_type Parma_Polyhedra_Library::Dense_Row::const_iterator::idx
private

Definition at line 509 of file Dense_Row_defs.hh.

Referenced by operator==().

const Dense_Row* Parma_Polyhedra_Library::Dense_Row::const_iterator::row
private

Definition at line 508 of file Dense_Row_defs.hh.

Referenced by operator==().


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