Parma_Polyhedra_Library::Congruence_System::const_iterator Class Reference
[C++ Language Interface]

An iterator over a system of congruences. More...

#include <Congruence_System.defs.hh>

Collaboration diagram for Parma_Polyhedra_Library::Congruence_System::const_iterator:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 const_iterator ()
 Default constructor.
 const_iterator (const const_iterator &y)
 Ordinary copy-constructor.
 ~const_iterator ()
 Destructor.
const_iteratoroperator= (const const_iterator &y)
 Assignment operator.
const Congruenceoperator* () const
 Dereference operator.
const Congruenceoperator-> () const
 Indirect member selector.
const_iteratoroperator++ ()
 Prefix increment operator.
const_iterator operator++ (int)
 Postfix increment operator.
bool operator== (const const_iterator &y) const
 Returns true if and only if *this and y are identical.
bool operator!= (const const_iterator &y) const
 Returns true if and only if *this and y are different.

Private Member Functions

 const_iterator (const Matrix::const_iterator &iter, const Congruence_System &cgs)
 Constructor.
void skip_forward ()
 *this skips to the next non-trivial congruence.

Private Attributes

Matrix::const_iterator i
 The const iterator over the matrix of congruences.
const Matrixcsp
 A const pointer to the matrix of congruences.

Friends

class Congruence_System


Detailed Description

An iterator over a system of congruences.

A const_iterator is used to provide read-only access to each congruence contained in an object of Congruence_System.

Example
The following code prints the system of congruences defining the grid gr:
  const Congruence_System& cgs = gr.congruences();
  for (Congruence_System::const_iterator i = cgs.begin(),
         cgs_end = cgs.end(); i != cgs_end; ++i)
    cout << *i << endl;

Definition at line 233 of file Congruence_System.defs.hh.


Constructor & Destructor Documentation

Parma_Polyhedra_Library::Congruence_System::const_iterator::const_iterator (  )  [inline]

Default constructor.

Definition at line 113 of file Congruence_System.inlines.hh.

00114   : i(), csp(0) {
00115 }

Parma_Polyhedra_Library::Congruence_System::const_iterator::const_iterator ( const const_iterator y  )  [inline]

Ordinary copy-constructor.

Definition at line 118 of file Congruence_System.inlines.hh.

00119   : i(y.i), csp(y.csp) {
00120 }

Parma_Polyhedra_Library::Congruence_System::const_iterator::~const_iterator (  )  [inline]

Destructor.

Definition at line 123 of file Congruence_System.inlines.hh.

00123                                                  {
00124 }

Parma_Polyhedra_Library::Congruence_System::const_iterator::const_iterator ( const Matrix::const_iterator iter,
const Congruence_System cgs 
) [inline, private]

Constructor.

Definition at line 169 of file Congruence_System.inlines.hh.

00171   : i(iter), csp(&csys) {
00172 }


Member Function Documentation

Congruence_System::const_iterator & Parma_Polyhedra_Library::Congruence_System::const_iterator::operator= ( const const_iterator y  )  [inline]

Assignment operator.

Definition at line 127 of file Congruence_System.inlines.hh.

References csp, Parma_Polyhedra_Library::Matrix::const_iterator::i, and i.

00127                                                                   {
00128   i = y.i;
00129   csp = y.csp;
00130   return *this;
00131 }

const Congruence & Parma_Polyhedra_Library::Congruence_System::const_iterator::operator* (  )  const [inline]

Dereference operator.

Definition at line 134 of file Congruence_System.inlines.hh.

00134                                                  {
00135   return static_cast<const Congruence&>(*i);
00136 }

const Congruence * Parma_Polyhedra_Library::Congruence_System::const_iterator::operator-> (  )  const [inline]

Indirect member selector.

Definition at line 139 of file Congruence_System.inlines.hh.

References i.

00139                                                   {
00140   return static_cast<const Congruence*>(i.operator->());
00141 }

Congruence_System::const_iterator & Parma_Polyhedra_Library::Congruence_System::const_iterator::operator++ (  )  [inline]

Prefix increment operator.

Definition at line 144 of file Congruence_System.inlines.hh.

References i, and skip_forward().

Referenced by operator++().

00144                                             {
00145   ++i;
00146   skip_forward();
00147   return *this;
00148 }

Congruence_System::const_iterator Parma_Polyhedra_Library::Congruence_System::const_iterator::operator++ ( int   )  [inline]

Postfix increment operator.

Definition at line 151 of file Congruence_System.inlines.hh.

References operator++().

00151                                                {
00152   const const_iterator tmp = *this;
00153   operator++();
00154   return tmp;
00155 }

bool Parma_Polyhedra_Library::Congruence_System::const_iterator::operator== ( const const_iterator y  )  const [inline]

Returns true if and only if *this and y are identical.

Definition at line 158 of file Congruence_System.inlines.hh.

References Parma_Polyhedra_Library::Matrix::const_iterator::i, and i.

00158                                                                          {
00159   return i == y.i;
00160 }

bool Parma_Polyhedra_Library::Congruence_System::const_iterator::operator!= ( const const_iterator y  )  const [inline]

Returns true if and only if *this and y are different.

Definition at line 163 of file Congruence_System.inlines.hh.

References Parma_Polyhedra_Library::Matrix::const_iterator::i, and i.

00163                                                                          {
00164   return i != y.i;
00165 }

void Parma_Polyhedra_Library::Congruence_System::const_iterator::skip_forward (  )  [private]

*this skips to the next non-trivial congruence.

Definition at line 247 of file Congruence_System.cc.

References csp, Parma_Polyhedra_Library::Matrix::end(), and i.

Referenced by operator++().

00247                                                  {
00248   const Matrix::const_iterator csp_end = csp->end();
00249   while (i != csp_end && (*this)->is_tautological())
00250     ++i;
00251 }


Friends And Related Function Documentation

friend class Congruence_System [friend]

Definition at line 277 of file Congruence_System.defs.hh.


Member Data Documentation

The const iterator over the matrix of congruences.

Definition at line 280 of file Congruence_System.defs.hh.

Referenced by operator!=(), operator++(), operator->(), operator=(), operator==(), and skip_forward().

A const pointer to the matrix of congruences.

Definition at line 283 of file Congruence_System.defs.hh.

Referenced by operator=(), and skip_forward().


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

Generated on Sat Oct 11 10:41:08 2008 for PPL by  doxygen 1.5.6