summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskachano <skachano@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-12-16 16:58:38 +0000
committerskachano <skachano@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-12-16 16:58:38 +0000
commit7f5d6edb13f0c15bf85552984f3f6930fb810711 (patch)
tree2570bf9676d1f2c1f4fe134edeafa04de7d37db6
parente36bb3953817d9aa3b1baaa61e51cee4099787b9 (diff)
I'm almost there...
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/relaxed-witness@1908 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: a3f2a7ccf38672e51462d2ce42056d82b675d45a
-rw-r--r--src/Witness_complex/include/gudhi/Strong_witness_complex.h4
-rw-r--r--src/Witness_complex/test/CMakeLists.txt1
-rw-r--r--src/Witness_complex/test/test_simple_witness_complex.cpp8
3 files changed, 10 insertions, 3 deletions
diff --git a/src/Witness_complex/include/gudhi/Strong_witness_complex.h b/src/Witness_complex/include/gudhi/Strong_witness_complex.h
index 5f9db5a4..4b39704e 100644
--- a/src/Witness_complex/include/gudhi/Strong_witness_complex.h
+++ b/src/Witness_complex/include/gudhi/Strong_witness_complex.h
@@ -192,7 +192,7 @@ private:
if (dim > 0)
while (curr_it != vertices.end()) {
simplex.push_back(*curr_it);
- typename typeVectorVertex::iterator next_it = curr_it++;
+ typename typeVectorVertex::iterator next_it = ++curr_it;
add_all_faces_of_dimension(dim-1,
vertices,
next_it,
@@ -209,7 +209,7 @@ private:
}
else if (dim == 0) {
simplex.push_back(aw_it->first);
- sc.insert_simplex(simplex, aw_it->second);
+ sc.insert_simplex_and_subfaces(simplex, aw_it->second);
simplex.pop_back();
}
}
diff --git a/src/Witness_complex/test/CMakeLists.txt b/src/Witness_complex/test/CMakeLists.txt
index 8d68ea1f..084761e2 100644
--- a/src/Witness_complex/test/CMakeLists.txt
+++ b/src/Witness_complex/test/CMakeLists.txt
@@ -12,6 +12,7 @@ endif()
add_executable ( Witness_complex_test_simple_witness_complex test_simple_witness_complex.cpp )
target_link_libraries(Witness_complex_test_simple_witness_complex ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
+target_link_libraries(Witness_complex_test_simple_witness_complex ${TBB_LIBRARIES})
# Unitary tests definition and xml result file generation
add_test(NAME simple_witness_complex
diff --git a/src/Witness_complex/test/test_simple_witness_complex.cpp b/src/Witness_complex/test/test_simple_witness_complex.cpp
index dc7f3175..299c7fd6 100644
--- a/src/Witness_complex/test/test_simple_witness_complex.cpp
+++ b/src/Witness_complex/test/test_simple_witness_complex.cpp
@@ -68,6 +68,10 @@ BOOST_AUTO_TEST_CASE(simple_witness_complex) {
std::cout << "relaxed_complex.num_simplices() = " << relaxed_complex.num_simplices() << std::endl;
BOOST_CHECK(relaxed_complex.num_simplices() == 239);
+ // All edges but big diagonals are present.
+ //
+ // Simplex count (number:dimension):
+
StrongWitnessComplex strong_witness_complex(landmarks,
witnesses);
@@ -78,5 +82,7 @@ BOOST_AUTO_TEST_CASE(simple_witness_complex) {
std::cout << "strong_relaxed_complex.num_simplices() = " << strong_relaxed_complex.num_simplices() << std::endl;
BOOST_CHECK(strong_relaxed_complex.num_simplices() == 239);
- std::cout << "strong_relaxed_complex2.num_simplices() = " << strong_relaxed_complex2.num_simplices() << std::endl;
+ std::cout << "strong_relaxed_complex2.num_simplices() = " << strong_relaxed_complex2.num_simplices() << std::endl;
+ BOOST_CHECK(strong_relaxed_complex2.num_simplices() == 101);
+ std::cout << strong_relaxed_complex2 << std::endl;
}