From 1e3b4f6c56409dde933341701575dc105ede12db Mon Sep 17 00:00:00 2001 From: ROUVREAU Vincent Date: Thu, 21 Nov 2019 09:34:06 +0100 Subject: Code review : review races for read_persistence_intervals_in_dimension function --- src/common/include/gudhi/reader_utils.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/common') diff --git a/src/common/include/gudhi/reader_utils.h b/src/common/include/gudhi/reader_utils.h index 5e96b5db..db31bf5c 100644 --- a/src/common/include/gudhi/reader_utils.h +++ b/src/common/include/gudhi/reader_utils.h @@ -293,6 +293,9 @@ Note: the function does not check that birth <= death. **/ template 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; +#endif // DEBUG_TRACES std::ifstream in(filename); if (!in.is_open()) { std::string error_str("read_persistence_intervals_and_dimension - Unable to open file "); @@ -308,8 +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 << "] = " << numbers[0] << "," << numbers[1] - << "," << numbers[2] << "," << numbers[3] << std::endl; + std::cout << "[" << n << "] = "; + for (int i = 0; i < n; i++) { + std::cout << numbers[i] << ","; + } + std::cout << std::endl; #endif // DEBUG_TRACES if (n >= 2) { int dim = (n >= 3 ? static_cast(numbers[n - 3]) : -1); -- cgit v1.2.3