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§
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>
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,
sourcefn vertically_packed_row<P>(&self, r: usize) -> impl Iterator<Item = P>where
P: PackedValue<Value = T>,
fn vertically_packed_row<P>(&self, r: usize) -> impl Iterator<Item = P>where
P: PackedValue<Value = T>,
Wraps at the end.
fn vertically_strided(
self,
stride: usize,
offset: usize,
) -> VerticallyStridedMatrixView<Self>where
Self: Sized,
sourcefn columnwise_dot_product<EF>(&self, v: &[EF]) -> Vec<EF>where
T: Field,
EF: ExtensionField<T>,
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.