pub trait Matrix<T: Send + Sync>: Send + Sync {
type Row<'a>: Iterator<Item = T> + Send + Sync
where Self: 'a;
Show 20 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> + Send + Sync, impl Iterator<Item = T> + Send + Sync)
where P: PackedValue<Value = T>,
T: Clone + 'a { ... }
fn padded_horizontally_packed_row<'a, P>(
&'a self,
r: usize,
) -> impl Iterator<Item = P> + Send + Sync
where P: PackedValue<Value = T>,
T: Clone + Default + 'a { ... }
fn par_horizontally_packed_rows<'a, P>(
&'a self,
) -> impl IndexedParallelIterator<Item = (impl Iterator<Item = P> + Send + Sync, impl Iterator<Item = T> + Send + Sync)>
where P: PackedValue<Value = T>,
T: Clone + 'a { ... }
fn par_padded_horizontally_packed_rows<'a, P>(
&'a self,
) -> impl IndexedParallelIterator<Item = impl Iterator<Item = P> + Send + Sync>
where P: PackedValue<Value = T>,
T: Clone + Default + 'a { ... }
fn vertically_packed_row<P>(&self, r: usize) -> impl Iterator<Item = P>
where T: Copy,
P: PackedValue<Value = T> { ... }
fn vertically_packed_row_pair<P>(&self, r: usize, step: usize) -> Vec<P>
where T: Copy,
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> { ... }
fn dot_ext_powers<EF>(
&self,
base: EF,
) -> impl IndexedParallelIterator<Item = 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> + Send + Sync, impl Iterator<Item = T> + Send + Sync)where
P: PackedValue<Value = T>,
T: Clone + 'a,
Sourcefn padded_horizontally_packed_row<'a, P>(
&'a self,
r: usize,
) -> impl Iterator<Item = P> + Send + Sync
fn padded_horizontally_packed_row<'a, P>( &'a self, r: usize, ) -> impl Iterator<Item = P> + Send + Sync
Zero padded.
fn par_horizontally_packed_rows<'a, P>(
&'a self,
) -> impl IndexedParallelIterator<Item = (impl Iterator<Item = P> + Send + Sync, impl Iterator<Item = T> + Send + Sync)>where
P: PackedValue<Value = T>,
T: Clone + 'a,
fn par_padded_horizontally_packed_rows<'a, P>( &'a self, ) -> impl IndexedParallelIterator<Item = impl Iterator<Item = P> + Send + Sync>
Sourcefn vertically_packed_row<P>(&self, r: usize) -> impl Iterator<Item = P>where
T: Copy,
P: PackedValue<Value = T>,
fn vertically_packed_row<P>(&self, r: usize) -> impl Iterator<Item = P>where
T: Copy,
P: PackedValue<Value = T>,
Pack together a collection of adjacent rows from the matrix.
Returns an iterator whose i’th element is packing of the i’th element of the rows r through r + P::WIDTH - 1. If we exceed the height of the matrix, wrap around and include initial rows.
Sourcefn vertically_packed_row_pair<P>(&self, r: usize, step: usize) -> Vec<P>where
T: Copy,
P: PackedValue<Value = T>,
fn vertically_packed_row_pair<P>(&self, r: usize, step: usize) -> Vec<P>where
T: Copy,
P: PackedValue<Value = T>,
Pack together a collection of rows and “next” rows from the matrix.
Returns a vector corresponding to 2 packed rows. The i’th element of the first row contains the packing of the i’th element of the rows r through r + P::WIDTH - 1. The i’th element of the second row contains the packing of the i’th element of the rows r + step through r + step + P::WIDTH - 1. If at some point we exceed the height of the matrix, wrap around and include initial rows.
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 sum across rows.
v
can be a vector of extension elements.
Sourcefn dot_ext_powers<EF>(
&self,
base: EF,
) -> impl IndexedParallelIterator<Item = EF>where
T: Field,
EF: ExtensionField<T>,
fn dot_ext_powers<EF>(
&self,
base: EF,
) -> impl IndexedParallelIterator<Item = EF>where
T: Field,
EF: ExtensionField<T>,
Multiply this matrix by the vector of powers of base
, which is an extension element.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.