Struct FlatMatrixView

Source
pub struct FlatMatrixView<F, EF, Inner>(/* private fields */);
Expand description

A view that flattens a matrix of extension field elements into a matrix of base field elements.

Each element of the original matrix is an extension field element EF, composed of several base field elements F. This view expands each EF element into its base field components, effectively increasing the number of columns (width) while keeping the number of rows unchanged.

Implementations§

Source§

impl<F, EF, Inner> FlatMatrixView<F, EF, Inner>

Source

pub const fn new(inner: Inner) -> Self

Trait Implementations§

Source§

impl<F: Debug, EF: Debug, Inner: Debug> Debug for FlatMatrixView<F, EF, Inner>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<F, EF, Inner> Deref for FlatMatrixView<F, EF, Inner>

Source§

type Target = Inner

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

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

Source§

fn width(&self) -> usize

Returns the number of columns in the matrix.
Source§

fn height(&self) -> usize

Returns the number of rows in the matrix.
Source§

unsafe fn get_unchecked(&self, r: usize, c: usize) -> F

Returns the element at the given row and column. Read more
Source§

unsafe fn row_unchecked( &self, r: usize, ) -> impl IntoIterator<Item = F, IntoIter = impl Iterator<Item = F> + Send + Sync>

Returns an iterator over the elements of the r-th row. Read more
Source§

unsafe fn row_subseq_unchecked( &self, r: usize, start: usize, end: usize, ) -> impl IntoIterator<Item = F, IntoIter = impl Iterator<Item = F> + Send + Sync>

Returns an iterator over the elements of the r-th row from position start to end. Read more
Source§

unsafe fn row_slice_unchecked(&self, r: usize) -> impl Deref<Target = [F]>

Returns the elements of the r-th row as something which can be coerced to a slice. Read more
Source§

fn dimensions(&self) -> Dimensions

Returns the dimensions (width, height) of the matrix.
Source§

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

Returns the element at the given row and column. Read more
Source§

fn row( &self, r: usize, ) -> Option<impl IntoIterator<Item = T, IntoIter = impl Iterator<Item = T> + Send + Sync>>

Returns an iterator over the elements of the r-th row. Read more
Source§

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

Returns the elements of the r-th row as something which can be coerced to a slice. Read more
Source§

unsafe fn row_subslice_unchecked( &self, r: usize, start: usize, end: usize, ) -> impl Deref<Target = [T]>

Returns a subset of elements of the r-th row as something which can be coerced to a slice. Read more
Source§

fn rows(&self) -> impl Iterator<Item = impl Iterator<Item = T>> + Send + Sync

Returns an iterator over all rows in the matrix.
Source§

fn par_rows( &self, ) -> impl IndexedParallelIterator<Item = impl Iterator<Item = T>> + Send + Sync

Returns a parallel iterator over all rows in the matrix.
Source§

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

Collect the elements of the rows r through r + c. If anything is larger than self.height() simply wrap around to the beginning of the matrix.
Source§

fn first_row( &self, ) -> Option<impl IntoIterator<Item = T, IntoIter = impl Iterator<Item = T> + Send + Sync>>

Returns an iterator over the first row of the matrix. Read more
Source§

fn last_row( &self, ) -> Option<impl IntoIterator<Item = T, IntoIter = impl Iterator<Item = T> + Send + Sync>>

Returns an iterator over the last row of the matrix. Read more
Source§

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

Converts the matrix into a RowMajorMatrix by collecting all rows into a single vector.
Source§

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,

Get a packed iterator over the r-th row. Read more
Source§

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,

Get a packed iterator over the r-th row. Read more
Source§

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,

Get a parallel iterator over all packed rows of the matrix. Read more
Source§

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,

Get a parallel iterator over all packed rows of the matrix. Read more
Source§

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. Read more
Source§

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. Read more
Source§

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

Returns a view over a vertically strided submatrix. Read more
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 sum across rows. v can be a vector of extension elements.
Source§

fn rowwise_packed_dot_product<EF>( &self, vec: &[EF::ExtensionPacking], ) -> impl IndexedParallelIterator<Item = EF>
where T: Field, EF: ExtensionField<T>,

Compute the matrix vector product M . vec, aka take the dot product of each row of M by vec. If the length of vec is longer than the width of M, vec is truncated to the first width() elements. Read more

Auto Trait Implementations§

§

impl<F, EF, Inner> Freeze for FlatMatrixView<F, EF, Inner>
where Inner: Freeze,

§

impl<F, EF, Inner> RefUnwindSafe for FlatMatrixView<F, EF, Inner>

§

impl<F, EF, Inner> Send for FlatMatrixView<F, EF, Inner>
where Inner: Send, F: Send, EF: Send,

§

impl<F, EF, Inner> Sync for FlatMatrixView<F, EF, Inner>
where Inner: Sync, F: Sync, EF: Sync,

§

impl<F, EF, Inner> Unpin for FlatMatrixView<F, EF, Inner>
where Inner: Unpin, F: Unpin, EF: Unpin,

§

impl<F, EF, Inner> UnwindSafe for FlatMatrixView<F, EF, Inner>
where Inner: UnwindSafe, F: UnwindSafe, EF: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more