26 #ifndef EDELSBRUNNER96_SIMPLEX_H_
27 #define EDELSBRUNNER96_SIMPLEX_H_
32 #include <initializer_list>
36 #include <Eigen/Dense>
38 namespace edelsbrunner96 {
88 template<
class Traits>
90 typedef typename Traits::Scalar
Scalar;
91 typedef typename Traits::Point
Point;
106 std::array<PointRef, Traits::NDim + 1>
V;
109 std::array<SimplexRef, Traits::NDim + 1>
N;
118 template <
typename... PointRefs>
122 template <
typename Container>
127 void SetVertices(std::initializer_list<PointRef> refs);
147 Eigen::Matrix<typename Traits::Scalar, Traits::NDim, 1>
154 Eigen::Matrix<typename Traits::Scalar, Traits::NDim + 1, 1>
156 const typename Traits::Point& xq)
const;
160 bool Contains(
Storage& storage,
const typename Traits::Point& xq)
const;
167 template <
class Traits>
196 template <
class Traits,
class Derived,
class Iterator>
198 typename Traits::Storage& storage,
const typename Traits::Point&
x,
199 Iterator begin, Iterator end,
200 Eigen::MatrixBase<Derived>* L,
201 typename Traits::Point* x_proj);
218 template <
class Traits,
class OutputIterator>
220 typename Traits::Storage& storage,
221 const typename Traits::Point&
x,
222 const typename Traits::SimplexRef s_ref,
223 typename Traits::Point* x_proj,
224 OutputIterator V_out);
229 template <
class Traits>
234 typedef typename Traits::Point
Point;
243 template <
typename InputIterator>
247 for (InputIterator iter = begin; iter != end; iter++) {
249 BarycentricProjection<Traits>(storage,
x,
V_feature_.begin(),
251 if (
L_.minCoeff() >= 0) {
260 Compute(storage, x, iter + 1, end);
266 template <
typename OutputIterator>
275 Eigen::Matrix<Scalar, Eigen::Dynamic, 1, 0, Traits::NDim + 1, 1>
L_;
286 #endif // EDELSBRUNNER96_SIMPLEX_H_
std::bitset< simplex::NUM_BITS > MarkedVec
type for marked bit flags
std::vector< PointRef > V_best_feature_
std::array< PointRef, Traits::NDim+1 > V
simplex has been touched during a fuzzy walk
Traits::PointRef PointRef
Eigen::Matrix< typename Traits::Scalar, Traits::NDim+1, 1 > BarycentricCoordinates(Storage &storage, const typename Traits::Point &xq) const
Given a simplex as the convex hull of the points in V, compute the barycentric coordinates of the poi...
A convenience for setting vertices of a simplex.
Scalar r2
circumradius squared
std::array< SimplexRef, Traits::NDim+1 > N
neighbors, mapped to vertices
has been queud in breadth-first search
ExhaustiveSimplexDistance< Traits > & Compute(Storage &storage, const Point &x, InputIterator begin, InputIterator end)
is a member of the induced subcomplex
Eigen::Matrix< typename Traits::Scalar, Traits::NDim, 1 > CoordinatesOf(Storage &storage, const typename Traits::Point &xq) const
Given a simplex as the convex hull of the points in V, compute the coordinates of the point xq on the...
simplex has been touched during feature walk
MarkedBits
enum defining bits for various markings of a simplex
void SetNeighborAcross(PointRef q, SimplexRef n)
set the neighbor across the specified vertex
std::vector< PointRef > V_feature_
A simplex in the triangulation. A simplex is the convex hull of Ndim+1 points in R^NDim.
Computes the distance of a point to a simplex by expanding all combinations of vertices and evaluatin...
simplex has been touched during hull walk
Traits::PointRef PointRef
MarkedVec marked
flags for marking
void GetResult(Scalar *distance, Point *x_proj, OutputIterator V_out)
ExhaustiveSimplexDistance()
Traits::PointRef PointRef
void ComputeCenter(Storage &storage)
called after vertices are filled computes the circumcenter
SimplexBase()
initializes version and flags; in debug mode, also zeros out arrays
simpex is a member of the visible hull
bool Contains(Storage &storage, const typename Traits::Point &xq) const
Interference test, return true if the query point lies inside the closed hull of the point set...
simplex has been marked for removal
simplex has been removed during insertion of a point
Traits::SimplexRef SimplexRef
Char8_t * copy(const Char8_t *s)
queued in induced subcomplex search
void SetVertices(PointRefs...refs)
Set the vertices of a simplex directly from a list of point refs.
uint8_t IndexOf(PointRef v) const
return the index of the specified vertex
void PushBack(PointRef p)
void BarycentricProjection(typename Traits::Storage &storage, const typename Traits::Point &x, Iterator begin, Iterator end, Eigen::MatrixBase< Derived > *L, typename Traits::Point *x_proj)
Given a query point, x and a set of vertex points, V, return the point y in hull(V) which is closest ...
uint16_t version
incremented when flipped
SimplexRef NeighborAcross(PointRef q) const
return the neighbor across the specified vertex
Eigen::Matrix< Scalar, Eigen::Dynamic, 1, 0, Traits::NDim+1, 1 > L_
Traits::Scalar SimplexDistance(typename Traits::Storage &storage, const typename Traits::Point &x, const typename Traits::SimplexRef s_ref, typename Traits::Point *x_proj, OutputIterator V_out)
Given a set of <= NDim+1 vertices, compute the distance of the query point to the convex hull of the ...
simplex has been touched during line walk