summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnur Nigmetov <a.nigmetov@gmail.com>2016-11-09 22:55:55 +0100
committerArnur Nigmetov <a.nigmetov@gmail.com>2016-11-09 22:55:55 +0100
commit1bfe54d664d929884a579973b00960b4348c4258 (patch)
tree1fdcc984ea39ccbd7efb58b737a973e2b557d204
parent7b850b8ee43fb7f8a0b2a1565ed01102d40b0a14 (diff)
Ignore zero persistence in the input
-rw-r--r--geom_bottleneck/bottleneck/src/bottleneck.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/geom_bottleneck/bottleneck/src/bottleneck.cpp b/geom_bottleneck/bottleneck/src/bottleneck.cpp
index 365995a..34f7ed4 100644
--- a/geom_bottleneck/bottleneck/src/bottleneck.cpp
+++ b/geom_bottleneck/bottleneck/src/bottleneck.cpp
@@ -538,7 +538,13 @@ bool readDiagramPointSet(const char* fname, std::vector<std::pair<double, double
#endif
return false;
}
- 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: in file " << fname << ", line number " << lineNumber << ", zero persistence point: \"" << line << "\"" << std::endl;
+#endif
+ }
}
f.close();
return true;