summaryrefslogtreecommitdiff
path: root/src/Persistent_cohomology/example/rips_multifield_persistence.cpp
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-09-30 14:24:41 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-09-30 14:24:41 +0000
commit29499b02d1b6eafcc6419a0b6b4469152ea20a09 (patch)
treed8e5ef87e75ab8b572a69d7db1b47f12d3b5930f /src/Persistent_cohomology/example/rips_multifield_persistence.cpp
parent1c1c3073e0612ee401a941008a6b13438b3429e2 (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_multifield_persistence.cpp')
-rw-r--r--src/Persistent_cohomology/example/rips_multifield_persistence.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/Persistent_cohomology/example/rips_multifield_persistence.cpp b/src/Persistent_cohomology/example/rips_multifield_persistence.cpp
index d4a07bb6..f4adc7a9 100644
--- a/src/Persistent_cohomology/example/rips_multifield_persistence.cpp
+++ b/src/Persistent_cohomology/example/rips_multifield_persistence.cpp
@@ -25,14 +25,21 @@
#include <gudhi/Simplex_tree.h>
#include <gudhi/Persistent_cohomology.h>
#include <gudhi/Persistent_cohomology/Multi_field.h>
+#include <gudhi/Points_off_io.h>
#include <boost/program_options.hpp>
#include <string>
#include <vector>
-
-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 Multi_field = Gudhi::persistent_cohomology::Multi_field;
+using Persistent_cohomology = Gudhi::persistent_cohomology::Persistent_cohomology<Simplex_tree, Multi_field >;
+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
@@ -54,22 +61,22 @@ int main(int argc, char * argv[]) {
program_options(argc, argv, off_file_points, filediag, threshold, dim_max, min_p, 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 Multi_field = Gudhi::persistent_cohomology::Multi_field;
// Compute the persistence diagram of the complex
- Gudhi::persistent_cohomology::Persistent_cohomology<Simplex_tree, Multi_field > pcoh(simplex_tree);
+ Persistent_cohomology pcoh(simplex_tree);
// initializes the coefficient field for homology
pcoh.init_coefficients(min_p, max_p);