PPL  1.2
Parma_Polyhedra_Library::Constraint_System_const_iterator Class Reference

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

#include <Constraint_System_defs.hh>

Inheritance diagram for Parma_Polyhedra_Library::Constraint_System_const_iterator:
Collaboration diagram for Parma_Polyhedra_Library::Constraint_System_const_iterator:

Public Member Functions

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

Private Member Functions

 Constraint_System_const_iterator (const Linear_System< Constraint >::const_iterator &iter, const Constraint_System &cs)
 Constructor. More...
 
void skip_forward ()
 *this skips to the next non-trivial constraint. More...
 

Private Attributes

Linear_System< Constraint >::const_iterator i
 The const iterator over the matrix of constraints. More...
 
const Linear_System< Constraint > * csp
 A const pointer to the matrix of constraints. More...
 

Friends

class Constraint_System
 

Detailed Description

An iterator over a system of constraints.

A const_iterator is used to provide read-only access to each constraint contained in a Constraint_System object.

Example
The following code prints the system of constraints defining the polyhedron ph:
const Constraint_System& cs = ph.constraints();
cs_end = cs.end(); i != cs_end; ++i)
cout << *i << endl;

Definition at line 610 of file Constraint_System_defs.hh.

Constructor & Destructor Documentation

Parma_Polyhedra_Library::Constraint_System_const_iterator::Constraint_System_const_iterator ( )
inline

Default constructor.

Definition at line 118 of file Constraint_System_inlines.hh.

119  : i(), csp(0) {
120 }
Linear_System< Constraint >::const_iterator i
The const iterator over the matrix of constraints.
const Linear_System< Constraint > * csp
A const pointer to the matrix of constraints.
Parma_Polyhedra_Library::Constraint_System_const_iterator::Constraint_System_const_iterator ( const Constraint_System_const_iterator y)
inline

Ordinary copy constructor.

Definition at line 123 of file Constraint_System_inlines.hh.

124  : i(y.i), csp(y.csp) {
125 }
Linear_System< Constraint >::const_iterator i
The const iterator over the matrix of constraints.
const Linear_System< Constraint > * csp
A const pointer to the matrix of constraints.
Parma_Polyhedra_Library::Constraint_System_const_iterator::~Constraint_System_const_iterator ( )
inline

Destructor.

Definition at line 128 of file Constraint_System_inlines.hh.

128  {
129 }
Parma_Polyhedra_Library::Constraint_System_const_iterator::Constraint_System_const_iterator ( const Linear_System< Constraint >::const_iterator &  iter,
const Constraint_System cs 
)
inlineprivate

Constructor.

Definition at line 174 of file Constraint_System_inlines.hh.

176  : i(iter), csp(&cs.sys) {
177 }
Linear_System< Constraint >::const_iterator i
The const iterator over the matrix of constraints.
const Linear_System< Constraint > * csp
A const pointer to the matrix of constraints.

Member Function Documentation

bool Parma_Polyhedra_Library::Constraint_System_const_iterator::operator!= ( const Constraint_System_const_iterator y) const
inline

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

Definition at line 168 of file Constraint_System_inlines.hh.

References i.

168  {
169  return i != y.i;
170 }
Linear_System< Constraint >::const_iterator i
The const iterator over the matrix of constraints.
const Constraint & Parma_Polyhedra_Library::Constraint_System_const_iterator::operator* ( ) const
inline

Dereference operator.

Definition at line 139 of file Constraint_System_inlines.hh.

References i.

139  {
140  return *i;
141 }
Linear_System< Constraint >::const_iterator i
The const iterator over the matrix of constraints.
Constraint_System_const_iterator & Parma_Polyhedra_Library::Constraint_System_const_iterator::operator++ ( )
inline

Prefix increment operator.

Definition at line 149 of file Constraint_System_inlines.hh.

References i, and skip_forward().

Referenced by operator++().

149  {
150  ++i;
151  skip_forward();
152  return *this;
153 }
Linear_System< Constraint >::const_iterator i
The const iterator over the matrix of constraints.
void skip_forward()
*this skips to the next non-trivial constraint.
Constraint_System_const_iterator Parma_Polyhedra_Library::Constraint_System_const_iterator::operator++ ( int  )
inline

Postfix increment operator.

Definition at line 156 of file Constraint_System_inlines.hh.

References operator++().

156  {
157  const Constraint_System_const_iterator tmp = *this;
158  operator++();
159  return tmp;
160 }
Constraint_System_const_iterator & operator++()
Prefix increment operator.
const Constraint * Parma_Polyhedra_Library::Constraint_System_const_iterator::operator-> ( ) const
inline

Indirect member selector.

Definition at line 144 of file Constraint_System_inlines.hh.

References i.

144  {
145  return i.operator->();
146 }
Linear_System< Constraint >::const_iterator i
The const iterator over the matrix of constraints.
Constraint_System_const_iterator & Parma_Polyhedra_Library::Constraint_System_const_iterator::operator= ( const Constraint_System_const_iterator y)
inline

Assignment operator.

Definition at line 132 of file Constraint_System_inlines.hh.

References csp, and i.

132  {
133  i = y.i;
134  csp = y.csp;
135  return *this;
136 }
Linear_System< Constraint >::const_iterator i
The const iterator over the matrix of constraints.
const Linear_System< Constraint > * csp
A const pointer to the matrix of constraints.
bool Parma_Polyhedra_Library::Constraint_System_const_iterator::operator== ( const Constraint_System_const_iterator y) const
inline

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

Definition at line 163 of file Constraint_System_inlines.hh.

References i.

163  {
164  return i == y.i;
165 }
Linear_System< Constraint >::const_iterator i
The const iterator over the matrix of constraints.
void Parma_Polyhedra_Library::Constraint_System_const_iterator::skip_forward ( )
private

*this skips to the next non-trivial constraint.

Definition at line 212 of file Constraint_System.cc.

Referenced by Parma_Polyhedra_Library::Constraint_System::begin(), and operator++().

212  {
213  const Linear_System<Constraint>::const_iterator csp_end = csp->end();
214  while (i != csp_end && (*this)->is_tautological()) {
215  ++i;
216  }
217 }
Linear_System< Constraint >::const_iterator i
The const iterator over the matrix of constraints.
const Linear_System< Constraint > * csp
A const pointer to the matrix of constraints.

Friends And Related Function Documentation

friend class Constraint_System
friend

Definition at line 655 of file Constraint_System_defs.hh.

Member Data Documentation

const Linear_System<Constraint>* Parma_Polyhedra_Library::Constraint_System_const_iterator::csp
private

A const pointer to the matrix of constraints.

Definition at line 661 of file Constraint_System_defs.hh.

Referenced by operator=().

Linear_System<Constraint>::const_iterator Parma_Polyhedra_Library::Constraint_System_const_iterator::i
private

The const iterator over the matrix of constraints.

Definition at line 658 of file Constraint_System_defs.hh.

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


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