summaryrefslogtreecommitdiff
path: root/src/Alpha_complex/example/Weighted_alpha_complex_3d_from_points.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Alpha_complex/example/Weighted_alpha_complex_3d_from_points.cpp')
-rw-r--r--src/Alpha_complex/example/Weighted_alpha_complex_3d_from_points.cpp26
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)) {