summaryrefslogtreecommitdiff
path: root/src/Witness_complex/include
diff options
context:
space:
mode:
authorskachano <skachano@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-05-06 13:51:36 +0000
committerskachano <skachano@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-05-06 13:51:36 +0000
commitd8984eab8b054dbdaa2d2ada040f6b1927594bef (patch)
treeaca349e7f4552d2c4e355e5b2cf7ff2031b356a4 /src/Witness_complex/include
parente1caa847d6c0de60812a5246437e7702605cb7e8 (diff)
Kd tree landmark choice worked
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/witness@586 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 59d672bab0c8d8bad0a39774a58a50c87d573604
Diffstat (limited to 'src/Witness_complex/include')
-rw-r--r--src/Witness_complex/include/gudhi/Witness_complex.h21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/Witness_complex/include/gudhi/Witness_complex.h b/src/Witness_complex/include/gudhi/Witness_complex.h
index 2ccaa416..69521e6a 100644
--- a/src/Witness_complex/include/gudhi/Witness_complex.h
+++ b/src/Witness_complex/include/gudhi/Witness_complex.h
@@ -284,29 +284,27 @@ private:
private:
void sc_to_file(std::ofstream& out_file, Siblings * sibl)
{
- if (sibl == NULL)
- out_file << "&";
- else
- children_to_file(out_file, sibl->members_);
+ assert(sibl);
+ children_to_file(out_file, sibl->members_);
}
- void children_to_file(std::ofstream& out_file, Dictionary map)
+ void children_to_file(std::ofstream& out_file, Dictionary& map)
{
- out_file << "(";
+ out_file << "(" << std::flush;
if (!map.empty())
{
- out_file << map.begin()->first;
+ out_file << map.begin()->first << std::flush;
if (has_children(map.begin()))
sc_to_file(out_file, map.begin()->second.children());
typename Dictionary::iterator it;
for (it = map.begin()+1; it != map.end(); ++it)
{
- out_file << "," << it->first;
+ out_file << "," << it->first << std::flush;
if (has_children(it))
sc_to_file(out_file, it->second.children());
}
}
- out_file << ")";
+ out_file << ")" << std::flush;
}
@@ -541,7 +539,7 @@ private:
//std::cout << "W="; print_vvector(W);
//std::unordered_set< int > chosen_landmarks; // landmark set
- Point_Vector wit_land_dist(nbP,std::vector<double>()); // distance matrix witness x landmarks
+ //Point_Vector wit_land_dist(nbP,std::vector<double>()); // distance matrix witness x landmarks
//WL = KNearestNeighbours(nbP,std::vector<int>());
int current_number_of_landmarks=0; // counter for landmarks
@@ -618,7 +616,8 @@ private:
for (int i = 0; i < D+1; i++)
{
dist_i dist = l_heap.top();
- WL[W_i].push_back(dist.second);
+ WL[W_i].push_back(dist.second);
+ //WL[W_i].insert(WL[W_i].begin(),dist.second);
//std::cout << dist.first << " " << dist.second << std::endl;
l_heap.pop();
}