11 #ifndef INCLUDE_EUCLIDEAN_WITNESS_COMPLEX_INTERFACE_H_
12 #define INCLUDE_EUCLIDEAN_WITNESS_COMPLEX_INTERFACE_H_
14 #include <gudhi/Simplex_tree.h>
15 #include <gudhi/Euclidean_witness_complex.h>
17 #include "Simplex_tree_interface.h"
19 #include <CGAL/Epick_d.h>
28 namespace witness_complex {
31 class Euclidean_witness_complex_interface {
32 using Dynamic_kernel = CGAL::Epick_d< CGAL::Dynamic_dimension_tag >;
33 using Point_d = Dynamic_kernel::Point_d;
38 Euclidean_witness_complex_interface(
const std::vector<std::vector<double>>& landmarks,
39 const std::vector<std::vector<double>>& witnesses) {
40 landmarks_.reserve(landmarks.size());
41 for (
auto& landmark : landmarks)
42 landmarks_.emplace_back(landmark.begin(), landmark.end());
43 witness_complex_ =
new Euclidean_witness_complex<Dynamic_kernel>(landmarks_, witnesses);
46 ~Euclidean_witness_complex_interface() {
47 delete witness_complex_;
50 void create_simplex_tree(
Gudhi::Simplex_tree<>* simplex_tree,
double max_alpha_square, std::size_t limit_dimension) {
51 witness_complex_->create_complex(*simplex_tree, max_alpha_square, limit_dimension);
55 witness_complex_->create_complex(*simplex_tree, max_alpha_square);
58 std::vector<double> get_point(
unsigned vh) {
59 std::vector<double> vd;
60 if (vh < landmarks_.size()) {
61 Point_d ph = witness_complex_->get_point(vh);
62 for (
auto coord = ph.cartesian_begin(); coord < ph.cartesian_end(); coord++)
69 std::vector<Point_d> landmarks_;
70 Euclidean_witness_complex<Dynamic_kernel>* witness_complex_;
Simplex Tree data structure for representing simplicial complexes.
Definition: Simplex_tree.h:75
Options::Simplex_key Simplex_key
Key associated to each simplex.
Definition: Simplex_tree.h:86