summaryrefslogtreecommitdiff
path: root/src/python/include/Alpha_complex_interface.h
diff options
context:
space:
mode:
authorMarc Glisse <marc.glisse@inria.fr>2019-11-01 14:52:44 +0100
committerMarc Glisse <marc.glisse@inria.fr>2019-11-01 14:52:44 +0100
commit3e18343985f7d4439fb6acb879547e8fa11369f9 (patch)
tree9ac836b33827575c1ed2de3da47185589252a1e6 /src/python/include/Alpha_complex_interface.h
parent1e42426b292f4bdc40044eedda59bbb51e2ca851 (diff)
Use documented CGAL interfaces for Epick_d (or Epeck_d)
Diffstat (limited to 'src/python/include/Alpha_complex_interface.h')
-rw-r--r--src/python/include/Alpha_complex_interface.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/python/include/Alpha_complex_interface.h b/src/python/include/Alpha_complex_interface.h
index b3553d32..96353cc4 100644
--- a/src/python/include/Alpha_complex_interface.h
+++ b/src/python/include/Alpha_complex_interface.h
@@ -15,6 +15,8 @@
#include <gudhi/Alpha_complex.h>
#include <CGAL/Epick_d.h>
+#include <boost/range/adaptor/transformed.hpp>
+
#include "Simplex_tree_interface.h"
#include <iostream>
@@ -31,7 +33,10 @@ class Alpha_complex_interface {
public:
Alpha_complex_interface(const std::vector<std::vector<double>>& points) {
- alpha_complex_ = new Alpha_complex<Dynamic_kernel>(points);
+ auto mkpt = [](std::vector<double> const& vec){
+ return Point_d(vec.size(), vec.begin(), vec.end());
+ };
+ alpha_complex_ = new Alpha_complex<Dynamic_kernel>(boost::adaptors::transform(points, mkpt));
}
Alpha_complex_interface(const std::string& off_file_name, bool from_file = true) {
@@ -45,9 +50,9 @@ class Alpha_complex_interface {
std::vector<double> get_point(int vh) {
std::vector<double> vd;
try {
- Point_d ph = alpha_complex_->get_point(vh);
+ Point_d const& ph = alpha_complex_->get_point(vh);
for (auto coord = ph.cartesian_begin(); coord < ph.cartesian_end(); coord++)
- vd.push_back(*coord);
+ vd.push_back(CGAL::to_double(*coord));
} catch (std::out_of_range const&) {
// std::out_of_range is thrown in case not found. Other exceptions must be re-thrown
}