summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorskachano <skachano@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-12-16 08:42:13 +0000
committerskachano <skachano@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-12-16 08:42:13 +0000
commite36bb3953817d9aa3b1baaa61e51cee4099787b9 (patch)
treeddf4c3a49359e90b2a36b30f58d0b23fc3f9bad4 /src
parent0c26001efc086657ab46aeb2a1b7746f3e8bbfcf (diff)
memory access violation: here we go again
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/relaxed-witness@1892 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: fff0a693f83f8f0a0f93d2fe57640408e7b17c69
Diffstat (limited to 'src')
-rw-r--r--src/Witness_complex/include/gudhi/Strong_witness_complex.h13
-rw-r--r--src/Witness_complex/test/test_simple_witness_complex.cpp8
2 files changed, 12 insertions, 9 deletions
diff --git a/src/Witness_complex/include/gudhi/Strong_witness_complex.h b/src/Witness_complex/include/gudhi/Strong_witness_complex.h
index 3803980b..5f9db5a4 100644
--- a/src/Witness_complex/include/gudhi/Strong_witness_complex.h
+++ b/src/Witness_complex/include/gudhi/Strong_witness_complex.h
@@ -162,7 +162,8 @@ private:
// continue inserting limD-faces of the following simplices
typeVectorVertex& vertices = simplex; //'simplex' now will be called vertices
while (aw_it != aw.end() && aw_it->second < lim_dist2) {
- add_all_faces_of_dimension(limD, vertices, vertices.begin(), aw_it, typeVectorVertex({}), complex);
+ typeVectorVertex facet = {};
+ add_all_faces_of_dimension(limit_dimension, vertices, vertices.begin(), aw_it, facet, complex);
vertices.push_back(aw_it->first);
aw_it++;
}
@@ -181,17 +182,17 @@ private:
* The landmark pointed by aw_it is added to all formed simplices.
*/
template < typename SimplicialComplexForWitness >
- void add_all_faces_of_dimension(int dim,
- std::vector<Landmark_id>& vertices,
+ void add_all_faces_of_dimension(Landmark_id dim,
+ typeVectorVertex& vertices,
typename typeVectorVertex::iterator curr_it,
typename ActiveWitness::iterator aw_it,
- std::vector<Landmark_id>& simplex,
+ typeVectorVertex& simplex,
SimplicialComplexForWitness& sc)
{
if (dim > 0)
while (curr_it != vertices.end()) {
- simplex.push_back(curr_it->first);
- typename ActiveWitness::iterator next_it = curr_it++;
+ simplex.push_back(*curr_it);
+ typename typeVectorVertex::iterator next_it = curr_it++;
add_all_faces_of_dimension(dim-1,
vertices,
next_it,
diff --git a/src/Witness_complex/test/test_simple_witness_complex.cpp b/src/Witness_complex/test/test_simple_witness_complex.cpp
index a0a1b36c..dc7f3175 100644
--- a/src/Witness_complex/test/test_simple_witness_complex.cpp
+++ b/src/Witness_complex/test/test_simple_witness_complex.cpp
@@ -32,7 +32,7 @@ typedef Gudhi::witness_complex::Strong_witness_complex<Kernel> StrongWitnessComp
*/
BOOST_AUTO_TEST_CASE(simple_witness_complex) {
- Simplex_tree complex, relaxed_complex, strong_relaxed_complex;
+ Simplex_tree complex, relaxed_complex, strong_relaxed_complex, strong_relaxed_complex2;
std::vector<Point_d> witnesses, landmarks;
@@ -73,8 +73,10 @@ BOOST_AUTO_TEST_CASE(simple_witness_complex) {
witnesses);
strong_witness_complex.create_complex(strong_relaxed_complex, 9.1);
-
+ strong_witness_complex.create_complex(strong_relaxed_complex2, 9.1, 2);
+
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;
}