Struct p3_matrix::dense::DenseMatrix

source ·
pub struct DenseMatrix<T, V = Vec<T>> {
    pub values: V,
    pub width: usize,
    /* private fields */
}
Expand description

A dense matrix stored in row-major form.

Fields§

§values: V§width: usize

Implementations§

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 flatten_to_base<F: Field>(&self) -> RowMajorMatrix<F>
where T: ExtensionField<F>,

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_mut( &mut self, chunk_rows: usize, ) -> impl IndexedParallelIterator<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: Copy + Default + Send + Sync,

source§

impl<T: Clone + Default + Send + Sync> DenseMatrix<T, Vec<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 transpose(self) -> Self

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§

fn width(&self) -> usize

source§

fn height(&self) -> usize

source§

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

§

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

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

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 vertically_packed_row<P>(&self, r: usize) -> impl Iterator<Item = P>
where P: PackedValue<Value = T>,

Wraps at the end.
source§

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

source§

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

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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>

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

impl<T, V> UnwindSafe for DenseMatrix<T, V>
where V: UnwindSafe, T: 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> CloneToUninit for T
where T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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>,

§

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<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,