11#ifndef INCLUDE_ALPHA_COMPLEX_INTERFACE_H_
12#define INCLUDE_ALPHA_COMPLEX_INTERFACE_H_
14#include "Alpha_complex_factory.h"
15#include <gudhi/Alpha_complex_options.h>
17#include "Simplex_tree_interface.h"
26namespace alpha_complex {
28class Alpha_complex_interface {
30 Alpha_complex_interface(
const std::vector<std::vector<double>>& points,
bool fast_version,
bool exact_version)
32 fast_version_(fast_version),
33 exact_version_(exact_version) {
36 std::vector<double> get_point(
int vh) {
37 return alpha_ptr_->get_point(vh);
40 void create_simplex_tree(Simplex_tree_interface<>* simplex_tree,
double max_alpha_square,
41 bool default_filtration_value) {
42 if (points_.size() > 0) {
43 std::size_t dimension = points_[0].size();
44 if (dimension == 3 && !default_filtration_value) {
46 alpha_ptr_ = std::make_unique<Alphacomplex_3D<Gudhi::alpha_complex::complexity::FAST>>(points_);
47 else if (exact_version_)
48 alpha_ptr_ = std::make_unique<Alphacomplex_3D<Gudhi::alpha_complex::complexity::EXACT>>(points_);
50 alpha_ptr_ = std::make_unique<Alphacomplex_3D<Gudhi::alpha_complex::complexity::SAFE>>(points_);
51 if (!alpha_ptr_->create_simplex_tree(simplex_tree, max_alpha_square, default_filtration_value)) {
58 if (dimension != 3 || default_filtration_value) {
60 alpha_ptr_ = std::make_unique<Inexact_Alphacomplex_dD>(points_, exact_version_);
62 alpha_ptr_ = std::make_unique<Exact_Alphacomplex_dD>(points_, exact_version_);
64 alpha_ptr_->create_simplex_tree(simplex_tree, max_alpha_square, default_filtration_value);
70 std::unique_ptr<Abstract_alpha_complex> alpha_ptr_;
71 std::vector<std::vector<double>> points_;