pub trait DecompositionAlgo<C>
where C: Column,
{ type Options: Default + Copy; type Decomposition: Decomposition<C>; // Required methods fn init(options: Option<Self::Options>) -> Self; fn add_cols(self, cols: impl Iterator<Item = C>) -> Self; fn add_entries(self, entries: impl Iterator<Item = (usize, usize)>) -> Self; fn decompose(self) -> Self::Decomposition; }
Expand description

A struct implementing this trait implements an algorithm for computing the R=DV decomposition of a matrix D.

The struct is initialised via the init method, in which options for the algorithm are provided. The D matrix is build up by using the add_cols and add_entries methods. Once constructed, the decomposition is computed via the decompose methods

Required Associated Types§

source

type Options: Default + Copy

A struct of options that you wish to provide to the algorithm.

source

type Decomposition: Decomposition<C>

Return tupe of decompose – should carry sufficient information to query columns of the resulting decomposition.

Required Methods§

source

fn init(options: Option<Self::Options>) -> Self

Initialise the algorithm with the options provided and an empty input matrix

source

fn add_cols(self, cols: impl Iterator<Item = C>) -> Self

Push the provided columns onto the end of the matrix

source

fn add_entries(self, entries: impl Iterator<Item = (usize, usize)>) -> Self

Add the provided (row, column) entries to the matrix. If the column has not already been pushed via add_cols then panic!()

source

fn decompose(self) -> Self::Decomposition

Decomposes the built-up matrix (D) into an R=DV decomposition, following the relevant algorithm and provided options.

Object Safety§

This trait is not object safe.

Implementors§