#[non_exhaustive]pub enum Engine {
Auto,
Dense,
Sparse,
}Expand description
Which engine reduces a dense input.
A dense matrix can be reduced as it stands, or converted to the graph
of its edges at the threshold and reduced by the sparse engine. The
second is faster when few pairs are edges, because the sparse
enumerator walks a neighbor list where the dense one scans every
vertex. Auto picks between them from the edge density at the resolved
threshold and from the memory the conversion would take; Dense and
Sparse force one.
The diagram is identical under all three, bit for bit. Every simplex of the complex has diameter at most the threshold, and a diameter is the largest of the edge lengths, so every edge of every simplex survives the conversion. The conversion keeps only edges at or below the threshold. The vertex set carries over because the conversion passes the point count explicitly.
An infinite threshold reads as f64::MAX in both engines. An absent
pair has distance +inf, so it enters neither complex, and the
conversion keeps exactly the pairs the dense engine admits.
The rule and its constants were frozen on 2026-08-18 from disclosed engineering data. Performance assessment is WIP.
A sparse input is never routed, so this setting does not reach
crate::rips_persistence_sparse. With RipsParams::collapse_edges set,
the collapse already produces a graph and the sparse engine reduces it.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Auto
Reduce a low-density dense input with the sparse engine, and every other dense input with the dense engine. The rule takes no argument. The conversion has a memory budget: 32 MiB, or the bytes of the compact matrix, whichever is larger. A matrix of mostly absent pairs is low-density at any threshold, including an infinite one, so it routes too.
Dense
Always reduce the distance matrix as it stands.
Sparse
Always convert to the thresholded graph and reduce that. The
conversion costs one pass over the matrix. This is an explicit
request, so the Auto memory budget does not apply.
Trait Implementations§
impl Copy for Engine
impl Eq for Engine
impl StructuralPartialEq for Engine
Auto Trait Implementations§
impl Freeze for Engine
impl RefUnwindSafe for Engine
impl Send for Engine
impl Sync for Engine
impl Unpin for Engine
impl UnsafeUnpin for Engine
impl UnwindSafe for Engine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more