summaryrefslogtreecommitdiff
path: root/src/Witness_complex/example
diff options
context:
space:
mode:
authorskachano <skachano@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-06-03 08:40:22 +0000
committerskachano <skachano@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-06-03 08:40:22 +0000
commit5f049ec0dbf0f756d8ecc5e55b00d2bd748cb927 (patch)
tree9053d176d18d0cbc0b6d034ec1abbf384b668609 /src/Witness_complex/example
parent9e99b02fa2d91aced59c5fded3f1a2e07afe30aa (diff)
witness: Added good-bad link count to witness_complex_perturbations
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/witness@602 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: b4dbfbf4f8c59399b174574216b577075f08ede8
Diffstat (limited to 'src/Witness_complex/example')
-rw-r--r--src/Witness_complex/example/witness_complex_perturbations.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/Witness_complex/example/witness_complex_perturbations.cpp b/src/Witness_complex/example/witness_complex_perturbations.cpp
index 9d39906b..ec7a5abe 100644
--- a/src/Witness_complex/example/witness_complex_perturbations.cpp
+++ b/src/Witness_complex/example/witness_complex_perturbations.cpp
@@ -292,6 +292,8 @@ int landmark_perturbation(Point_Vector &W, Point_Vector& landmarks, std::vector<
if (dist < lambda)
lambda = dist;
}
+ //std::cout << "\nBad links total: " << count_badlinks << " Points to perturb: " << perturbL.size() << std::endl;
+
}
//std::cout << "\n";
@@ -307,14 +309,16 @@ int landmark_perturbation(Point_Vector &W, Point_Vector& landmarks, std::vector<
std::cout << "Entered bad links\n";
std::set< int > perturbL;
int count_badlinks = 0;
- std::cout << "Bad links around ";
+ std::vector< int > count_bad(D);
+ std::vector< int > count_good(D);
+ //std::cout << "Bad links around ";
for (auto u: witnessComplex.complex_vertex_range())
- if (!witnessComplex.has_good_link(u))
+ if (!witnessComplex.has_good_link(u, count_bad, count_good))
{
//std::cout << "Landmark " << u << " start!" << std::endl;
//perturbL.insert(u);
count_badlinks++;
- std::cout << u << " ";
+ //std::cout << u << " ";
Point_d& l = landmarks[u];
Fuzzy_sphere fs(l, sqrt(lambda)*2, 0, STraits(&(landmarks[0])));
L.search(std::insert_iterator<std::set<int>>(perturbL,perturbL.begin()),fs);
@@ -322,7 +326,13 @@ int landmark_perturbation(Point_Vector &W, Point_Vector& landmarks, std::vector<
//L.search(std::ostream_iterator<int>(std::cout,"\n"),fs);
//std::cout << "PerturbL size is " << perturbL.size() << std::endl;
}
- std::cout << "\nBad links total: " << count_badlinks << " Points to perturb: " << perturbL.size() << std::endl;
+ for (unsigned int i = 0; i != count_good.size(); i++)
+ if (count_good[i] != 0)
+ std::cout << "count_good[" << i << "] = " << count_good[i] << std::endl;
+ for (unsigned int i = 0; i != count_bad.size(); i++)
+ if (count_bad[i] != 0)
+ std::cout << "count_bad[" << i << "] = " << count_bad[i] << std::endl;
+ std::cout << "Bad links total: " << count_badlinks << " Points to perturb: " << perturbL.size() << std::endl;
//std::cout << "landmark[0][0] before" << landmarks[0][0] << std::endl;
//*********************** Perturb bad link landmarks
@@ -405,7 +415,7 @@ int main (int argc, char * const argv[])
{
file_name.erase(0, last_slash_idx + 1);
}
- write_points("landmarks/initial_pointset",point_vector);
+ //write_points("landmarks/initial_pointset",point_vector);
write_points("landmarks/initial_landmarks",L);
for (int i = 0; bl != 0; i++)
{