Skip to main content

CandidateMatrixSource

Trait CandidateMatrixSource 

Source
pub trait CandidateMatrixSource<T: Scalar> {
    // Required methods
    fn nrows(&self) -> usize;
    fn ncols(&self) -> usize;
    fn get_block(&self, rows: &[usize], cols: &[usize], out: &mut [T]);

    // Provided methods
    fn dense_column_major_slice(&self) -> Option<&[T]> { ... }
    fn get(&self, row: usize, col: usize) -> T { ... }
}
Expand description

Abstraction for accessing a matrix that will be cross-interpolated.

Implementors provide block-level access (filling column-major sub-blocks) so that kernels can select pivots without materializing the full matrix.

Required Methods§

Source

fn nrows(&self) -> usize

Number of rows.

Source

fn ncols(&self) -> usize

Number of columns.

Source

fn get_block(&self, rows: &[usize], cols: &[usize], out: &mut [T])

Fill out with the cross-product A[rows, cols] in column-major order.

Provided Methods§

Source

fn dense_column_major_slice(&self) -> Option<&[T]>

Borrow the whole matrix in column-major layout when available.

Source

fn get(&self, row: usize, col: usize) -> T

Read a single matrix entry.

Implementors§

Source§

impl<T: Scalar> CandidateMatrixSource<T> for DenseMatrixSource<'_, T>

Source§

impl<T: Scalar, F> CandidateMatrixSource<T> for LazyMatrixSource<T, F>
where F: Fn(&[usize], &[usize], &mut [T]),