48 using Point_d =
typename Kernel::Point_d;
49 using FT =
typename Kernel::FT;
50 using Sphere = std::pair<Point_d, FT>;
59 std::vector<Sphere> cache_;
60 std::vector<Point_d> pts;
61 CGAL::NT_converter<FT, Filtration_value> cvt;
64 if(std::begin(points) == std::end(points)) {
68 int ambient_dim = k.point_dimension_d_object()(*std::begin(points));
70 auto fun = [&](Simplex_handle sh,
int dim){
77 auto vert_it = verts.begin();
78 Vertex_handle u = *vert_it;
79 Vertex_handle v = *++vert_it;
80 auto&& pu = points[u];
81 Point_d m = k.midpoint_d_object()(pu, points[v]);
82 FT r = k.squared_distance_d_object()(m, pu);
83 if (exact) CGAL::exact(r);
85 Filtration_value filt{max(cvt(r), Filtration_value(0))};
86 if constexpr (!Output_squared_values)
89 cache_.emplace_back(std::move(m), std::move(r));
90 }
else if (dim > ambient_dim) {
92 Filtration_value maxf = 0;
93 for (
auto face : complex.boundary_simplex_range(sh)) {
98 Filtration_value maxf = 0;
101 maxf = max(maxf, complex.
filtration(face_opposite_vertex.first));
103 auto key = complex.
key(face_opposite_vertex.first);
104 Sphere
const& sph = cache_[key];
105 if (k.squared_distance_d_object()(sph.first, points[face_opposite_vertex.second]) > sph.second)
continue;
117 pts.push_back(points[vertex]);
118 Point_d c = k.construct_circumcenter_d_object()(pts.begin(), pts.end());
119 FT r = k.squared_distance_d_object()(c, pts.front());
120 if (exact) CGAL::exact(r);
125 Filtration_value filt{cvt(r)};
126 if constexpr (!Output_squared_values)
127 filt = sqrt(max(filt, Filtration_value(0)));
129 maxf = max(maxf, filt);
132 cache_.emplace_back(std::move(c), std::move(r));
void assign_MEB_filtration(Kernel &&k, SimplicialComplexForMEB &complex, PointRange const &points, bool exact=false)
Given a simplicial complex and an embedding of its vertices, this assigns to each simplex a filtratio...
Definition MEB_filtration.h:47
unspecified Vertex_handle
Handle for a vertex. Must be a non-negative integer, it is also used as an index into the input list ...
Definition SimplicialComplexForMEB.h:27