Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Friends

chomp::homology::bincube< Dim, twoPower >::iterator Class Reference

The iterator of the set of cubes within a bitmap. More...

#include <bincube.h>

Inheritance diagram for chomp::homology::bincube< Dim, twoPower >::iterator:
chomp::homology::bincube< Dim, twoPower >::neighborhood_iterator

List of all members.

Public Types

typedef int CoordType
 The type of coordinates.

Public Member Functions

 iterator (bincube< Dim, twoPower > *bcub=0, int num=-1)
 The default constructor.
iteratoroperator++ ()
 The preincrement operator.
iteratoroperator++ (int)
 The postincrement operator.
 operator int () const
 Conversion of an iterator to int (temporarily).
const int * coord () const
 The coordinates of the cube.
template<class intType >
intType * coord (intType *tab) const
 The coordinates of the cube.

Static Public Member Functions

static int dim ()
 The dimension of the cube.

Public Attributes

bincube< Dim, twoPower > * b
 The binary cube in which the cube is contained.
int n
 The number of the current bit in the set.

Static Public Attributes

static const int MaxDim = Dim
 The maximal possible dimension of the cube.

Friends

class bincube< Dim, twoPower >

Detailed Description

template<int Dim, int twoPower>
class chomp::homology::bincube< Dim, twoPower >::iterator

The iterator of the set of cubes within a bitmap.

Definition at line 149 of file bincube.h.


Member Typedef Documentation

template<int Dim, int twoPower>
typedef int chomp::homology::bincube< Dim, twoPower >::iterator::CoordType

The type of coordinates.

Definition at line 154 of file bincube.h.


Constructor & Destructor Documentation

template<int Dim, int twoPower>
chomp::homology::bincube< Dim, twoPower >::iterator::iterator ( bincube< Dim, twoPower > *  bcub = 0,
int  num = -1 
) [inline]

The default constructor.

Definition at line 613 of file bincube.h.

                                              : b (bcub), n (num)
{
        return;
} /* bincube::iterator::iterator */


Member Function Documentation

template<int Dim, int twoPower>
const int * chomp::homology::bincube< Dim, twoPower >::iterator::coord (  )  const [inline]

The coordinates of the cube.

Definition at line 650 of file bincube.h.

Referenced by chomp::homology::bincube< Dim, twoPower >::neighborhood_iterator::operator++().

{
        return 0;
} /* bincube::coord */

template<int Dim, int twoPower>
template<class intType >
intType * chomp::homology::bincube< Dim, twoPower >::iterator::coord ( intType *  tab  )  const [inline]

The coordinates of the cube.

Definition at line 657 of file bincube.h.

References chomp::homology::bincube< Dim, twoPower >::iterator::n, and chomp::homology::bincube< Dim, twoPower >::num2coord().

{
        return bincube<Dim,twoPower>::num2coord (n, tab);
} /* bincube::coord */

template<int Dim, int twoPower>
int chomp::homology::bincube< Dim, twoPower >::iterator::dim (  )  [inline, static]

The dimension of the cube.

Definition at line 644 of file bincube.h.

{
        return Dim;
} /* bincube::iterator::dim */

template<int Dim, int twoPower>
chomp::homology::bincube< Dim, twoPower >::iterator::operator int (  )  const [inline]

Conversion of an iterator to int (temporarily).

Reimplemented in chomp::homology::bincube< Dim, twoPower >::neighborhood_iterator.

Definition at line 638 of file bincube.h.

References chomp::homology::bincube< Dim, twoPower >::iterator::n.

{
        return n;
} /* bincube::iterator::operator int */

template<int Dim, int twoPower>
bincube< Dim, twoPower >::iterator & chomp::homology::bincube< Dim, twoPower >::iterator::operator++ (  )  [inline]

The preincrement operator.

Searches for the next cube in the set.

Reimplemented in chomp::homology::bincube< Dim, twoPower >::neighborhood_iterator.

Definition at line 620 of file bincube.h.

References chomp::homology::bincube< Dim, twoPower >::iterator::b, chomp::homology::bincube< Dim, twoPower >::findcube(), and chomp::homology::bincube< Dim, twoPower >::iterator::n.

{
        if (!b || (n >= bincube<Dim,twoPower>::maxcount))
                return *this;
        n = b -> findcube (n + 1);
        return *this;
} /* bincube::iterator::operator ++ */

template<int Dim, int twoPower>
bincube< Dim, twoPower >::iterator & chomp::homology::bincube< Dim, twoPower >::iterator::operator++ ( int   )  [inline]

The postincrement operator.

Reimplemented in chomp::homology::bincube< Dim, twoPower >::neighborhood_iterator.

Definition at line 630 of file bincube.h.

{
        iterator prev = *this;
        ++ *this;
        return prev;
} /* bincube::iterator::operator ++ */


Friends And Related Function Documentation

template<int Dim, int twoPower>
friend class bincube< Dim, twoPower > [friend]

Definition at line 151 of file bincube.h.


Member Data Documentation

template<int Dim, int twoPower>
bincube<Dim,twoPower>* chomp::homology::bincube< Dim, twoPower >::iterator::b

The binary cube in which the cube is contained.

Reimplemented in chomp::homology::bincube< Dim, twoPower >::neighborhood_iterator.

Definition at line 184 of file bincube.h.

Referenced by chomp::homology::bincube< Dim, twoPower >::iterator::operator++().

template<int Dim, int twoPower>
const int chomp::homology::bincube< Dim, twoPower >::iterator::MaxDim = Dim [static]

The maximal possible dimension of the cube.

Definition at line 170 of file bincube.h.


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