diff options
author | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2018-09-07 14:17:13 +0000 |
---|---|---|
committer | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2018-09-07 14:17:13 +0000 |
commit | 35fee4017481fd3f62fceb76a1b2bc8cd0f15b95 (patch) | |
tree | 5ba9cc138d6d900be30c46ea8c7e82b198cce1f5 /src/Alpha_complex/example | |
parent | 2cbaaab0cc07057542594bdd31655442acdf2fa6 (diff) |
Code review : rearrange documentation and examples according to making choices more orthogonal
Rename Alpha_complex_3d_options.h Alpha_complex_options.h as it can be used by Alpha complex dD
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/alpha_complex_3d_module_vincent@3875 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: 6c5b105248e4766a44438a187bb130a3722b310f
Diffstat (limited to 'src/Alpha_complex/example')
-rw-r--r-- | src/Alpha_complex/example/Weighted_alpha_complex_3d_from_points.cpp | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/src/Alpha_complex/example/Weighted_alpha_complex_3d_from_points.cpp b/src/Alpha_complex/example/Weighted_alpha_complex_3d_from_points.cpp index 1b60ccd8..61ceab6d 100644 --- a/src/Alpha_complex/example/Weighted_alpha_complex_3d_from_points.cpp +++ b/src/Alpha_complex/example/Weighted_alpha_complex_3d_from_points.cpp @@ -1,5 +1,4 @@ #include <gudhi/Alpha_complex_3d.h> -#include <gudhi/Alpha_complex_3d_options.h> // to construct a simplex_tree from alpha complex #include <gudhi/Simplex_tree.h> @@ -9,8 +8,9 @@ #include <limits> // for numeric limits using Weighted_alpha_complex_3d = Gudhi::alpha_complex::Alpha_complex_3d<Gudhi::alpha_complex::complexity::exact, true, false>; -using Point = Weighted_alpha_complex_3d::Point_3 ; -using Vector_of_points = std::vector<Point>; +using Point = Weighted_alpha_complex_3d::Point_3; +using Weighted_point = Weighted_alpha_complex_3d::Triangulation_3::Weighted_point; +using Vector_of_weighted_points = std::vector<Weighted_point>; using Vector_of_weights = std::vector<Weighted_alpha_complex_3d::Alpha_shape_3::FT>; int main(int argc, char **argv) { @@ -23,23 +23,17 @@ int main(int argc, char **argv) { // ---------------------------------------------------------------------------- // Init of a list of points and weights from a small molecule // ---------------------------------------------------------------------------- - Vector_of_points points; - Vector_of_weights weights; - points.push_back(Point(1, -1, -1)); - weights.push_back(4.); - points.push_back(Point(-1, 1, -1)); - weights.push_back(4.); - points.push_back(Point(-1, -1, 1)); - weights.push_back(4.); - points.push_back(Point(1, 1, 1)); - weights.push_back(4.); - points.push_back(Point(2, 2, 2)); - weights.push_back(1.); + Vector_of_weighted_points weighted_points; + weighted_points.push_back(Weighted_point(Point(1, -1, -1), 4.)); + weighted_points.push_back(Weighted_point(Point(-1, 1, -1), 4.)); + weighted_points.push_back(Weighted_point(Point(-1, -1, 1), 4.)); + weighted_points.push_back(Weighted_point(Point(1, 1, 1), 4.)); + weighted_points.push_back(Weighted_point(Point(2, 2, 2), 1.)); // ---------------------------------------------------------------------------- // Init of an alpha complex from the list of points // ---------------------------------------------------------------------------- - Weighted_alpha_complex_3d alpha_complex_from_points(points, weights); + Weighted_alpha_complex_3d alpha_complex_from_points(weighted_points); Gudhi::Simplex_tree<> simplex; if (alpha_complex_from_points.create_complex(simplex)) { |