Trait p3_matrix::Matrix

source ·
pub trait Matrix<T: Send + Sync>: Send + Sync {
    type Row<'a>: Iterator<Item = T> + Send + Sync
       where Self: 'a;

Show 15 methods // Required methods fn width(&self) -> usize; fn height(&self) -> usize; fn row(&self, r: usize) -> Self::Row<'_>; // Provided methods fn dimensions(&self) -> Dimensions { ... } fn get(&self, r: usize, c: usize) -> T { ... } fn rows(&self) -> impl Iterator<Item = Self::Row<'_>> { ... } fn par_rows(&self) -> impl IndexedParallelIterator<Item = Self::Row<'_>> { ... } fn row_slice(&self, r: usize) -> impl Deref<Target = [T]> { ... } fn first_row(&self) -> Self::Row<'_> { ... } fn last_row(&self) -> Self::Row<'_> { ... } fn to_row_major_matrix(self) -> RowMajorMatrix<T> where Self: Sized, T: Clone { ... } fn horizontally_packed_row<'a, P>( &'a self, r: usize, ) -> (impl Iterator<Item = P>, impl Iterator<Item = T>) where P: PackedValue<Value = T>, T: Clone + 'a { ... } fn vertically_packed_row<P>(&self, r: usize) -> impl Iterator<Item = P> where P: PackedValue<Value = T> { ... } fn vertically_strided( self, stride: usize, offset: usize, ) -> VerticallyStridedMatrixView<Self> where Self: Sized { ... } fn columnwise_dot_product<EF>(&self, v: &[EF]) -> Vec<EF> where T: Field, EF: ExtensionField<T> { ... }
}

Required Associated Types§

source

type Row<'a>: Iterator<Item = T> + Send + Sync where Self: 'a

Required Methods§

source

fn width(&self) -> usize

source

fn height(&self) -> usize

source

fn row(&self, r: usize) -> Self::Row<'_>

Provided Methods§

source

fn dimensions(&self) -> Dimensions

source

fn get(&self, r: usize, c: usize) -> T

source

fn rows(&self) -> impl Iterator<Item = Self::Row<'_>>

source

fn par_rows(&self) -> impl IndexedParallelIterator<Item = Self::Row<'_>>

source

fn row_slice(&self, r: usize) -> impl Deref<Target = [T]>

source

fn first_row(&self) -> Self::Row<'_>

source

fn last_row(&self) -> Self::Row<'_>

source

fn to_row_major_matrix(self) -> RowMajorMatrix<T>
where Self: Sized, T: Clone,

source

fn horizontally_packed_row<'a, P>( &'a self, r: usize, ) -> (impl Iterator<Item = P>, impl Iterator<Item = T>)
where P: PackedValue<Value = T>, T: Clone + 'a,

source

fn vertically_packed_row<P>(&self, r: usize) -> impl Iterator<Item = P>
where P: PackedValue<Value = T>,

Wraps at the end.

source

fn vertically_strided( self, stride: usize, offset: usize, ) -> VerticallyStridedMatrixView<Self>
where Self: Sized,

source

fn columnwise_dot_product<EF>(&self, v: &[EF]) -> Vec<EF>
where T: Field, EF: ExtensionField<T>,

Compute Mᵀv, aka premultiply this matrix by the given vector, aka scale each row by the corresponding entry in v and take the row-wise sum. v can be a vector of extension elements.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<F, EF, Inner> Matrix<F> for FlatMatrixView<F, EF, Inner>
where F: Field, EF: ExtensionField<F>, Inner: Matrix<EF>,

§

type Row<'a> = FlatIter<F, <Inner as Matrix<EF>>::Row<'a>> where Self: 'a

source§

impl<T: Clone + Default + Send + Sync> Matrix<T> for CsrMatrix<T>

§

type Row<'a> = <Vec<T> as IntoIterator>::IntoIter where Self: 'a

source§

impl<T: Clone + Send + Sync, S: DenseStorage<T>> Matrix<T> for DenseMatrix<T, S>

§

type Row<'a> = Cloned<Iter<'a, T>> where Self: 'a

source§

impl<T: Send + Sync, First: Matrix<T>, Second: Matrix<T>> Matrix<T> for VerticalPair<First, Second>

§

type Row<'a> = EitherRow<<First as Matrix<T>>::Row<'a>, <Second as Matrix<T>>::Row<'a>> where Self: 'a

source§

impl<T: Send + Sync, IndexMap: RowIndexMap, Inner: Matrix<T>> Matrix<T> for RowIndexMappedView<IndexMap, Inner>

§

type Row<'a> = <Inner as Matrix<T>>::Row<'a> where Self: 'a