summaryrefslogtreecommitdiff
path: root/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_base.h
diff options
context:
space:
mode:
authorROUVREAU Vincent <vincent.rouvreau@inria.fr>2020-01-27 10:43:16 +0100
committerROUVREAU Vincent <vincent.rouvreau@inria.fr>2020-01-27 10:43:16 +0100
commitbf4b4eeda9762ed9e99c2b24f19331fa0111fcfe (patch)
tree03950723bd824ba3c69597e022500dfd5f37e914 /src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_base.h
parentc7b70317b643b2eb9c603602da9c979388829821 (diff)
Code review: Use std::clog instead of std::cout
Diffstat (limited to 'src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_base.h')
-rw-r--r--src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_base.h36
1 files changed, 18 insertions, 18 deletions
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 96036fd4..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
@@ -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::cout << "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::cout << "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::cout << "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::cout << "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::cout << "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::cout << "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::cout << "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::cout << "\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::cout << "i-1 :" << i - 1 << std::endl;
- std::cout << "cell : " << cell << std::endl;
- std::cout << "position : " << position << std::endl;
- std::cout << "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::cout << "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::cout << "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::cout << "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::cout << "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;
}
}