pub trait Matrix<T: Send + Sync>: Send + Sync {
type Row<'a>: Iterator<Item = T> + Send + Sync
where Self: 'a;
Show 19 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 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
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.
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.