summaryrefslogtreecommitdiff
path: root/src/Witness_complex/example/witness_complex_knn_landmarks.cpp
diff options
context:
space:
mode:
authorskachano <skachano@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-12-07 09:39:53 +0000
committerskachano <skachano@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-12-07 09:39:53 +0000
commit33c51358238382335caf892bbc24759c8aac59a0 (patch)
tree499e768570391c30af22eac4443667604fa717d6 /src/Witness_complex/example/witness_complex_knn_landmarks.cpp
parentda39f7cd8a0db5d7fa13c9c87f8fc3e038c10d01 (diff)
parentc8c2f91db880218bb7ab275fbadda53a23f88d35 (diff)
Changes piled up for months
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/witness@932 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 0447901e608890eb607456fd12f3ea53547b8f10
Diffstat (limited to 'src/Witness_complex/example/witness_complex_knn_landmarks.cpp')
-rw-r--r--src/Witness_complex/example/witness_complex_knn_landmarks.cpp71
1 files changed, 3 insertions, 68 deletions
diff --git a/src/Witness_complex/example/witness_complex_knn_landmarks.cpp b/src/Witness_complex/example/witness_complex_knn_landmarks.cpp
index e4a1c324..c45bc0c1 100644
--- a/src/Witness_complex/example/witness_complex_knn_landmarks.cpp
+++ b/src/Witness_complex/example/witness_complex_knn_landmarks.cpp
@@ -32,6 +32,8 @@
//#include "gudhi/graph_simplicial_complex.h"
#include "gudhi/Witness_complex.h"
#include "gudhi/reader_utils.h"
+#include "generators.h"
+#include "output.h"
//#include <boost/filesystem.hpp>
//#include <CGAL/Delaunay_triangulation.h>
@@ -73,60 +75,6 @@ typedef K_neighbor_search::iterator KNS_range;
typedef boost::container::flat_map<int, int> Point_etiquette_map;
typedef std::vector<Point_d> Point_Vector;
-/**
- * \brief Customized version of read_points
- * which takes into account a possible nbP first line
- *
- */
-inline void
-read_points_cust ( std::string file_name , Point_Vector & points)
-{
- std::ifstream in_file (file_name.c_str(),std::ios::in);
- if(!in_file.is_open())
- {
- std::cerr << "Unable to open file " << file_name << std::endl;
- return;
- }
- std::string line;
- double x;
- while( getline ( in_file , line ) )
- {
- std::vector< double > point;
- std::istringstream iss( line );
- while(iss >> x) { point.push_back(x); }
- Point_d p(point.begin(), point.end());
- if (point.size() != 1)
- points.push_back(p);
- }
- in_file.close();
-}
-
-/*
-void read_points_to_tree (std::string file_name, Tree& tree)
-{
- //I assume here that tree is empty
- std::ifstream in_file (file_name.c_str(),std::ios::in);
- if(!in_file.is_open())
- {
- std::cerr << "Unable to open file " << file_name << std::endl;
- return;
- }
- std::string line;
- double x;
- while( getline ( in_file , line ) )
- {
- std::vector<double> coords;
- std::istringstream iss( line );
- while(iss >> x) { coords.push_back(x); }
- if (coords.size() != 1)
- {
- Point_d point(coords.begin(), coords.end());
- tree.insert(point);
- }
- }
- in_file.close();
-}
-*/
/** Function that chooses landmarks from W and place it in the kd-tree L.
* Note: nbL hould be removed if the code moves to Witness_complex
@@ -184,19 +132,6 @@ void d_nearest_landmarks(Point_Vector &W, Tree &L, Point_etiquette_map &L_i, std
}
}
-
-void write_wl( std::string file_name, std::vector< std::vector <int> > & WL)
-{
- std::ofstream ofs (file_name, std::ofstream::out);
- for (auto w : WL)
- {
- for (auto l: w)
- ofs << l << " ";
- ofs << "\n";
- }
- ofs.close();
-}
-
int main (int argc, char * const argv[])
{
if (argc != 3)
@@ -270,6 +205,6 @@ int main (int argc, char * const argv[])
out_file = "output/"+file_name+"_"+argv[2]+".badlinks";
std::ofstream ofs2(out_file, std::ofstream::out);
- witnessComplex.write_bad_links(ofs2);
+ //witnessComplex.write_bad_links(ofs2);
ofs2.close();
}