From be4e9ebd24f48def07f6dfec1a46791321fbaee4 Mon Sep 17 00:00:00 2001 From: skachano Date: Fri, 16 Dec 2016 17:51:58 +0000 Subject: The bug with limit dimension in Strong witness is fixed git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/relaxed-witness@1912 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 2229381ca73da7ebe6a8b22d9a9a8eab70f65eb5 --- src/Witness_complex/include/gudhi/Strong_witness_complex.h | 2 +- src/Witness_complex/test/test_simple_witness_complex.cpp | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'src/Witness_complex') diff --git a/src/Witness_complex/include/gudhi/Strong_witness_complex.h b/src/Witness_complex/include/gudhi/Strong_witness_complex.h index a3f88aae..3bb39c61 100644 --- a/src/Witness_complex/include/gudhi/Strong_witness_complex.h +++ b/src/Witness_complex/include/gudhi/Strong_witness_complex.h @@ -154,7 +154,7 @@ private: typeVectorVertex simplex; typename ActiveWitness::iterator aw_it = aw.begin(); float lim_dist2 = aw.begin()->second + max_alpha_square; - while ((Landmark_id)simplex.size() <= limit_dimension + 1 && aw_it != aw.end() && aw_it->second < lim_dist2) { + while ((Landmark_id)simplex.size() < limit_dimension + 1 && aw_it != aw.end() && aw_it->second < lim_dist2) { simplex.push_back(aw_it->first); complex.insert_simplex_and_subfaces(simplex, aw_it->second - aw.begin()->second); aw_it++; diff --git a/src/Witness_complex/test/test_simple_witness_complex.cpp b/src/Witness_complex/test/test_simple_witness_complex.cpp index 299c7fd6..aff6949e 100644 --- a/src/Witness_complex/test/test_simple_witness_complex.cpp +++ b/src/Witness_complex/test/test_simple_witness_complex.cpp @@ -68,9 +68,7 @@ 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): + // The corner simplex {0,2,5,7} and its cofaces are missing. StrongWitnessComplex strong_witness_complex(landmarks, @@ -83,6 +81,6 @@ BOOST_AUTO_TEST_CASE(simple_witness_complex) { BOOST_CHECK(strong_relaxed_complex.num_simplices() == 239); 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; + BOOST_CHECK(strong_relaxed_complex2.num_simplices() == 92); + // 8 vertices, 28 edges, 56 triangles } -- cgit v1.2.3