pub trait Decomposition<C>
where C: Column,
{ type RColRef<'a>: Deref<Target = C> + 'a where Self: 'a; type VColRef<'a>: Deref<Target = C> + 'a where Self: 'a; // Required methods fn get_r_col<'a>(&'a self, index: usize) -> Self::RColRef<'a>; fn get_v_col<'a>( &'a self, index: usize ) -> Result<Self::VColRef<'a>, NoVMatrixError>; fn n_cols(&self) -> usize; // Provided methods fn diagram(&self) -> PersistenceDiagram { ... } fn has_v(&self) -> bool { ... } }
Expand description

A struct implementing this trait represents the output of an R=DV decomposition of a matrix D and is typically constructed by DecompositionAlgo::decompose.

The main required methods are get_r_col and get_v_col, which return immutable references to columns of the R and V matrix respectively. Given these methods, the persistence diagram can be computed via the provided diagram method.

Required Associated Types§

source

type RColRef<'a>: Deref<Target = C> + 'a where Self: 'a

Return type of get_r_col, typically &'a C.

source

type VColRef<'a>: Deref<Target = C> + 'a where Self: 'a

Return type of get_v_col, typically &'a C.

Required Methods§

source

fn get_r_col<'a>(&'a self, index: usize) -> Self::RColRef<'a>

Returns a reference to the column in position index of R, in the decomposition

source

fn get_v_col<'a>( &'a self, index: usize ) -> Result<Self::VColRef<'a>, NoVMatrixError>

Returns a reference to the column in position index of V, in the decomposition. Returns NoVMatrixError if V was not maintained by the algorithm.

source

fn n_cols(&self) -> usize

Returns the number of column in R (equal to the number of columns in D).

Provided Methods§

source

fn diagram(&self) -> PersistenceDiagram

Uses the methods implemented by this trait to read-off the column pairings which constiute the persistence diagram.

source

fn has_v(&self) -> bool

By checking whether self.get_v_col(0) returns an error, determines whether the V matrix was maintained for this decomposition.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Decomposition<VecColumn> for DecompositionFileFormat

§

type RColRef<'a> = &'a VecColumn where Self: 'a

§

type VColRef<'a> = &'a VecColumn where Self: 'a

source§

impl<C: Column + 'static> Decomposition<C> for LockFreeDecomposition<C>

§

type RColRef<'a> = LockFreeRRef<C>

§

type VColRef<'a> = LockFreeVRef<C>

source§

impl<C: Column + 'static> Decomposition<C> for LockingDecomposition<C>

§

type RColRef<'a> = LockingRRef<'a, C> where Self: 'a

§

type VColRef<'a> = LockingVRef<'a, C> where Self: 'a

source§

impl<C: Column> Decomposition<C> for SerialDecomposition<C>

§

type RColRef<'a> = &'a C where Self: 'a

§

type VColRef<'a> = &'a C where Self: 'a