summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-03-02 13:14:45 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-03-02 13:14:45 +0000
commit28783add0035c46efa2754038d55f8a31ca93526 (patch)
treeb531134e09cde82b52c827f5eebab50628e05a0c
parentde314e530876896d58a17c8f63493782ab899dc0 (diff)
Add Boost system libraries for examples using persistence
Remove useless includes in example_nearest_landmark_table.cpp Fix list iterator not dereferencable on example nearest_landmark_table git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/relaxed-witness@2126 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: c93f00a0892737e1324a3ee8378ef7d49e6517d4
-rw-r--r--CMakeLists.txt2
-rw-r--r--src/Witness_complex/example/example_nearest_landmark_table.cpp2
-rw-r--r--src/Witness_complex/include/gudhi/Witness_complex.h2
3 files changed, 2 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a71ad829..07992ba1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -59,7 +59,7 @@ else()
# Turn off some VC++ warnings
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267 /wd4668 /wd4311 /wd4800 /wd4820 /wd4503 /wd4244 /wd4345 /wd4996 /wd4396 /wd4018")
else()
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -pedantic")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -pedantic -fsanitize=address -fno-omit-frame-pointer")
endif()
if(CMAKE_BUILD_TYPE MATCHES Debug)
diff --git a/src/Witness_complex/example/example_nearest_landmark_table.cpp b/src/Witness_complex/example/example_nearest_landmark_table.cpp
index 65b675f9..b8594212 100644
--- a/src/Witness_complex/example/example_nearest_landmark_table.cpp
+++ b/src/Witness_complex/example/example_nearest_landmark_table.cpp
@@ -28,11 +28,9 @@
#include <iostream>
#include <fstream>
-#include <ctime>
#include <utility>
#include <string>
#include <vector>
-#include <list>
int main(int argc, char * const argv[]) {
using Nearest_landmark_range = std::vector<std::pair<std::size_t, double>>;
diff --git a/src/Witness_complex/include/gudhi/Witness_complex.h b/src/Witness_complex/include/gudhi/Witness_complex.h
index a79bf294..edd5c0a8 100644
--- a/src/Witness_complex/include/gudhi/Witness_complex.h
+++ b/src/Witness_complex/include/gudhi/Witness_complex.h
@@ -160,7 +160,7 @@ class Witness_complex {
bool will_be_active = false;
typename ActiveWitness::iterator l_it = curr_l;
if (dim > 0) {
- for (; l_it->second - alpha2 <= norelax_dist2 && l_it != end; ++l_it) {
+ for (; l_it != end && l_it->second - alpha2 <= norelax_dist2; ++l_it) {
simplex.push_back(l_it->first);
if (sc.find(simplex) != sc.null_simplex()) {
typename ActiveWitness::iterator next_it = l_it;