From 0844edcc9dcd8d507da462d84d120d4ad4724c83 Mon Sep 17 00:00:00 2001 From: skachano Date: Tue, 26 May 2015 11:00:08 +0000 Subject: Fixed random point choice in flat torus git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/witness@596 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: ae114c4dc58c3f7dd8a761c6407c2ad4ff8ef61e --- src/Witness_complex/example/witness_complex_flat_torus.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Witness_complex/example') diff --git a/src/Witness_complex/example/witness_complex_flat_torus.cpp b/src/Witness_complex/example/witness_complex_flat_torus.cpp index c3b2f910..1ce17fde 100644 --- a/src/Witness_complex/example/witness_complex_flat_torus.cpp +++ b/src/Witness_complex/example/witness_complex_flat_torus.cpp @@ -375,7 +375,8 @@ void landmark_choice(Point_Vector &W, int nbP, int nbL, Point_Vector& landmarks, { // while (!res.second) // { - chosen_landmark = rand.get_int(0,nbP); + while (std::count(landmarks_ind.begin(),landmarks_ind.end(),chosen_landmark)!=0) + chosen_landmark = rand.get_int(0,nbP); //rand++; //std::cout << "Chose " << chosen_landmark << std::endl; p = &W[chosen_landmark]; -- cgit v1.2.3