diff options
author | skachano <skachano@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2015-06-16 09:36:00 +0000 |
---|---|---|
committer | skachano <skachano@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2015-06-16 09:36:00 +0000 |
commit | c88e3b93de22be92cc7027f4c14ea4294f8c366f (patch) | |
tree | 74212c6a845a4b51a43ab8bf8d70401d9ff78028 /src/Witness_complex/example | |
parent | 36a355eb8756a8eb6bdc3e9cad4283d89da4f7f6 (diff) |
Fixed the changing WL matrix bug in witness complex. Added is_witness_complex test
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/witness@615 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: 60917e75766b53d08240b510c0508e7d781b56d6
Diffstat (limited to 'src/Witness_complex/example')
-rw-r--r-- | src/Witness_complex/example/relaxed_witness_complex_sphere.cpp | 1 | ||||
-rw-r--r-- | src/Witness_complex/example/witness_complex_sphere.cpp | 10 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/Witness_complex/example/relaxed_witness_complex_sphere.cpp b/src/Witness_complex/example/relaxed_witness_complex_sphere.cpp index 53380124..067321ce 100644 --- a/src/Witness_complex/example/relaxed_witness_complex_sphere.cpp +++ b/src/Witness_complex/example/relaxed_witness_complex_sphere.cpp @@ -36,6 +36,7 @@ //#include "gudhi/graph_simplicial_complex.h" #include "gudhi/Relaxed_witness_complex.h" #include "gudhi/reader_utils.h" +#include "gudhi/Collapse/Collapse.h" //#include <boost/filesystem.hpp> //#include <CGAL/Delaunay_triangulation.h> diff --git a/src/Witness_complex/example/witness_complex_sphere.cpp b/src/Witness_complex/example/witness_complex_sphere.cpp index f2bb9819..d08c763f 100644 --- a/src/Witness_complex/example/witness_complex_sphere.cpp +++ b/src/Witness_complex/example/witness_complex_sphere.cpp @@ -578,6 +578,10 @@ int landmark_perturbation(Point_Vector &W, Point_Vector& landmarks, std::vector< Witness_complex<> witnessComplex; witnessComplex.setNbL(nbL); witnessComplex.witness_complex(WL); + if (witnessComplex.is_witness_complex(WL)) + std::cout << "!!YES. IT IS A WITNESS COMPLEX!!\n"; + else + std::cout << "??NO. IT IS NOT A WITNESS COMPLEX??\n"; //******************** Making a set of bad link landmarks std::cout << "Entered bad links\n"; std::set< int > perturbL; @@ -614,7 +618,7 @@ int landmark_perturbation(Point_Vector &W, Point_Vector& landmarks, std::vector< for (auto u: perturbL) { - Random_point_iterator rp(D,sqrt(lambda)/8); + Random_point_iterator rp(D,sqrt(lambda)/8*nbL/count_badlinks); //std::cout << landmarks[u] << std::endl; std::vector<FT> point; @@ -721,8 +725,8 @@ int main (int argc, char * const argv[]) write_points("landmarks/initial_pointset",point_vector); write_points("landmarks/initial_landmarks",L); - for (int i = 0; bl > 0; i++) - //for (int i = 0; i < 1; i++) + //for (int i = 0; bl > 0; i++) + for (int i = 0; i < 1; i++) { std::cout << "========== Start iteration " << i << "== curr_min(" << curr_min << ")========\n"; bl=landmark_perturbation(point_vector, L, chosen_landmarks); |