diff options
-rw-r--r-- | src/Witness_complex/include/gudhi/Witness_complex.h | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/Witness_complex/include/gudhi/Witness_complex.h b/src/Witness_complex/include/gudhi/Witness_complex.h index d5a35801..4b65e8a2 100644 --- a/src/Witness_complex/include/gudhi/Witness_complex.h +++ b/src/Witness_complex/include/gudhi/Witness_complex.h @@ -219,7 +219,7 @@ namespace Gudhi { void witness_complex_from_points(Point_Vector point_vector) { std::vector<std::vector< int > > WL; - landmark_choice_by_random_points(point_vector, point_vector.size(), WL); + landmark_choice_by_furthest_points(point_vector, point_vector.size(), WL); witness_complex(WL); } @@ -357,7 +357,6 @@ private: { //curr_max_w at this point is the next landmark chosen_landmarks.push_back(curr_max_w); - curr_max_dist = 0; //std::cout << "**********Entered loop with current number of landmarks = " << current_number_of_landmarks << std::endl; //std::cout << "WL="; print_vvector(WL); //std::cout << "WLD="; print_vvector(wit_land_dist); @@ -377,11 +376,6 @@ private: //std::cout << "Push't back\n"; if (curr_dist < dist_to_L[i]) dist_to_L[i] = curr_dist; - if (dist_to_L[i] > curr_max_dist) - { - curr_max_dist = curr_dist; - curr_max_w = i; - } j = current_number_of_landmarks; //std::cout << "First half complete\n"; while (j > 0 && wit_land_dist[i][j-1] > wit_land_dist[i][j]) @@ -400,6 +394,17 @@ private: //std::cout << "result distL="; print_vector(dist_to_L); std::cout << std::endl; //std::cout << "End loop\n"; } + std::cout << "Distance to landmarks="; print_vector(dist_to_L); std::cout << std::endl; + curr_max_dist = 0; + for (int i = 0; i < nbP; ++i) { + if (dist_to_L[i] > curr_max_dist) + { + curr_max_dist = dist_to_L[i]; + curr_max_w = i; + std::cout << "hop curr_max_w is now " << curr_max_w << std::endl; + } + } + std::cout << "Chose " << curr_max_w << " as new landmark\n"; } //std::cout << endl; } |