summaryrefslogtreecommitdiff
path: root/src/Witness_complex/example/witness_complex_from_file.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Witness_complex/example/witness_complex_from_file.cpp')
-rw-r--r--src/Witness_complex/example/witness_complex_from_file.cpp20
1 files changed, 2 insertions, 18 deletions
diff --git a/src/Witness_complex/example/witness_complex_from_file.cpp b/src/Witness_complex/example/witness_complex_from_file.cpp
index 77109512..53207ad2 100644
--- a/src/Witness_complex/example/witness_complex_from_file.cpp
+++ b/src/Witness_complex/example/witness_complex_from_file.cpp
@@ -34,14 +34,9 @@
#include <string>
#include <vector>
-using namespace Gudhi;
-using namespace Gudhi::witness_complex;
-
typedef std::vector< Vertex_handle > typeVectorVertex;
typedef std::vector< std::vector <double> > Point_Vector;
-typedef Witness_complex< Simplex_tree<> > WitnessComplex;
-
/**
* \brief Customized version of read_points
* which takes into account a possible nbP first line
@@ -68,17 +63,6 @@ read_points_cust(std::string file_name, std::vector< std::vector< double > > & p
in_file.close();
}
-/** Write a gnuplot readable file.
- * Data range is a random access range of pairs (arg, value)
- */
-template < typename Data_range >
-void write_data(Data_range & data, std::string filename) {
- std::ofstream ofs(filename, std::ofstream::out);
- for (auto entry : data)
- ofs << entry.first << ", " << entry.second << "\n";
- ofs.close();
-}
-
int main(int argc, char * const argv[]) {
if (argc != 3) {
std::cerr << "Usage: " << argv[0]
@@ -91,7 +75,7 @@ int main(int argc, char * const argv[]) {
clock_t start, end;
// Construct the Simplex Tree
- Simplex_tree<> simplex_tree;
+ Gudhi::Simplex_tree<> simplex_tree;
// Read the point file
Point_Vector point_vector;
@@ -109,7 +93,7 @@ int main(int argc, char * const argv[]) {
// Compute witness complex
start = clock();
- WitnessComplex(knn, simplex_tree, nbL, point_vector[0].size());
+ Gudhi::witness_complex::witness_complex(knn, nbL, point_vector[0].size(), simplex_tree);
end = clock();
std::cout << "Witness complex took "
<< static_cast<double>(end - start) / CLOCKS_PER_SEC << " s. \n";