summaryrefslogtreecommitdiff
path: root/src/common/include/gudhi
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/include/gudhi')
-rw-r--r--src/common/include/gudhi/Clock.h4
-rw-r--r--src/common/include/gudhi/Debug_utils.h10
-rw-r--r--src/common/include/gudhi/Points_3D_off_io.h8
-rw-r--r--src/common/include/gudhi/Points_off_io.h8
-rw-r--r--src/common/include/gudhi/Unitary_tests_utils.h4
-rw-r--r--src/common/include/gudhi/distance_functions.h2
-rw-r--r--src/common/include/gudhi/reader_utils.h16
7 files changed, 26 insertions, 26 deletions
diff --git a/src/common/include/gudhi/Clock.h b/src/common/include/gudhi/Clock.h
index 00ab2f27..6966aaaa 100644
--- a/src/common/include/gudhi/Clock.h
+++ b/src/common/include/gudhi/Clock.h
@@ -41,9 +41,9 @@ class Clock {
return msg;
}
- // Print current value to std::cout
+ // Print current value to std::clog
void print() const {
- std::cout << *this << std::endl;
+ std::clog << *this << std::endl;
}
friend std::ostream& operator<<(std::ostream& stream, const Clock& clock) {
diff --git a/src/common/include/gudhi/Debug_utils.h b/src/common/include/gudhi/Debug_utils.h
index 38abc06d..f8375b00 100644
--- a/src/common/include/gudhi/Debug_utils.h
+++ b/src/common/include/gudhi/Debug_utils.h
@@ -27,14 +27,14 @@
#define GUDHI_CHECK_code(CODE)
#endif
-#define PRINT(a) std::cerr << #a << ": " << (a) << " (DISP)" << std::endl
+#define PRINT(a) std::clog << #a << ": " << (a) << " (DISP)" << std::endl
// #define DBG_VERBOSE
#ifdef DBG_VERBOSE
- #define DBG(a) std::cout << "DBG: " << (a) << std::endl
- #define DBGMSG(a, b) std::cout << "DBG: " << a << b << std::endl
- #define DBGVALUE(a) std::cout << "DBG: " << #a << ": " << a << std::endl
- #define DBGCONT(a) std::cout << "DBG: container " << #a << " -> "; for (auto x : a) std::cout << x << ","; std::cout << std::endl
+ #define DBG(a) std::clog << "DBG: " << (a) << std::endl
+ #define DBGMSG(a, b) std::clog << "DBG: " << a << b << std::endl
+ #define DBGVALUE(a) std::clog << "DBG: " << #a << ": " << a << std::endl
+ #define DBGCONT(a) std::clog << "DBG: container " << #a << " -> "; for (auto x : a) std::clog << x << ","; std::clog << std::endl
#else
#define DBG(a) (void) 0
#define DBGMSG(a, b) (void) 0
diff --git a/src/common/include/gudhi/Points_3D_off_io.h b/src/common/include/gudhi/Points_3D_off_io.h
index 2d110af3..39b79c96 100644
--- a/src/common/include/gudhi/Points_3D_off_io.h
+++ b/src/common/include/gudhi/Points_3D_off_io.h
@@ -41,7 +41,7 @@ class Points_3D_off_visitor_reader {
*/
void init(int dim, int num_vertices, int num_faces, int num_edges) {
#ifdef DEBUG_TRACES
- std::cout << "Points_3D_off_visitor_reader::init - dim=" << dim << " - num_vertices=" <<
+ std::clog << "Points_3D_off_visitor_reader::init - dim=" << dim << " - num_vertices=" <<
num_vertices << " - num_faces=" << num_faces << " - num_edges=" << num_edges << std::endl;
#endif // DEBUG_TRACES
if (dim == 3) {
@@ -74,11 +74,11 @@ class Points_3D_off_visitor_reader {
void point(const std::vector<double>& point) {
if (valid_) {
#ifdef DEBUG_TRACES
- std::cout << "Points_3D_off_visitor_reader::point ";
+ std::clog << "Points_3D_off_visitor_reader::point ";
for (auto coordinate : point) {
- std::cout << coordinate << " | ";
+ std::clog << coordinate << " | ";
}
- std::cout << std::endl;
+ std::clog << std::endl;
#endif // DEBUG_TRACES
// Fill the point cloud
point_cloud_.push_back(Point_3(point[0], point[1], point[2]));
diff --git a/src/common/include/gudhi/Points_off_io.h b/src/common/include/gudhi/Points_off_io.h
index 99371d56..9dc40568 100644
--- a/src/common/include/gudhi/Points_off_io.h
+++ b/src/common/include/gudhi/Points_off_io.h
@@ -40,7 +40,7 @@ class Points_off_visitor_reader {
*/
void init(int dim, int num_vertices, int num_faces, int num_edges) {
#ifdef DEBUG_TRACES
- std::cout << "Points_off_visitor_reader::init - dim=" << dim << " - num_vertices=" <<
+ std::clog << "Points_off_visitor_reader::init - dim=" << dim << " - num_vertices=" <<
num_vertices << " - num_faces=" << num_faces << " - num_edges=" << num_edges << std::endl;
#endif // DEBUG_TRACES
if (num_faces > 0) {
@@ -66,11 +66,11 @@ class Points_off_visitor_reader {
*/
void point(const std::vector<double>& point) {
#ifdef DEBUG_TRACES
- std::cout << "Points_off_visitor_reader::point ";
+ std::clog << "Points_off_visitor_reader::point ";
for (auto coordinate : point) {
- std::cout << coordinate << " | ";
+ std::clog << coordinate << " | ";
}
- std::cout << std::endl;
+ std::clog << std::endl;
#endif // DEBUG_TRACES
// Fill the point cloud
point_cloud.push_back(Point_d(point.begin(), point.end()));
diff --git a/src/common/include/gudhi/Unitary_tests_utils.h b/src/common/include/gudhi/Unitary_tests_utils.h
index 9b86460a..9f995d01 100644
--- a/src/common/include/gudhi/Unitary_tests_utils.h
+++ b/src/common/include/gudhi/Unitary_tests_utils.h
@@ -20,7 +20,7 @@ template<typename FloatingType >
void GUDHI_TEST_FLOAT_EQUALITY_CHECK(FloatingType a, FloatingType b,
FloatingType epsilon = std::numeric_limits<FloatingType>::epsilon()) {
#ifdef DEBUG_TRACES
- std::cout << "GUDHI_TEST_FLOAT_EQUALITY_CHECK - " << a << " versus " << b
+ std::clog << "GUDHI_TEST_FLOAT_EQUALITY_CHECK - " << a << " versus " << b
<< " | diff = " << std::fabs(a - b) << " - epsilon = " << epsilon << std::endl;
#endif
BOOST_CHECK(std::fabs(a - b) <= epsilon);
@@ -32,7 +32,7 @@ template<typename FloatingType >
FloatingType GUDHI_PROTECT_FLOAT(FloatingType value) {
volatile FloatingType protected_value = value;
#ifdef DEBUG_TRACES
- std::cout << "GUDHI_PROTECT_FLOAT - " << protected_value << std::endl;
+ std::clog << "GUDHI_PROTECT_FLOAT - " << protected_value << std::endl;
#endif
return protected_value;
}
diff --git a/src/common/include/gudhi/distance_functions.h b/src/common/include/gudhi/distance_functions.h
index 94cf9ccc..9bbc62b7 100644
--- a/src/common/include/gudhi/distance_functions.h
+++ b/src/common/include/gudhi/distance_functions.h
@@ -97,7 +97,7 @@ class Minimal_enclosing_ball_radius {
Min_sphere ms(boost::size(*point_cloud.begin()), point_cloud.begin(), point_cloud.end());
#ifdef DEBUG_TRACES
- std::cout << "Minimal_enclosing_ball_radius = " << std::sqrt(ms.squared_radius()) << " | nb points = "
+ std::clog << "Minimal_enclosing_ball_radius = " << std::sqrt(ms.squared_radius()) << " | nb points = "
<< boost::size(point_cloud) << " | dimension = "
<< boost::size(*point_cloud.begin()) << std::endl;
#endif // DEBUG_TRACES
diff --git a/src/common/include/gudhi/reader_utils.h b/src/common/include/gudhi/reader_utils.h
index db31bf5c..0938f5c1 100644
--- a/src/common/include/gudhi/reader_utils.h
+++ b/src/common/include/gudhi/reader_utils.h
@@ -220,7 +220,7 @@ template <typename Filtration_value>
std::vector<std::vector<Filtration_value>> read_lower_triangular_matrix_from_csv_file(const std::string& filename,
const char separator = ';') {
#ifdef DEBUG_TRACES
- std::cout << "Using procedure read_lower_triangular_matrix_from_csv_file \n";
+ std::clog << "Using procedure read_lower_triangular_matrix_from_csv_file \n";
#endif // DEBUG_TRACES
std::vector<std::vector<Filtration_value>> result;
std::ifstream in;
@@ -272,12 +272,12 @@ std::vector<std::vector<Filtration_value>> read_lower_triangular_matrix_from_csv
in.close();
#ifdef DEBUG_TRACES
- std::cerr << "Here is the matrix we read : \n";
+ std::clog << "Here is the matrix we read : \n";
for (size_t i = 0; i != result.size(); ++i) {
for (size_t j = 0; j != result[i].size(); ++j) {
- std::cerr << result[i][j] << " ";
+ std::clog << result[i][j] << " ";
}
- std::cerr << std::endl;
+ std::clog << std::endl;
}
#endif // DEBUG_TRACES
@@ -294,7 +294,7 @@ Note: the function does not check that birth <= death.
template <typename OutputIterator>
void read_persistence_intervals_and_dimension(std::string const& filename, OutputIterator out) {
#ifdef DEBUG_TRACES
- std::cout << "read_persistence_intervals_and_dimension - " << filename << std::endl;
+ std::clog << "read_persistence_intervals_and_dimension - " << filename << std::endl;
#endif // DEBUG_TRACES
std::ifstream in(filename);
if (!in.is_open()) {
@@ -311,11 +311,11 @@ void read_persistence_intervals_and_dimension(std::string const& filename, Outpu
double numbers[4];
int n = sscanf(line.c_str(), "%lf %lf %lf %lf", &numbers[0], &numbers[1], &numbers[2], &numbers[3]);
#ifdef DEBUG_TRACES
- std::cout << "[" << n << "] = ";
+ std::clog << "[" << n << "] = ";
for (int i = 0; i < n; i++) {
- std::cout << numbers[i] << ",";
+ std::clog << numbers[i] << ",";
}
- std::cout << std::endl;
+ std::clog << std::endl;
#endif // DEBUG_TRACES
if (n >= 2) {
int dim = (n >= 3 ? static_cast<int>(numbers[n - 3]) : -1);