diff options
Diffstat (limited to 'src/Bitmap_cubical_complex/include/gudhi')
-rw-r--r-- | src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex.h | 18 | ||||
-rw-r--r-- | src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_base.h | 18 |
2 files changed, 30 insertions, 6 deletions
diff --git a/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex.h b/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex.h index aa255ec2..29fabc6c 100644 --- a/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex.h +++ b/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex.h @@ -237,14 +237,20 @@ class Bitmap_cubical_complex : public T { * Filtration_simplex_iterator class provides an iterator though the whole structure in the order of filtration. * Secondary criteria for filtration are: * (1) Dimension of a cube (lower dimensional comes first). - * (2) Position in the data structure (the ones that are earlies in the data structure comes first). + * (2) Position in the data structure (the ones that are earliest in the data structure come first). **/ class Filtration_simplex_range; - class Filtration_simplex_iterator : std::iterator<std::input_iterator_tag, Simplex_handle> { + class Filtration_simplex_iterator { // Iterator over all simplices of the complex in the order of the indexing scheme. // 'value_type' must be 'Simplex_handle'. public: + typedef std::input_iterator_tag iterator_category; + typedef Simplex_handle value_type; + typedef std::ptrdiff_t difference_type; + typedef value_type* pointer; + typedef value_type reference; + Filtration_simplex_iterator(Bitmap_cubical_complex* b) : b(b), position(0) {} Filtration_simplex_iterator() : b(NULL), position(0) {} @@ -386,10 +392,16 @@ class Bitmap_cubical_complex : public T { **/ class Skeleton_simplex_range; - class Skeleton_simplex_iterator : std::iterator<std::input_iterator_tag, Simplex_handle> { + class Skeleton_simplex_iterator { // Iterator over all simplices of the complex in the order of the indexing scheme. // 'value_type' must be 'Simplex_handle'. public: + typedef std::input_iterator_tag iterator_category; + typedef Simplex_handle value_type; + typedef std::ptrdiff_t difference_type; + typedef value_type* pointer; + typedef value_type reference; + Skeleton_simplex_iterator(Bitmap_cubical_complex* b, std::size_t d) : b(b), dimension(d) { if (globalDbg) { std::clog << "Skeleton_simplex_iterator ( Bitmap_cubical_complex* b , std::size_t d )\n"; diff --git a/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_base.h b/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_base.h index f8f80ded..2bf62f9b 100644 --- a/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_base.h +++ b/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_base.h @@ -43,7 +43,7 @@ namespace cubical_complex { * Each cell is represented by a single * bit (in case of black and white bitmaps, or by a single element of a type T * (here T is a filtration type of a bitmap, typically a double). - * All the informations needed for homology and + * All the information needed for homology and * persistent homology computations (like dimension of a cell, boundary and * coboundary elements of a cell, are then obtained from the * position of the element in C. @@ -251,8 +251,14 @@ class Bitmap_cubical_complex_base { * @brief Iterator through all cells in the complex (in order they appear in the structure -- i.e. * in lexicographical order). **/ - class All_cells_iterator : std::iterator<std::input_iterator_tag, T> { + class All_cells_iterator { public: + typedef std::input_iterator_tag iterator_category; + typedef std::size_t value_type; + typedef std::ptrdiff_t difference_type; + typedef value_type* pointer; + typedef value_type reference; + All_cells_iterator() { this->counter = 0; } All_cells_iterator operator++() { @@ -355,8 +361,14 @@ class Bitmap_cubical_complex_base { * @brief Iterator through top dimensional cells of the complex. The cells appear in order they are stored * in the structure (i.e. in lexicographical order) **/ - class Top_dimensional_cells_iterator : std::iterator<std::input_iterator_tag, T> { + class Top_dimensional_cells_iterator { public: + typedef std::input_iterator_tag iterator_category; + typedef std::size_t value_type; + typedef std::ptrdiff_t difference_type; + typedef value_type* pointer; + typedef value_type reference; + Top_dimensional_cells_iterator(Bitmap_cubical_complex_base& b) : b(b) { this->counter = std::vector<std::size_t>(b.dimension()); // std::fill( this->counter.begin() , this->counter.end() , 0 ); |