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>>
pub fn as_polynomials( &self, min_coefficients: usize, ) -> Option<PolynomialVector<F>>
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§fn encode_inline_size(&self) -> usize
fn encode_inline_size(&self) -> usize
Returns the encoded size excluding bytes passed to
BufsMut::push
during Write::write_bufs. Used to size the fixed working buffer for
inline writes, so it must not be less than the bytes written inline.
Override alongside Write::write_bufs for types where large
byte fields go via push, or the working buffer will over-allocate.Source§impl<F: Read> Read for Matrix<F>
impl<F: Read> Read for Matrix<F>
impl<F: PartialEq> StructuralPartialEq for Matrix<F>
Source§impl<F: Write> Write for Matrix<F>
impl<F: Write> Write for Matrix<F>
Source§fn write_bufs(&self, buf: &mut impl BufsMut)
fn write_bufs(&self, buf: &mut impl BufsMut)
Writes to a
BufsMut, allowing existing byte chunks to be
appended via BufsMut::push instead of written inline. Must encode
to the same format as Write::write. Defaults to Write::write.Auto Trait Implementations§
impl<F> Freeze for Matrix<F>
impl<F> RefUnwindSafe for Matrix<F>where
Vec<F>: RefUnwindSafe,
impl<F> Send for Matrix<F>
impl<F> Sync for Matrix<F>
impl<F> Unpin for Matrix<F>
impl<F> UnsafeUnpin for Matrix<F>where
Vec<F>: UnsafeUnpin,
impl<F> UnwindSafe for Matrix<F>where
Vec<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