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

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

#include <Constraint_System.defs.hh>

Collaboration diagram for Parma_Polyhedra_Library::Constraint_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 Constraintoperator* () const
 Dereference operator.
const Constraintoperator-> () 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 Linear_System::const_iterator &iter, const Constraint_System &csys)
 Constructor.
void skip_forward ()
 *this skips to the next non-trivial constraint.

Private Attributes

Linear_System::const_iterator i
 The const iterator over the matrix of constraints.
const Linear_Systemcsp
 A const pointer to the matrix of constraints.

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();
  for (Constraint_System::const_iterator i = cs.begin(),
         cs_end = cs.end(); i != cs_end; ++i)
    cout << *i << endl;

Definition at line 197 of file Constraint_System.defs.hh.


Constructor & Destructor Documentation

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

Default constructor.

Definition at line 100 of file Constraint_System.inlines.hh.

00101   : i(), csp(0) {
00102 }

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

Ordinary copy-constructor.

Definition at line 105 of file Constraint_System.inlines.hh.

00106   : i(y.i), csp(y.csp) {
00107 }

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

Destructor.

Definition at line 110 of file Constraint_System.inlines.hh.

00110                                                  {
00111 }

Parma_Polyhedra_Library::Constraint_System::const_iterator::const_iterator ( const Linear_System::const_iterator iter,
const Constraint_System csys 
) [inline, private]

Constructor.

Definition at line 156 of file Constraint_System.inlines.hh.

00158   : i(iter), csp(&csys) {
00159 }


Member Function Documentation

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

Assignment operator.

Definition at line 114 of file Constraint_System.inlines.hh.

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

00114                                                                   {
00115   i = y.i;
00116   csp = y.csp;
00117   return *this;
00118 }

const Constraint & Parma_Polyhedra_Library::Constraint_System::const_iterator::operator* (  )  const [inline]

Dereference operator.

Definition at line 121 of file Constraint_System.inlines.hh.

00121                                                  {
00122   return static_cast<const Constraint&>(*i);
00123 }

const Constraint * Parma_Polyhedra_Library::Constraint_System::const_iterator::operator-> (  )  const [inline]

Indirect member selector.

Definition at line 126 of file Constraint_System.inlines.hh.

References i.

00126                                                   {
00127   return static_cast<const Constraint*>(i.operator->());
00128 }

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

Prefix increment operator.

Definition at line 131 of file Constraint_System.inlines.hh.

References i, and skip_forward().

Referenced by operator++().

00131                                             {
00132   ++i;
00133   skip_forward();
00134   return *this;
00135 }

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

Postfix increment operator.

Definition at line 138 of file Constraint_System.inlines.hh.

References operator++().

00138                                                {
00139   const const_iterator tmp = *this;
00140   operator++();
00141   return tmp;
00142 }

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

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

Definition at line 145 of file Constraint_System.inlines.hh.

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

00145                                                                          {
00146   return i == y.i;
00147 }

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

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

Definition at line 150 of file Constraint_System.inlines.hh.

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

00150                                                                          {
00151   return i != y.i;
00152 }

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

*this skips to the next non-trivial constraint.

Definition at line 313 of file Constraint_System.cc.

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

Referenced by operator++().

00313                                                  {
00314   const Linear_System::const_iterator csp_end = csp->end();
00315   while (i != csp_end && (*this)->is_tautological())
00316     ++i;
00317 }


Friends And Related Function Documentation

friend class Constraint_System [friend]

Definition at line 241 of file Constraint_System.defs.hh.


Member Data Documentation

The const iterator over the matrix of constraints.

Definition at line 244 of file Constraint_System.defs.hh.

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

A const pointer to the matrix of constraints.

Definition at line 247 of file Constraint_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