diff options
author | MathieuCarriere <mathieu.carriere3@gmail.com> | 2020-04-28 10:31:12 -0400 |
---|---|---|
committer | MathieuCarriere <mathieu.carriere3@gmail.com> | 2020-04-28 10:31:12 -0400 |
commit | 51ca2370ae27bec052bb4fffafc8a718ac306264 (patch) | |
tree | 67e1ea14d4c290295b0298dba0d701303a53f3b6 /src/Bitmap_cubical_complex/include/gudhi | |
parent | 910f29401e053f668e4d277af098295ab05e6022 (diff) | |
parent | 0fb22e4c499b665ad505e5d9d2c325f7561f69c4 (diff) |
fix conflict
Diffstat (limited to 'src/Bitmap_cubical_complex/include/gudhi')
3 files changed, 53 insertions, 56 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 37514dee..aa255ec2 100644 --- a/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex.h +++ b/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex.h @@ -69,7 +69,7 @@ class Bitmap_cubical_complex : public T { Bitmap_cubical_complex(const char* perseus_style_file) : T(perseus_style_file), key_associated_to_simplex(this->total_number_of_cells + 1) { if (globalDbg) { - std::cerr << "Bitmap_cubical_complex( const char* perseus_style_file )\n"; + std::clog << "Bitmap_cubical_complex( const char* perseus_style_file )\n"; } for (std::size_t i = 0; i != this->total_number_of_cells; ++i) { this->key_associated_to_simplex[i] = i; @@ -137,7 +137,7 @@ class Bitmap_cubical_complex : public T { **/ static Simplex_handle null_simplex() { if (globalDbg) { - std::cerr << "Simplex_handle null_simplex()\n"; + std::clog << "Simplex_handle null_simplex()\n"; } return std::numeric_limits<Simplex_handle>::max(); } @@ -152,7 +152,7 @@ class Bitmap_cubical_complex : public T { **/ inline unsigned dimension(Simplex_handle sh) const { if (globalDbg) { - std::cerr << "unsigned dimension(const Simplex_handle& sh)\n"; + std::clog << "unsigned dimension(const Simplex_handle& sh)\n"; } if (sh != null_simplex()) return this->get_dimension_of_a_cell(sh); return -1; @@ -163,7 +163,7 @@ class Bitmap_cubical_complex : public T { **/ Filtration_value filtration(Simplex_handle sh) { if (globalDbg) { - std::cerr << "Filtration_value filtration(const Simplex_handle& sh)\n"; + std::clog << "Filtration_value filtration(const Simplex_handle& sh)\n"; } // Returns the filtration value of a simplex. if (sh != null_simplex()) return this->data[sh]; @@ -175,7 +175,7 @@ class Bitmap_cubical_complex : public T { **/ static Simplex_key null_key() { if (globalDbg) { - std::cerr << "Simplex_key null_key()\n"; + std::clog << "Simplex_key null_key()\n"; } return std::numeric_limits<Simplex_handle>::max(); } @@ -185,7 +185,7 @@ class Bitmap_cubical_complex : public T { **/ Simplex_key key(Simplex_handle sh) const { if (globalDbg) { - std::cerr << "Simplex_key key(const Simplex_handle& sh)\n"; + std::clog << "Simplex_key key(const Simplex_handle& sh)\n"; } if (sh != null_simplex()) { return this->key_associated_to_simplex[sh]; @@ -198,7 +198,7 @@ class Bitmap_cubical_complex : public T { **/ Simplex_handle simplex(Simplex_key key) { if (globalDbg) { - std::cerr << "Simplex_handle simplex(Simplex_key key)\n"; + std::clog << "Simplex_handle simplex(Simplex_key key)\n"; } if (key != null_key()) { return this->simplex_associated_to_key[key]; @@ -211,7 +211,7 @@ class Bitmap_cubical_complex : public T { **/ void assign_key(Simplex_handle sh, Simplex_key key) { if (globalDbg) { - std::cerr << "void assign_key(Simplex_handle& sh, Simplex_key key)\n"; + std::clog << "void assign_key(Simplex_handle& sh, Simplex_key key)\n"; } if (key == null_key()) return; this->key_associated_to_simplex[sh] = key; @@ -251,7 +251,7 @@ class Bitmap_cubical_complex : public T { Filtration_simplex_iterator operator++() { if (globalDbg) { - std::cerr << "Filtration_simplex_iterator operator++\n"; + std::clog << "Filtration_simplex_iterator operator++\n"; } ++this->position; return (*this); @@ -265,7 +265,7 @@ class Bitmap_cubical_complex : public T { Filtration_simplex_iterator& operator=(const Filtration_simplex_iterator& rhs) { if (globalDbg) { - std::cerr << "Filtration_simplex_iterator operator =\n"; + std::clog << "Filtration_simplex_iterator operator =\n"; } this->b = rhs.b; this->position = rhs.position; @@ -274,21 +274,21 @@ class Bitmap_cubical_complex : public T { bool operator==(const Filtration_simplex_iterator& rhs) const { if (globalDbg) { - std::cerr << "bool operator == ( const Filtration_simplex_iterator& rhs )\n"; + std::clog << "bool operator == ( const Filtration_simplex_iterator& rhs )\n"; } return (this->position == rhs.position); } bool operator!=(const Filtration_simplex_iterator& rhs) const { if (globalDbg) { - std::cerr << "bool operator != ( const Filtration_simplex_iterator& rhs )\n"; + std::clog << "bool operator != ( const Filtration_simplex_iterator& rhs )\n"; } return !(*this == rhs); } Simplex_handle operator*() { if (globalDbg) { - std::cerr << "Simplex_handle operator*()\n"; + std::clog << "Simplex_handle operator*()\n"; } return this->b->simplex_associated_to_key[this->position]; } @@ -314,14 +314,14 @@ class Bitmap_cubical_complex : public T { Filtration_simplex_iterator begin() { if (globalDbg) { - std::cerr << "Filtration_simplex_iterator begin() \n"; + std::clog << "Filtration_simplex_iterator begin() \n"; } return Filtration_simplex_iterator(this->b); } Filtration_simplex_iterator end() { if (globalDbg) { - std::cerr << "Filtration_simplex_iterator end()\n"; + std::clog << "Filtration_simplex_iterator end()\n"; } Filtration_simplex_iterator it(this->b); it.position = this->b->simplex_associated_to_key.size(); @@ -347,7 +347,7 @@ class Bitmap_cubical_complex : public T { **/ Filtration_simplex_range filtration_simplex_range() { if (globalDbg) { - std::cerr << "Filtration_simplex_range filtration_simplex_range()\n"; + std::clog << "Filtration_simplex_range filtration_simplex_range()\n"; } // Returns a range over the simplices of the complex in the order of the filtration return Filtration_simplex_range(this); @@ -370,8 +370,8 @@ class Bitmap_cubical_complex : public T { std::pair<Simplex_handle, Simplex_handle> endpoints(Simplex_handle sh) { std::vector<std::size_t> bdry = this->get_boundary_of_a_cell(sh); if (globalDbg) { - std::cerr << "std::pair<Simplex_handle, Simplex_handle> endpoints( Simplex_handle sh )\n"; - std::cerr << "bdry.size() : " << bdry.size() << "\n"; + std::clog << "std::pair<Simplex_handle, Simplex_handle> endpoints( Simplex_handle sh )\n"; + std::clog << "bdry.size() : " << bdry.size() << "\n"; } // this method returns two first elements from the boundary of sh. if (bdry.size() < 2) @@ -392,7 +392,7 @@ class Bitmap_cubical_complex : public T { public: Skeleton_simplex_iterator(Bitmap_cubical_complex* b, std::size_t d) : b(b), dimension(d) { if (globalDbg) { - std::cerr << "Skeleton_simplex_iterator ( Bitmap_cubical_complex* b , std::size_t d )\n"; + std::clog << "Skeleton_simplex_iterator ( Bitmap_cubical_complex* b , std::size_t d )\n"; } // find the position of the first simplex of a dimension d this->position = 0; @@ -406,7 +406,7 @@ class Bitmap_cubical_complex : public T { Skeleton_simplex_iterator operator++() { if (globalDbg) { - std::cerr << "Skeleton_simplex_iterator operator++()\n"; + std::clog << "Skeleton_simplex_iterator operator++()\n"; } // increment the position as long as you did not get to the next element of the dimension dimension. ++this->position; @@ -425,7 +425,7 @@ class Bitmap_cubical_complex : public T { Skeleton_simplex_iterator& operator=(const Skeleton_simplex_iterator& rhs) { if (globalDbg) { - std::cerr << "Skeleton_simplex_iterator operator =\n"; + std::clog << "Skeleton_simplex_iterator operator =\n"; } this->b = rhs.b; this->position = rhs.position; @@ -435,21 +435,21 @@ class Bitmap_cubical_complex : public T { bool operator==(const Skeleton_simplex_iterator& rhs) const { if (globalDbg) { - std::cerr << "bool operator ==\n"; + std::clog << "bool operator ==\n"; } return (this->position == rhs.position); } bool operator!=(const Skeleton_simplex_iterator& rhs) const { if (globalDbg) { - std::cerr << "bool operator != ( const Skeleton_simplex_iterator& rhs )\n"; + std::clog << "bool operator != ( const Skeleton_simplex_iterator& rhs )\n"; } return !(*this == rhs); } Simplex_handle operator*() { if (globalDbg) { - std::cerr << "Simplex_handle operator*() \n"; + std::clog << "Simplex_handle operator*() \n"; } return this->position; } @@ -476,14 +476,14 @@ class Bitmap_cubical_complex : public T { Skeleton_simplex_iterator begin() { if (globalDbg) { - std::cerr << "Skeleton_simplex_iterator begin()\n"; + std::clog << "Skeleton_simplex_iterator begin()\n"; } return Skeleton_simplex_iterator(this->b, this->dimension); } Skeleton_simplex_iterator end() { if (globalDbg) { - std::cerr << "Skeleton_simplex_iterator end()\n"; + std::clog << "Skeleton_simplex_iterator end()\n"; } Skeleton_simplex_iterator it(this->b, this->dimension); it.position = this->b->data.size(); @@ -500,7 +500,7 @@ class Bitmap_cubical_complex : public T { **/ Skeleton_simplex_range skeleton_simplex_range(unsigned dimension) { if (globalDbg) { - std::cerr << "Skeleton_simplex_range skeleton_simplex_range( unsigned dimension )\n"; + std::clog << "Skeleton_simplex_range skeleton_simplex_range( unsigned dimension )\n"; } return Skeleton_simplex_range(this, dimension); } @@ -515,7 +515,7 @@ class Bitmap_cubical_complex : public T { template <typename T> void Bitmap_cubical_complex<T>::initialize_simplex_associated_to_key() { if (globalDbg) { - std::cerr << "void Bitmap_cubical_complex<T>::initialize_elements_ordered_according_to_filtration() \n"; + std::clog << "void Bitmap_cubical_complex<T>::initialize_elements_ordered_according_to_filtration() \n"; } this->simplex_associated_to_key = std::vector<std::size_t>(this->data.size()); std::iota(std::begin(simplex_associated_to_key), std::end(simplex_associated_to_key), 0); 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 0d6299d2..1eb77c9c 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 @@ -142,7 +142,7 @@ class Bitmap_cubical_complex_base { } if (coface_counter[i] != face_counter[i]) { if (number_of_position_in_which_counters_do_not_agree != -1) { - std::cout << "Cells given to compute_incidence_between_cells procedure do not form a pair of coface-face.\n"; + std::cerr << "Cells given to compute_incidence_between_cells procedure do not form a pair of coface-face.\n"; throw std::logic_error( "Cells given to compute_incidence_between_cells procedure do not form a pair of coface-face."); } @@ -408,7 +408,7 @@ class Bitmap_cubical_complex_base { void print_counter() const { for (std::size_t i = 0; i != this->counter.size(); ++i) { - std::cout << this->counter[i] << " "; + std::clog << this->counter[i] << " "; } } friend class Bitmap_cubical_complex_base; @@ -521,11 +521,11 @@ void Bitmap_cubical_complex_base<T>::put_data_to_bins(std::size_t number_of_bins // now put the data into the appropriate bins: for (std::size_t i = 0; i != this->data.size(); ++i) { if (dbg) { - std::cerr << "Before binning : " << this->data[i] << std::endl; + std::clog << "Before binning : " << this->data[i] << std::endl; } this->data[i] = min_max.first + dx * (this->data[i] - min_max.first) / number_of_bins; if (dbg) { - std::cerr << "After binning : " << this->data[i] << std::endl; + std::clog << "After binning : " << this->data[i] << std::endl; } } } @@ -539,11 +539,11 @@ void Bitmap_cubical_complex_base<T>::put_data_to_bins(T diameter_of_bin) { // now put the data into the appropriate bins: for (std::size_t i = 0; i != this->data.size(); ++i) { if (dbg) { - std::cerr << "Before binning : " << this->data[i] << std::endl; + std::clog << "Before binning : " << this->data[i] << std::endl; } this->data[i] = min_max.first + diameter_of_bin * (this->data[i] - min_max.first) / number_of_bins; if (dbg) { - std::cerr << "After binning : " << this->data[i] << std::endl; + std::clog << "After binning : " << this->data[i] << std::endl; } } } @@ -617,7 +617,7 @@ void Bitmap_cubical_complex_base<T>::read_perseus_style_file(const char* perseus inFiltration >> dimensionOfData; if (dbg) { - std::cerr << "dimensionOfData : " << dimensionOfData << std::endl; + std::clog << "dimensionOfData : " << dimensionOfData << std::endl; } std::vector<unsigned> sizes; @@ -630,7 +630,7 @@ void Bitmap_cubical_complex_base<T>::read_perseus_style_file(const char* perseus sizes.push_back(size_in_this_dimension); dimensions *= size_in_this_dimension; if (dbg) { - std::cerr << "size_in_this_dimension : " << size_in_this_dimension << std::endl; + std::clog << "size_in_this_dimension : " << size_in_this_dimension << std::endl; } } this->set_up_containers(sizes); @@ -651,7 +651,7 @@ void Bitmap_cubical_complex_base<T>::read_perseus_style_file(const char* perseus } if (dbg) { - std::cerr << "Cell of an index : " << it.compute_index_in_bitmap() + std::clog << "Cell of an index : " << it.compute_index_in_bitmap() << " and dimension: " << this->get_dimension_of_a_cell(it.compute_index_in_bitmap()) << " get the value : " << filtrationLevel << std::endl; } @@ -754,20 +754,20 @@ std::vector<std::size_t> Bitmap_cubical_complex_base<T>::get_coboundary_of_a_cel template <typename T> unsigned Bitmap_cubical_complex_base<T>::get_dimension_of_a_cell(std::size_t cell) const { bool dbg = false; - if (dbg) std::cerr << "\n\n\n Computing position o a cell of an index : " << cell << std::endl; + if (dbg) std::clog << "\n\n\n Computing position o a cell of an index : " << cell << std::endl; unsigned dimension = 0; for (std::size_t i = this->multipliers.size(); i != 0; --i) { unsigned position = cell / this->multipliers[i - 1]; if (dbg) { - std::cerr << "i-1 :" << i - 1 << std::endl; - std::cerr << "cell : " << cell << std::endl; - std::cerr << "position : " << position << std::endl; - std::cerr << "multipliers[" << i - 1 << "] = " << this->multipliers[i - 1] << std::endl; + std::clog << "i-1 :" << i - 1 << std::endl; + std::clog << "cell : " << cell << std::endl; + std::clog << "position : " << position << std::endl; + std::clog << "multipliers[" << i - 1 << "] = " << this->multipliers[i - 1] << std::endl; } if (position % 2 == 1) { - if (dbg) std::cerr << "Nonzero length in this direction \n"; + if (dbg) std::clog << "Nonzero length in this direction \n"; dimension++; } cell = cell % this->multipliers[i - 1]; @@ -803,9 +803,9 @@ void Bitmap_cubical_complex_base<T>::impose_lower_star_filtration() { while (indices_to_consider.size()) { if (dbg) { - std::cerr << "indices_to_consider in this iteration \n"; + std::clog << "indices_to_consider in this iteration \n"; for (std::size_t i = 0; i != indices_to_consider.size(); ++i) { - std::cout << indices_to_consider[i] << " "; + std::clog << indices_to_consider[i] << " "; } } std::vector<std::size_t> new_indices_to_consider; @@ -813,14 +813,14 @@ void Bitmap_cubical_complex_base<T>::impose_lower_star_filtration() { std::vector<std::size_t> bd = this->get_boundary_of_a_cell(indices_to_consider[i]); for (std::size_t boundaryIt = 0; boundaryIt != bd.size(); ++boundaryIt) { if (dbg) { - std::cerr << "filtration of a cell : " << bd[boundaryIt] << " is : " << this->data[bd[boundaryIt]] + std::clog << "filtration of a cell : " << bd[boundaryIt] << " is : " << this->data[bd[boundaryIt]] << " while of a cell: " << indices_to_consider[i] << " is: " << this->data[indices_to_consider[i]] << std::endl; } if (this->data[bd[boundaryIt]] > this->data[indices_to_consider[i]]) { this->data[bd[boundaryIt]] = this->data[indices_to_consider[i]]; if (dbg) { - std::cerr << "Setting the value of a cell : " << bd[boundaryIt] + std::clog << "Setting the value of a cell : " << bd[boundaryIt] << " to : " << this->data[indices_to_consider[i]] << std::endl; } } diff --git a/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_periodic_boundary_conditions_base.h b/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_periodic_boundary_conditions_base.h index edd794fe..18901469 100644 --- a/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_periodic_boundary_conditions_base.h +++ b/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_periodic_boundary_conditions_base.h @@ -128,7 +128,7 @@ class Bitmap_cubical_complex_periodic_boundary_conditions_base : public Bitmap_c } if (coface_counter[i] != face_counter[i]) { if (number_of_position_in_which_counters_do_not_agree != -1) { - std::cout << "Cells given to compute_incidence_between_cells procedure do not form a pair of coface-face.\n"; + std::cerr << "Cells given to compute_incidence_between_cells procedure do not form a pair of coface-face.\n"; throw std::logic_error( "Cells given to compute_incidence_between_cells procedure do not form a pair of coface-face."); } @@ -237,7 +237,7 @@ Bitmap_cubical_complex_periodic_boundary_conditions_base<T>::Bitmap_cubical_comp if (inFiltration.eof()) break; if (dbg) { - std::cerr << "Cell of an index : " << it.compute_index_in_bitmap() + std::clog << "Cell of an index : " << it.compute_index_in_bitmap() << " and dimension: " << this->get_dimension_of_a_cell(it.compute_index_in_bitmap()) << " get the value : " << filtrationLevel << std::endl; } @@ -278,7 +278,7 @@ std::vector<std::size_t> Bitmap_cubical_complex_periodic_boundary_conditions_bas std::size_t cell) const { bool dbg = false; if (dbg) { - std::cerr << "Computations of boundary of a cell : " << cell << std::endl; + std::clog << "Computations of boundary of a cell : " << cell << std::endl; } std::vector<std::size_t> boundary_elements; @@ -292,7 +292,6 @@ std::vector<std::size_t> Bitmap_cubical_complex_periodic_boundary_conditions_bas if (position % 2 == 1) { // if there are no periodic boundary conditions in this direction, we do not have to do anything. if (!directions_in_which_periodic_b_cond_are_to_be_imposed[i - 1]) { - // std::cerr << "A\n"; if (sum_of_dimensions % 2) { boundary_elements.push_back(cell - this->multipliers[i - 1]); boundary_elements.push_back(cell + this->multipliers[i - 1]); @@ -301,12 +300,11 @@ std::vector<std::size_t> Bitmap_cubical_complex_periodic_boundary_conditions_bas boundary_elements.push_back(cell - this->multipliers[i - 1]); } if (dbg) { - std::cerr << cell - this->multipliers[i - 1] << " " << cell + this->multipliers[i - 1] << " "; + std::clog << cell - this->multipliers[i - 1] << " " << cell + this->multipliers[i - 1] << " "; } } else { // in this direction we have to do boundary conditions. Therefore, we need to check if we are not at the end. if (position != 2 * this->sizes[i - 1] - 1) { - // std::cerr << "B\n"; if (sum_of_dimensions % 2) { boundary_elements.push_back(cell - this->multipliers[i - 1]); boundary_elements.push_back(cell + this->multipliers[i - 1]); @@ -315,10 +313,9 @@ std::vector<std::size_t> Bitmap_cubical_complex_periodic_boundary_conditions_bas boundary_elements.push_back(cell - this->multipliers[i - 1]); } if (dbg) { - std::cerr << cell - this->multipliers[i - 1] << " " << cell + this->multipliers[i - 1] << " "; + std::clog << cell - this->multipliers[i - 1] << " " << cell + this->multipliers[i - 1] << " "; } } else { - // std::cerr << "C\n"; if (sum_of_dimensions % 2) { boundary_elements.push_back(cell - this->multipliers[i - 1]); boundary_elements.push_back(cell - (2 * this->sizes[i - 1] - 1) * this->multipliers[i - 1]); @@ -327,7 +324,7 @@ std::vector<std::size_t> Bitmap_cubical_complex_periodic_boundary_conditions_bas boundary_elements.push_back(cell - this->multipliers[i - 1]); } if (dbg) { - std::cerr << cell - this->multipliers[i - 1] << " " + std::clog << cell - this->multipliers[i - 1] << " " << cell - (2 * this->sizes[i - 1] - 1) * this->multipliers[i - 1] << " "; } } |