pub struct Matrix { /* private fields */ }Expand description
A contiguous row-major dense matrix.
Implementations§
Source§impl Matrix
impl Matrix
Sourcepub fn new(
rows: usize,
cols: usize,
data: Vec<f64>,
) -> Result<Self, MatrixError>
pub fn new( rows: usize, cols: usize, data: Vec<f64>, ) -> Result<Self, MatrixError>
Builds a matrix from row-major data.
§Errors
Returns MatrixError::DimensionsOverflow if the dimensions overflow,
or MatrixError::InvalidShape when the data length is wrong.
Sourcepub fn as_mut_slice(&mut self) -> &mut [f64]
pub fn as_mut_slice(&mut self) -> &mut [f64]
Mutable row-major backing storage.
Trait Implementations§
impl StructuralPartialEq for Matrix
Auto Trait Implementations§
impl Freeze for Matrix
impl RefUnwindSafe for Matrix
impl Send for Matrix
impl Sync for Matrix
impl Unpin for Matrix
impl UnsafeUnpin for Matrix
impl UnwindSafe for Matrix
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