Skip to main content

RipsParams

Struct RipsParams 

Source
#[non_exhaustive]
pub struct RipsParams {
Show 14 fields pub max_dim: usize, pub threshold: Option<f64>, pub modulus: u32, pub threads: usize, pub use_emergent_pairs: bool, pub use_apparent_pairs: bool, pub use_clearing: bool, pub use_adjacency_rows: bool, pub collapse_edges: bool, pub collapse_schedule: CollapseSchedule, pub adaptive_collapse: AdaptiveCollapseParams, pub engine: Engine, pub dense_storage: DenseStorage, pub factorization: GraphFactorization,
}
Expand description

Parameters for crate::rips_persistence.

The engine is dimension-generic. The differential gates cover max_dim <= 2. Stress tests extend through dimension 4.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§max_dim: usize

Highest homology dimension to compute.

§threshold: Option<f64>

Filtration threshold. None means the input’s default: the enclosing radius for dense matrices, no threshold for sparse ones.

§modulus: u32

Coefficient field Z/p; must be a prime below 32768. Default 2.

§threads: usize

Worker threads for the run. 0 and 1 (the default) both run the serial engine. Higher values reduce each dimension concurrently. With RipsParams::collapse_edges set and the ordered or rounds RipsParams::collapse_schedule, threads is the budget for the whole pipeline. The diagram is identical at any thread count.

§use_emergent_pairs: bool

Optimization toggle. The diagram is identical with any combination disabled. For differential testing only.

§use_apparent_pairs: bool§use_clearing: bool§use_adjacency_rows: bool

See RipsParams::use_emergent_pairs. With this set, and the graph dense enough for the rows to fit their memory budget, the dim-0 apparent test runs on adjacency bitsets instead of the neighbor lists.

§collapse_edges: bool

Collapse dominated edges before the engine runs. Off by default. The diagram is identical either way. See collapse.

§collapse_schedule: CollapseSchedule

The schedule the collapse uses with collapse_edges set. Default CollapseSchedule::Serial. See CollapseSchedule.

§adaptive_collapse: AdaptiveCollapseParams

Objective and deterministic work limit for CollapseSchedule::Adaptive. Other schedules ignore this field.

§engine: Engine

Which engine reduces a dense input. Default Engine::Auto. See Engine.

§dense_storage: DenseStorage

Which storage form the dense engine reduces from. Default DenseStorage::Auto. See DenseStorage.

§factorization: GraphFactorization

Structural decomposition of a sparse terminal graph. Default GraphFactorization::Off. Dense runs use it only after routing to the sparse engine. See GraphFactorization.

Implementations§

Source§

impl RipsParams

Source

pub fn new(max_dim: usize) -> Self

Defaults with the given max_dim.

The threshold is the input’s default. Reduction shortcuts are on. Edge collapse and structural factorization are off.

Source

pub fn with_threshold(self, threshold: f64) -> Self

Truncate the filtration at threshold.

Source

pub fn with_modulus(self, modulus: u32) -> Self

Compute over Z/p instead of Z/2. modulus must be a prime below 32768.

Source

pub fn with_threads(self, threads: usize) -> Self

Reduce with threads workers. 1 keeps the serial engine. The diagram is identical at any thread count.

Source

pub fn with_edge_collapse(self) -> Self

Collapse dominated edges before the engine runs. The diagram is identical either way. See collapse.

Source

pub fn with_collapse_schedule(self, schedule: CollapseSchedule) -> Self

Collapse dominated edges with the given schedule before the engine runs. Also sets RipsParams::collapse_edges. See CollapseSchedule.

Source

pub fn with_adaptive_collapse(self, params: AdaptiveCollapseParams) -> Self

Collapse with the adaptive version 3 schedule and the given objective and work limit.

Source

pub fn with_engine(self, engine: Engine) -> Self

Choose the engine for a dense input. See Engine.

Source

pub fn with_dense_storage(self, storage: DenseStorage) -> Self

Choose the storage form the dense engine reduces from. See DenseStorage.

Source

pub fn with_factorization(self, factorization: GraphFactorization) -> Self

Choose structural factorization for sparse reduction. See GraphFactorization.

Trait Implementations§

Source§

impl Clone for RipsParams

Source§

fn clone(&self) -> RipsParams

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RipsParams

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for RipsParams

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.