Enum spade::kernels::FloatKernel
source · pub enum FloatKernel {}
Expand description
Offers a fast, precise kernel working with f64
or f32
coordinates.
Performing a delaunay triangulation is often a tradeoff between accuracy and speed:
a triangulation working on native floating point-operations will fail in some cases
due to rounding errors, while switching to precise floats (like BigRationals
from the num
crate) reduces performance by several orders of magnitude.
This kernel works with adaptive precision: if a calculation is inaccurate,
it will increase its precision until the result is accurate enough. Since most calculations
are accurate enough in their simplest form, only the overhead of checking the precision is
usually encountered. For more information, refer to
this link describing the techniques behind
the adaptive approach.
Note
When used with f32
coordinates, they will be casted into f64
before the calculation
starts. Thus, the performance is the same for both f64
and f32
. Only the space
requirements for storing the coordinates differ.
Trait Implementations
sourceimpl Clone for FloatKernel
impl Clone for FloatKernel
sourcefn clone(&self) -> FloatKernel
fn clone(&self) -> FloatKernel
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl<S> DelaunayKernel<S> for FloatKernelwhere
S: FromPrimitive + SpadeFloat,
impl<S> DelaunayKernel<S> for FloatKernelwhere
S: FromPrimitive + SpadeFloat,
sourcefn contained_in_circumference<V: TwoDimensional<Scalar = S>>(
v1: &V,
v2: &V,
v3: &V,
p: &V
) -> bool
fn contained_in_circumference<V: TwoDimensional<Scalar = S>>(
v1: &V,
v2: &V,
v3: &V,
p: &V
) -> bool
sourcefn side_query<V: TwoDimensional<Scalar = S>>(
edge: &SimpleEdge<V>,
position: &V
) -> EdgeSideInfo<S>
fn side_query<V: TwoDimensional<Scalar = S>>(
edge: &SimpleEdge<V>,
position: &V
) -> EdgeSideInfo<S>
EdgeSideInfo
yielding on which side of a line a point lies.sourcefn is_ordered_ccw<V: TwoDimensional<Scalar = D>>(v0: &V, v1: &V, v2: &V) -> bool
fn is_ordered_ccw<V: TwoDimensional<Scalar = D>>(v0: &V, v1: &V, v2: &V) -> bool
side_query
, will return true
if v0
, v1
and v2
are ordered
counterclockwise. Read moresourcefn point_on_edge<V: TwoDimensional<Scalar = D>>(
edge: &SimpleEdge<V>,
position: &V
) -> bool
fn point_on_edge<V: TwoDimensional<Scalar = D>>(
edge: &SimpleEdge<V>,
position: &V
) -> bool
Auto Trait Implementations
impl RefUnwindSafe for FloatKernel
impl Send for FloatKernel
impl Sync for FloatKernel
impl Unpin for FloatKernel
impl UnwindSafe for FloatKernel
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read morefn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.