From c01bfb9543b1144e2c5adf291eac50c489c501b6 Mon Sep 17 00:00:00 2001 From: Arnur Nigmetov Date: Tue, 6 Mar 2018 22:09:20 +0100 Subject: Points with 0 persistence ignored in the input --- geom_matching/wasserstein/include/diagram_reader.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'geom_matching/wasserstein/include/diagram_reader.h') diff --git a/geom_matching/wasserstein/include/diagram_reader.h b/geom_matching/wasserstein/include/diagram_reader.h index 8d09c9b..5c690fa 100644 --- a/geom_matching/wasserstein/include/diagram_reader.h +++ b/geom_matching/wasserstein/include/diagram_reader.h @@ -151,7 +151,13 @@ bool read_diagram_point_set(const char* fname, ContType_& result, int& decPrecis x = parse_real_from_str(str_x); y = parse_real_from_str(str_y); - result.push_back(std::make_pair(x, y)); + if (x != y) { + result.push_back(std::make_pair(x, y)); + } else { +#ifndef FOR_R_TDA + std::cerr << "Warning: point with 0 persistence ignored in " << fname << ":" << lineNumber << "\n"; +#endif + } } catch (const std::invalid_argument& e) { #ifndef FOR_R_TDA -- cgit v1.2.3