diff options
author | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2016-09-30 14:24:41 +0000 |
---|---|---|
committer | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2016-09-30 14:24:41 +0000 |
commit | 29499b02d1b6eafcc6419a0b6b4469152ea20a09 (patch) | |
tree | d8e5ef87e75ab8b572a69d7db1b47f12d3b5930f /src/Persistent_cohomology/example/rips_persistence.cpp | |
parent | 1c1c3073e0612ee401a941008a6b13438b3429e2 (diff) |
Fix compilation issues
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/rips_complex_module@1596 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: 343308ef914e6a6617890f49a55eb0bb8db15ee9
Diffstat (limited to 'src/Persistent_cohomology/example/rips_persistence.cpp')
-rw-r--r-- | src/Persistent_cohomology/example/rips_persistence.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/Persistent_cohomology/example/rips_persistence.cpp b/src/Persistent_cohomology/example/rips_persistence.cpp index e3ab5927..97bab14c 100644 --- a/src/Persistent_cohomology/example/rips_persistence.cpp +++ b/src/Persistent_cohomology/example/rips_persistence.cpp @@ -25,6 +25,7 @@ #include <gudhi/distance_functions.h> #include <gudhi/Simplex_tree.h> #include <gudhi/Persistent_cohomology.h> +#include <gudhi/Points_off_io.h> #include <boost/program_options.hpp> @@ -32,7 +33,14 @@ #include <vector> #include <limits> // infinity -typedef double Filtration_value; +// Types definition +using Simplex_tree = Gudhi::Simplex_tree</*Gudhi::Simplex_tree_options_fast_persistence*/>; +using Filtration_value = Simplex_tree::Filtration_value; +using Rips_complex = Gudhi::rips_complex::Rips_complex<Filtration_value>; +using Field_Zp = Gudhi::persistent_cohomology::Field_Zp; +using Persistent_cohomology = Gudhi::persistent_cohomology::Persistent_cohomology<Simplex_tree, Field_Zp >; +using Point = std::vector<double>; +using Points_off_reader = Gudhi::Points_off_reader<Point>; void program_options(int argc, char * argv[] , std::string & off_file_points @@ -52,22 +60,22 @@ int main(int argc, char * argv[]) { program_options(argc, argv, off_file_points, filediag, threshold, dim_max, p, min_persistence); - Gudhi::rips_complex::Rips_complex<> rips_complex_from_file(off_file_points); + Points_off_reader off_reader(off_file_points); + Rips_complex rips_complex_from_file(off_reader.get_point_cloud(), threshold, + euclidean_distance<Point>); // Construct the Rips complex in a Simplex Tree - using Simplex_tree = Gudhi::Simplex_tree<Gudhi::Simplex_tree_options_fast_persistence>; Simplex_tree simplex_tree; - if (rips_complex_from_file.create_complex(simplex_tree, threshold, dim_max, euclidean_distance<std::vector<double>>)) { + if (rips_complex_from_file.create_complex(simplex_tree, dim_max)) { std::cout << "The complex contains " << simplex_tree.num_simplices() << " simplices \n"; std::cout << " and has dimension " << simplex_tree.dimension() << " \n"; // Sort the simplices in the order of the filtration simplex_tree.initialize_filtration(); - using Field_Zp = Gudhi::persistent_cohomology::Field_Zp; // Compute the persistence diagram of the complex - Gudhi::persistent_cohomology::Persistent_cohomology<Simplex_tree, Field_Zp > pcoh(simplex_tree); + Persistent_cohomology pcoh(simplex_tree); // initializes the coefficient field for homology pcoh.init_coefficients(p); |