From cbf1f4c98c9e6d7ba3b7c552e43c7c98ed349954 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Tue, 2 Feb 2016 10:03:48 +0000 Subject: Make example for doc shorter. Include strategy reviewal git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/alphashapes@992 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 23d3e71d7d0fb4d649f73e53959626c5cbb0acd8 --- src/Alpha_complex/example/Alpha_complex_from_off.cpp | 9 +++++---- .../example/Alpha_complex_from_points.cpp | 18 ++---------------- src/Alpha_complex/include/gudhi/Alpha_complex.h | 1 - .../example/alpha_complex_persistence.cpp | 17 ++++++++++------- 4 files changed, 17 insertions(+), 28 deletions(-) (limited to 'src') diff --git a/src/Alpha_complex/example/Alpha_complex_from_off.cpp b/src/Alpha_complex/example/Alpha_complex_from_off.cpp index 4f381892..780f904b 100644 --- a/src/Alpha_complex/example/Alpha_complex_from_off.cpp +++ b/src/Alpha_complex/example/Alpha_complex_from_off.cpp @@ -1,12 +1,13 @@ +#include +#include + #include #include -#include - void usage(char * const progName) { std::cerr << "Usage: " << progName << " filename.off alpha_square_max_value" << std::endl; std::cerr << " i.e.: " << progName << " ../../data/points/alphacomplexdoc.off 60.0" << std::endl; - exit(-1); // ----- >> + exit(-1); // ----- >> } int main(int argc, char **argv) { @@ -23,7 +24,7 @@ int main(int argc, char **argv) { // ---------------------------------------------------------------------------- typedef CGAL::Epick_d< CGAL::Dynamic_dimension_tag > Kernel; Gudhi::alphacomplex::Alpha_complex alpha_complex_from_file(off_file_name, alpha_square_max_value); - + // ---------------------------------------------------------------------------- // Display information about the alpha complex // ---------------------------------------------------------------------------- diff --git a/src/Alpha_complex/example/Alpha_complex_from_points.cpp b/src/Alpha_complex/example/Alpha_complex_from_points.cpp index 00e988a6..dab161c9 100644 --- a/src/Alpha_complex/example/Alpha_complex_from_points.cpp +++ b/src/Alpha_complex/example/Alpha_complex_from_points.cpp @@ -1,31 +1,17 @@ -#include -#include #include +#include #include #include #include -#include - typedef CGAL::Epick_d< CGAL::Dimension_tag<2> > Kernel; typedef Kernel::Point_d Point; typedef std::vector Vector_of_points; -void usage(char * const progName) { - std::cerr << "Usage: " << progName << " alpha_square_max_value" << std::endl; - std::cerr << " i.e.: " << progName << " 32.0" << std::endl; - exit(-1); // ----- >> -} - int main(int argc, char **argv) { - if (argc != 2) { - std::cerr << "Error: Number of arguments (" << argc << ") is not correct" << std::endl; - usage(argv[0]); - } + double alpha_square_max_value = 32.0; - double alpha_square_max_value = atof(argv[1]); - // ---------------------------------------------------------------------------- // Init of a list of points // ---------------------------------------------------------------------------- diff --git a/src/Alpha_complex/include/gudhi/Alpha_complex.h b/src/Alpha_complex/include/gudhi/Alpha_complex.h index 1ab6766c..962ed8dc 100644 --- a/src/Alpha_complex/include/gudhi/Alpha_complex.h +++ b/src/Alpha_complex/include/gudhi/Alpha_complex.h @@ -34,7 +34,6 @@ #include // isnan, fmax #include -#include #include #include diff --git a/src/Persistent_cohomology/example/alpha_complex_persistence.cpp b/src/Persistent_cohomology/example/alpha_complex_persistence.cpp index 0dabdeac..d2f9a4a2 100644 --- a/src/Persistent_cohomology/example/alpha_complex_persistence.cpp +++ b/src/Persistent_cohomology/example/alpha_complex_persistence.cpp @@ -1,13 +1,15 @@ -#include -#include - #include +#include // to construct a Delaunay_triangulation from a OFF file #include #include #include +#include +#include +#include // for numeric_limits + void program_options(int argc, char * argv[] , std::string & off_file_points , std::string & output_file_diag @@ -21,10 +23,10 @@ int main(int argc, char **argv) { Filtration_value alpha_square_max_value; int coeff_field_characteristic; Filtration_value min_persistence; - - program_options(argc, argv, off_file_points, output_file_diag, alpha_square_max_value, coeff_field_characteristic, min_persistence); - + program_options(argc, argv, off_file_points, output_file_diag, alpha_square_max_value, + coeff_field_characteristic, min_persistence); + // ---------------------------------------------------------------------------- // Init of an alpha complex from an OFF file // ---------------------------------------------------------------------------- @@ -80,7 +82,8 @@ void program_options(int argc, char * argv[] ("help,h", "produce help message") ("output-file,o", po::value(&output_file_diag)->default_value(std::string()), "Name of file in which the persistence diagram is written. Default print in std::cout") - ("max-alpha-square-value,r", po::value(&alpha_square_max_value)->default_value(std::numeric_limits::infinity()), + ("max-alpha-square-value,r", + po::value(&alpha_square_max_value)->default_value(std::numeric_limits::infinity()), "Maximal alpha square value for the Alpha complex construction.") ("field-charac,p", po::value(&coeff_field_characteristic)->default_value(11), "Characteristic p of the coefficient field Z/pZ for computing homology.") -- cgit v1.2.3