23 #ifndef INCLUDE_EUCLIDEAN_WITNESS_COMPLEX_INTERFACE_H_ 24 #define INCLUDE_EUCLIDEAN_WITNESS_COMPLEX_INTERFACE_H_ 26 #include <gudhi/Simplex_tree.h> 27 #include <gudhi/Euclidean_witness_complex.h> 29 #include "Simplex_tree_interface.h" 31 #include <CGAL/Epick_d.h> 40 namespace witness_complex {
43 class Euclidean_witness_complex_interface {
44 using Dynamic_kernel = CGAL::Epick_d< CGAL::Dynamic_dimension_tag >;
45 using Point_d = Dynamic_kernel::Point_d;
50 Euclidean_witness_complex_interface(
const std::vector<std::vector<double>>& landmarks,
51 const std::vector<std::vector<double>>& witnesses) {
52 landmarks_.reserve(landmarks.size());
53 for (
auto& landmark : landmarks)
54 landmarks_.emplace_back(landmark.begin(), landmark.end());
55 witness_complex_ =
new Euclidean_witness_complex<Dynamic_kernel>(landmarks_, witnesses);
58 ~Euclidean_witness_complex_interface() {
59 delete witness_complex_;
62 void create_simplex_tree(
Gudhi::Simplex_tree<>* simplex_tree,
double max_alpha_square, std::size_t limit_dimension) {
63 witness_complex_->create_complex(*simplex_tree, max_alpha_square, limit_dimension);
68 witness_complex_->create_complex(*simplex_tree, max_alpha_square);
72 std::vector<double> get_point(
unsigned vh) {
73 std::vector<double> vd;
74 if (vh < landmarks_.size()) {
75 Point_d ph = witness_complex_->get_point(vh);
76 for (
auto coord = ph.cartesian_begin(); coord < ph.cartesian_end(); coord++)
83 std::vector<Point_d> landmarks_;
84 Euclidean_witness_complex<Dynamic_kernel>* witness_complex_;
91 #endif // INCLUDE_EUCLIDEAN_WITNESS_COMPLEX_INTERFACE_H_ Simplex Tree data structure for representing simplicial complexes.
Definition: Simplex_tree.h:72
Definition: SimplicialComplexForAlpha.h:26
Key type used as simplex identifier.
Definition: SimplexKey.h:27
void initialize_filtration()
Initializes the filtrations, i.e. sort the simplices according to their order in the filtration and i...
Definition: Simplex_tree.h:796