pub struct Matrix<F> { /* private fields */ }Expand description
Represents a matrix of field elements, of arbitrary dimensions
This is in row major order, so consider processing elements in the same row first, for locality.
Implementations§
Source§impl<F: Additive> Matrix<F>
impl<F: Additive> Matrix<F>
Sourcepub fn init(rows: usize, cols: usize, data: impl Iterator<Item = F>) -> Self
pub fn init(rows: usize, cols: usize, data: impl Iterator<Item = F>) -> Self
Initialize a matrix, with dimensions, and data to pull from.
Any extra data is ignored, any data not supplied is treated as 0.
Sourcepub fn as_polynomials(
&self,
min_coefficients: usize,
) -> Option<PolynomialVector<F>>where
F: Clone,
pub fn as_polynomials(
&self,
min_coefficients: usize,
) -> Option<PolynomialVector<F>>where
F: Clone,
Interpret the columns of this matrix as polynomials, with at least min_coefficients.
This will, in fact, produce a matrix padded to the next power of 2 of that number.
This will return None if min_coefficients < self.rows, which would mean
discarding data, instead of padding it.
Trait Implementations§
Source§impl<F: EncodeSize> EncodeSize for Matrix<F>
impl<F: EncodeSize> EncodeSize for Matrix<F>
Source§fn encode_size(&self) -> usize
fn encode_size(&self) -> usize
Returns the encoded size of this value (in bytes).
Source§impl<F: Read> Read for Matrix<F>
impl<F: Read> Read for Matrix<F>
impl<F> StructuralPartialEq for Matrix<F>
Auto Trait Implementations§
impl<F> Freeze for Matrix<F>
impl<F> RefUnwindSafe for Matrix<F>where
F: RefUnwindSafe,
impl<F> Send for Matrix<F>where
F: Send,
impl<F> Sync for Matrix<F>where
F: Sync,
impl<F> Unpin for Matrix<F>where
F: Unpin,
impl<F> UnsafeUnpin for Matrix<F>
impl<F> UnwindSafe for Matrix<F>where
F: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Encode for Twhere
T: Write + EncodeSize,
impl<T> Encode for Twhere
T: Write + EncodeSize,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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