Skip to main content

ColumnSource

Trait ColumnSource 

Source
pub trait ColumnSource<T: Real> {
    // Required methods
    fn m(&self) -> usize;
    fn for_each_entry<F: FnMut(u32, T)>(&self, k: usize, f: F);
    fn nnz_hint(&self) -> usize;
    fn validate(&self) -> Result<(), SparseError>;
}
Expand description

Where the factorization reads the columns of B from (the contract’s ColumnSource). Static dispatch only: crate::LuFactor::factorize is generic in the source, and ColumnSource::for_each_entry takes a generic visitor.

Required Methods§

Source

fn m(&self) -> usize

Order m of B (its number of columns).

Source

fn for_each_entry<F: FnMut(u32, T)>(&self, k: usize, f: F)

Calls f(i, b_ik) for every stored entry of column k, rows increasing for structural columns.

Source

fn nnz_hint(&self) -> usize

Upper bound on the nonzeros of B (an allocation hint).

Source

fn validate(&self) -> Result<(), SparseError>

Checks that the source describes a square m × m matrix whose references are in range (invariant (B1)).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T: Real> ColumnSource<T> for (&[ColumnRef], &CscMatrix<T>)

The simplex basis: the heading cols over [A | ±I].

Source§

fn m(&self) -> usize

Source§

fn for_each_entry<F: FnMut(u32, T)>(&self, k: usize, f: F)

Source§

fn nnz_hint(&self) -> usize

Source§

fn validate(&self) -> Result<(), SparseError>

Implementors§

Source§

impl<T: Real> ColumnSource<T> for CscMatrix<T>

An explicit square matrix B.