Type Alias RowMajorMatrix

Source
pub type RowMajorMatrix<T> = DenseMatrix<T, Vec<T>>;

Aliased Type§

struct RowMajorMatrix<T> {
    pub values: Vec<T>,
    pub width: usize,
    /* private fields */
}

Fields§

§values: Vec<T>§width: usize

Implementations

Source§

impl<T: Clone + Default + Send + Sync> DenseMatrix<T, Vec<T>>

Source

pub fn as_cow<'a>(self) -> RowMajorMatrixCow<'a, T>

Source

pub fn rand<R: Rng>(rng: &mut R, rows: usize, cols: usize) -> Self

Source

pub fn rand_nonzero<R: Rng>(rng: &mut R, rows: usize, cols: usize) -> Self
where T: Field, Standard: Distribution<T>,

Source

pub fn pad_to_height(&mut self, new_height: usize, fill: T)

Source§

impl<T: Copy + Default + Send + Sync> DenseMatrix<T, Vec<T>>

Source

pub fn transpose(&self) -> Self

Source

pub fn transpose_into(&self, other: &mut Self)

Source§

impl<T: Clone + Send + Sync + Default> DenseMatrix<T>

Source

pub fn default(width: usize, height: usize) -> Self

Create a new dense matrix of the given dimensions, backed by a Vec, and filled with default values.

Source§

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

Source

pub fn new(values: S, width: usize) -> Self

Source

pub fn new_row(values: S) -> Self

Source

pub fn new_col(values: S) -> Self

Source

pub fn as_view(&self) -> RowMajorMatrixView<'_, T>

Source

pub fn as_view_mut(&mut self) -> RowMajorMatrixViewMut<'_, T>
where S: BorrowMut<[T]>,

Source

pub fn copy_from<S2>(&mut self, source: &DenseMatrix<T, S2>)
where T: Copy, S: BorrowMut<[T]>, S2: DenseStorage<T>,

Source

pub fn flatten_to_base<F: Field>(&self) -> RowMajorMatrix<F>
where T: ExtensionField<F>,

Source

pub fn row_slices(&self) -> impl Iterator<Item = &[T]>

Source

pub fn par_row_slices(&self) -> impl IndexedParallelIterator<Item = &[T]>
where T: Sync,

Source

pub fn row_mut(&mut self, r: usize) -> &mut [T]
where S: BorrowMut<[T]>,

Source

pub fn rows_mut(&mut self) -> impl Iterator<Item = &mut [T]>
where S: BorrowMut<[T]>,

Source

pub fn par_rows_mut<'a>( &'a mut self, ) -> impl IndexedParallelIterator<Item = &'a mut [T]>
where T: 'a + Send, S: BorrowMut<[T]>,

Source

pub fn horizontally_packed_row_mut<P>( &mut self, r: usize, ) -> (&mut [P], &mut [T])
where P: PackedValue<Value = T>, S: BorrowMut<[T]>,

Source

pub fn scale_row(&mut self, r: usize, scale: T)
where T: Field, S: BorrowMut<[T]>,

Source

pub fn scale(&mut self, scale: T)
where T: Field, S: BorrowMut<[T]>,

Source

pub fn split_rows( &self, r: usize, ) -> (RowMajorMatrixView<'_, T>, RowMajorMatrixView<'_, T>)

Source

pub fn split_rows_mut( &mut self, r: usize, ) -> (RowMajorMatrixViewMut<'_, T>, RowMajorMatrixViewMut<'_, T>)
where S: BorrowMut<[T]>,

Source

pub fn par_row_chunks( &self, chunk_rows: usize, ) -> impl IndexedParallelIterator<Item = RowMajorMatrixView<'_, T>>
where T: Send,

Source

pub fn par_row_chunks_exact( &self, chunk_rows: usize, ) -> impl IndexedParallelIterator<Item = RowMajorMatrixView<'_, T>>
where T: Send,

Source

pub fn par_row_chunks_mut( &mut self, chunk_rows: usize, ) -> impl IndexedParallelIterator<Item = RowMajorMatrixViewMut<'_, T>>
where T: Send, S: BorrowMut<[T]>,

Source

pub fn row_chunks_exact_mut( &mut self, chunk_rows: usize, ) -> impl Iterator<Item = RowMajorMatrixViewMut<'_, T>>
where T: Send, S: BorrowMut<[T]>,

Source

pub fn par_row_chunks_exact_mut( &mut self, chunk_rows: usize, ) -> impl IndexedParallelIterator<Item = RowMajorMatrixViewMut<'_, T>>
where T: Send, S: BorrowMut<[T]>,

Source

pub fn row_pair_mut( &mut self, row_1: usize, row_2: usize, ) -> (&mut [T], &mut [T])
where S: BorrowMut<[T]>,

Source

pub fn packed_row_pair_mut<P>( &mut self, row_1: usize, row_2: usize, ) -> ((&mut [P], &mut [T]), (&mut [P], &mut [T]))
where S: BorrowMut<[T]>, P: PackedValue<Value = T>,

Source

pub fn bit_reversed_zero_pad(self, added_bits: usize) -> RowMajorMatrix<T>
where T: Field,

Append zeros to the “end” of the given matrix, except that the matrix is in bit-reversed order, so in actuality we’re interleaving zero rows.

Trait Implementations

Source§

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

Source§

impl<T: Clone, V: Clone> Clone for DenseMatrix<T, V>

Source§

fn clone(&self) -> DenseMatrix<T, V>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug, V: Debug> Debug for DenseMatrix<T, V>

Source§

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

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

impl<'de, T, V> Deserialize<'de> for DenseMatrix<T, V>
where V: Deserialize<'de>,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

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

Source§

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

Source§

fn width(&self) -> usize

Source§

fn height(&self) -> usize

Source§

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

Source§

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

Source§

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

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> + Send + Sync, impl Iterator<Item = T> + Send + Sync)
where P: PackedValue<Value = T>, T: Clone + 'a,

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,

Zero padded.
Source§

fn dimensions(&self) -> Dimensions

Source§

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

Source§

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

Source§

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

Source§

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

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,

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,

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,

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

impl<T: PartialEq, V: PartialEq> PartialEq for DenseMatrix<T, V>

Source§

fn eq(&self, other: &DenseMatrix<T, V>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T, V> Serialize for DenseMatrix<T, V>
where V: Serialize,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<T: Copy, V: Copy> Copy for DenseMatrix<T, V>

Source§

impl<T: Eq, V: Eq> Eq for DenseMatrix<T, V>

Source§

impl<T, V> StructuralPartialEq for DenseMatrix<T, V>