summaryrefslogtreecommitdiff
path: root/src/Alpha_complex/example
diff options
context:
space:
mode:
Diffstat (limited to 'src/Alpha_complex/example')
-rw-r--r--src/Alpha_complex/example/Alpha_complex_from_off.cpp8
-rw-r--r--src/Alpha_complex/example/Alpha_complex_from_points.cpp15
-rw-r--r--src/Alpha_complex/example/alphaoffreader_for_doc_32.txt26
-rw-r--r--src/Alpha_complex/example/alphaoffreader_for_doc_60.txt36
4 files changed, 48 insertions, 37 deletions
diff --git a/src/Alpha_complex/example/Alpha_complex_from_off.cpp b/src/Alpha_complex/example/Alpha_complex_from_off.cpp
index 18a1a20d..963ef5ca 100644
--- a/src/Alpha_complex/example/Alpha_complex_from_off.cpp
+++ b/src/Alpha_complex/example/Alpha_complex_from_off.cpp
@@ -4,17 +4,15 @@
#include <iostream>
#include <string>
-void usage(char * const progName) {
+void usage(int nbArgs, char * const progName) {
+ std::cerr << "Error: Number of arguments (" << nbArgs << ") is not correct\n";
std::cerr << "Usage: " << progName << " filename.off alpha_square_max_value [ouput_file.txt]\n";
std::cerr << " i.e.: " << progName << " ../../data/points/alphacomplexdoc.off 60.0\n";
exit(-1); // ----- >>
}
int main(int argc, char **argv) {
- if ((argc != 3) && (argc != 4)) {
- std::cerr << "Error: Number of arguments (" << argc << ") is not correct\n";
- usage(argv[0]);
- }
+ if ((argc != 3) && (argc != 4)) usage(argc, (argv[0] - 1));
std::string off_file_name(argv[1]);
double alpha_square_max_value = atof(argv[2]);
diff --git a/src/Alpha_complex/example/Alpha_complex_from_points.cpp b/src/Alpha_complex/example/Alpha_complex_from_points.cpp
index 815e40d7..cd17af1e 100644
--- a/src/Alpha_complex/example/Alpha_complex_from_points.cpp
+++ b/src/Alpha_complex/example/Alpha_complex_from_points.cpp
@@ -4,13 +4,26 @@
#include <iostream>
#include <string>
#include <vector>
+#include <limits> // for numeric limits
typedef CGAL::Epick_d< CGAL::Dimension_tag<2> > Kernel;
typedef Kernel::Point_d Point;
typedef std::vector<Point> Vector_of_points;
+void usage(int nbArgs, char * const progName) {
+ std::cerr << "Error: Number of arguments (" << nbArgs << ") is not correct\n";
+ std::cerr << "Usage: " << progName << " [alpha_square_max_value]\n";
+ std::cerr << " i.e.: " << progName << " 60.0\n";
+ exit(-1); // ----- >>
+}
+
int main(int argc, char **argv) {
- double alpha_square_max_value = 60.0;
+ if ((argc != 1) && (argc != 2)) usage(argc, (argv[0] - 1));
+
+ // Delaunay complex if alpha_square_max_value is not given by the user.
+ double alpha_square_max_value = std::numeric_limits<double>::infinity();
+ if (argc == 2)
+ alpha_square_max_value = atof(argv[1]);
// ----------------------------------------------------------------------------
// Init of a list of points
diff --git a/src/Alpha_complex/example/alphaoffreader_for_doc_32.txt b/src/Alpha_complex/example/alphaoffreader_for_doc_32.txt
index 5869fdff..13183e86 100644
--- a/src/Alpha_complex/example/alphaoffreader_for_doc_32.txt
+++ b/src/Alpha_complex/example/alphaoffreader_for_doc_32.txt
@@ -7,16 +7,16 @@ Iterator on alpha complex simplices in the filtration order, with [filtration va
( 4 ) -> [0]
( 5 ) -> [0]
( 6 ) -> [0]
- ( 5 4 ) -> [6.25]
- ( 3 1 ) -> [7.25]
- ( 4 2 ) -> [8.5]
- ( 6 2 ) -> [9.25]
- ( 6 5 ) -> [10]
- ( 6 4 ) -> [11.25]
- ( 6 5 4 ) -> [12.5]
- ( 6 4 2 ) -> [12.9959]
- ( 3 0 ) -> [13.25]
- ( 4 1 ) -> [20]
- ( 1 0 ) -> [22.7367]
- ( 3 1 0 ) -> [22.7367]
- ( 5 0 ) -> [30.25]
+ ( 3 2 ) -> [6.25]
+ ( 5 4 ) -> [7.25]
+ ( 2 0 ) -> [8.5]
+ ( 1 0 ) -> [9.25]
+ ( 3 1 ) -> [10]
+ ( 2 1 ) -> [11.25]
+ ( 3 2 1 ) -> [12.5]
+ ( 2 1 0 ) -> [12.9959]
+ ( 6 5 ) -> [13.25]
+ ( 4 2 ) -> [20]
+ ( 6 4 ) -> [22.7367]
+ ( 6 5 4 ) -> [22.7367]
+ ( 6 3 ) -> [30.25]
diff --git a/src/Alpha_complex/example/alphaoffreader_for_doc_60.txt b/src/Alpha_complex/example/alphaoffreader_for_doc_60.txt
index 1d17a58a..71f29a00 100644
--- a/src/Alpha_complex/example/alphaoffreader_for_doc_60.txt
+++ b/src/Alpha_complex/example/alphaoffreader_for_doc_60.txt
@@ -7,21 +7,21 @@ Iterator on alpha complex simplices in the filtration order, with [filtration va
( 4 ) -> [0]
( 5 ) -> [0]
( 6 ) -> [0]
- ( 5 4 ) -> [6.25]
- ( 3 1 ) -> [7.25]
- ( 4 2 ) -> [8.5]
- ( 6 2 ) -> [9.25]
- ( 6 5 ) -> [10]
- ( 6 4 ) -> [11.25]
- ( 6 5 4 ) -> [12.5]
- ( 6 4 2 ) -> [12.9959]
- ( 3 0 ) -> [13.25]
- ( 4 1 ) -> [20]
- ( 1 0 ) -> [22.7367]
- ( 3 1 0 ) -> [22.7367]
- ( 5 0 ) -> [30.25]
- ( 4 0 ) -> [36.5]
- ( 5 4 0 ) -> [36.5]
- ( 4 1 0 ) -> [37.2449]
- ( 2 1 ) -> [59.7107]
- ( 4 2 1 ) -> [59.7107]
+ ( 3 2 ) -> [6.25]
+ ( 5 4 ) -> [7.25]
+ ( 2 0 ) -> [8.5]
+ ( 1 0 ) -> [9.25]
+ ( 3 1 ) -> [10]
+ ( 2 1 ) -> [11.25]
+ ( 3 2 1 ) -> [12.5]
+ ( 2 1 0 ) -> [12.9959]
+ ( 6 5 ) -> [13.25]
+ ( 4 2 ) -> [20]
+ ( 6 4 ) -> [22.7367]
+ ( 6 5 4 ) -> [22.7367]
+ ( 6 3 ) -> [30.25]
+ ( 6 2 ) -> [36.5]
+ ( 6 3 2 ) -> [36.5]
+ ( 6 4 2 ) -> [37.2449]
+ ( 4 0 ) -> [59.7107]
+ ( 4 2 0 ) -> [59.7107]