The Original CHomP Software
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Friends | List of all members
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

Public Types

typedef int CoordType
 The type of coordinates. More...
 

Public Member Functions

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

Static Public Member Functions

static int dim ()
 The dimension of the cube. More...
 

Public Attributes

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

Static Public Attributes

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

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 151 of file bincube.h.

Member Typedef Documentation

◆ CoordType

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

The type of coordinates.

Definition at line 156 of file bincube.h.

Constructor & Destructor Documentation

◆ iterator()

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 614 of file bincube.h.

615 : b (bcub), n (num)
616{
617 return;
618} /* bincube::iterator::iterator */
int n
The number of the current bit in the set.
Definition: bincube.h:189
bincube< Dim, twoPower > * b
The binary cube in which the cube is contained.
Definition: bincube.h:186

Member Function Documentation

◆ coord() [1/2]

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

The coordinates of the cube.

Definition at line 652 of file bincube.h.

653{
654 return 0;
655} /* bincube::coord */

◆ coord() [2/2]

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 659 of file bincube.h.

660{
662} /* bincube::coord */
static intType * num2coord(int number, intType *coord)
Determines the coordinates of the cube with given number.
Definition: bincube.h:503

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

◆ dim()

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

The dimension of the cube.

Definition at line 646 of file bincube.h.

647{
648 return Dim;
649} /* bincube::iterator::dim */

◆ operator int()

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

Conversion of an iterator to int (temporarily).

Definition at line 640 of file bincube.h.

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

◆ operator++() [1/2]

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.

Definition at line 622 of file bincube.h.

623{
625 return *this;
626 n = b -> findcube (n + 1);
627 return *this;
628} /* bincube::iterator::operator ++ */
static const int maxcount
The maximal number of cubes that can be stored in the set.
Definition: bincube.h:331
int findcube(int start=0) const
Finds the first existing cube beginning at the given number.
Definition: bincube.h:523

References chomp::homology::bincube< Dim, twoPower >::findcube().

◆ operator++() [2/2]

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

The postincrement operator.

Definition at line 632 of file bincube.h.

633{
634 iterator prev = *this;
635 ++ *this;
636 return prev;
637} /* bincube::iterator::operator ++ */
iterator(bincube< Dim, twoPower > *bcub=0, int num=-1)
The default constructor.
Definition: bincube.h:615

Friends And Related Function Documentation

◆ bincube< Dim, twoPower >

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

Definition at line 353 of file bincube.h.

Member Data Documentation

◆ b

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

The binary cube in which the cube is contained.

Definition at line 186 of file bincube.h.

◆ MaxDim

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 172 of file bincube.h.

◆ n

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

The number of the current bit in the set.

Definition at line 189 of file bincube.h.


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