PPL  1.2
Parma_Polyhedra_Library::Congruence_System::const_iterator Class Reference

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

#include <Congruence_System_defs.hh>

Inheritance diagram for Parma_Polyhedra_Library::Congruence_System::const_iterator:
Collaboration diagram for Parma_Polyhedra_Library::Congruence_System::const_iterator:

Public Member Functions

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

Private Member Functions

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

Private Attributes

Swapping_Vector< Congruence >::const_iterator i
 The const iterator over the vector of congruences. More...
 
const Swapping_Vector< Congruence > * csp
 A const pointer to the vector of congruences. More...
 

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 250 of file Congruence_System_defs.hh.

Constructor & Destructor Documentation

Parma_Polyhedra_Library::Congruence_System::const_iterator::const_iterator ( )
inline

Default constructor.

Definition at line 168 of file Congruence_System_inlines.hh.

169  : i(), csp(0) {
170 }
const Swapping_Vector< Congruence > * csp
A const pointer to the vector of congruences.
Swapping_Vector< Congruence >::const_iterator i
The const iterator over the vector of congruences.
Parma_Polyhedra_Library::Congruence_System::const_iterator::const_iterator ( const const_iterator y)
inline

Ordinary copy constructor.

Definition at line 173 of file Congruence_System_inlines.hh.

174  : i(y.i), csp(y.csp) {
175 }
const Swapping_Vector< Congruence > * csp
A const pointer to the vector of congruences.
Swapping_Vector< Congruence >::const_iterator i
The const iterator over the vector of congruences.
Parma_Polyhedra_Library::Congruence_System::const_iterator::~const_iterator ( )
inline

Destructor.

Definition at line 178 of file Congruence_System_inlines.hh.

178  {
179 }
Parma_Polyhedra_Library::Congruence_System::const_iterator::const_iterator ( const Swapping_Vector< Congruence >::const_iterator iter,
const Congruence_System cgs 
)
inlineprivate

Constructor.

Definition at line 224 of file Congruence_System_inlines.hh.

226  : i(iter), csp(&cgs.rows) {
227 }
const Swapping_Vector< Congruence > * csp
A const pointer to the vector of congruences.
Swapping_Vector< Congruence >::const_iterator i
The const iterator over the vector of congruences.

Member Function Documentation

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 218 of file Congruence_System_inlines.hh.

References i.

218  {
219  return i != y.i;
220 }
Swapping_Vector< Congruence >::const_iterator i
The const iterator over the vector of congruences.
const Congruence & Parma_Polyhedra_Library::Congruence_System::const_iterator::operator* ( ) const
inline

Dereference operator.

Definition at line 189 of file Congruence_System_inlines.hh.

189  {
190  return *i;
191 }
Swapping_Vector< Congruence >::const_iterator i
The const iterator over the vector of congruences.
Congruence_System::const_iterator & Parma_Polyhedra_Library::Congruence_System::const_iterator::operator++ ( )
inline

Prefix increment operator.

Definition at line 199 of file Congruence_System_inlines.hh.

199  {
200  ++i;
201  skip_forward();
202  return *this;
203 }
Swapping_Vector< Congruence >::const_iterator i
The const iterator over the vector of congruences.
void skip_forward()
*this skips to the next non-trivial congruence.
Congruence_System::const_iterator Parma_Polyhedra_Library::Congruence_System::const_iterator::operator++ ( int  )
inline

Postfix increment operator.

Definition at line 206 of file Congruence_System_inlines.hh.

206  {
207  const const_iterator tmp = *this;
208  operator++();
209  return tmp;
210 }
const_iterator & operator++()
Prefix increment operator.
const Congruence * Parma_Polyhedra_Library::Congruence_System::const_iterator::operator-> ( ) const
inline

Indirect member selector.

Definition at line 194 of file Congruence_System_inlines.hh.

194  {
195  return i.operator->();
196 }
Swapping_Vector< Congruence >::const_iterator i
The const iterator over the vector of congruences.
Congruence_System::const_iterator & Parma_Polyhedra_Library::Congruence_System::const_iterator::operator= ( const const_iterator y)
inline

Assignment operator.

Definition at line 182 of file Congruence_System_inlines.hh.

References csp, and i.

182  {
183  i = y.i;
184  csp = y.csp;
185  return *this;
186 }
const Swapping_Vector< Congruence > * csp
A const pointer to the vector of congruences.
Swapping_Vector< Congruence >::const_iterator i
The const iterator over the vector of congruences.
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 213 of file Congruence_System_inlines.hh.

References i.

213  {
214  return i == y.i;
215 }
Swapping_Vector< Congruence >::const_iterator i
The const iterator over the vector of congruences.
void Parma_Polyhedra_Library::Congruence_System::const_iterator::skip_forward ( )
private

*this skips to the next non-trivial congruence.

Definition at line 243 of file Congruence_System.cc.

References Parma_Polyhedra_Library::Congruence_System::end().

Referenced by Parma_Polyhedra_Library::Congruence_System::begin().

243  {
244  const Swapping_Vector<Congruence>::const_iterator csp_end = csp->end();
245  while (i != csp_end && (*this)->is_tautological()) {
246  ++i;
247  }
248 }
const Swapping_Vector< Congruence > * csp
A const pointer to the vector of congruences.
bool is_tautological() const
Returns true if and only if *this is a tautology (i.e., an always true congruence).
Definition: Congruence.cc:210
Swapping_Vector< Congruence >::const_iterator i
The const iterator over the vector of congruences.

Friends And Related Function Documentation

friend class Congruence_System
friend

Definition at line 294 of file Congruence_System_defs.hh.

Member Data Documentation

const Swapping_Vector<Congruence>* Parma_Polyhedra_Library::Congruence_System::const_iterator::csp
private

A const pointer to the vector of congruences.

Definition at line 300 of file Congruence_System_defs.hh.

Referenced by operator=().

Swapping_Vector<Congruence>::const_iterator Parma_Polyhedra_Library::Congruence_System::const_iterator::i
private

The const iterator over the vector of congruences.

Definition at line 297 of file Congruence_System_defs.hh.

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


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