pub struct Matrix { /* private fields */ }Expand description
Owned finite row-major FP64 data. Empty axes are rejected in this first release.
Implementations§
Source§impl Matrix
impl Matrix
pub fn new( rows: usize, cols: usize, data: Vec<f64>, ) -> Result<Self, SolverError>
Sourcepub fn from_f32(
rows: usize,
cols: usize,
data: &[f32],
) -> Result<Self, SolverError>
pub fn from_f32( rows: usize, cols: usize, data: &[f32], ) -> Result<Self, SolverError>
Explicit FP32 -> FP64 host conversion; no device transfer occurs.
pub fn zeros(rows: usize, cols: usize) -> Result<Self, SolverError>
pub fn identity(n: usize) -> Result<Self, SolverError>
pub fn rows(&self) -> usize
pub fn columns(&self) -> usize
pub fn values(&self) -> &[f64]
pub fn into_values(self) -> Vec<f64>
pub fn view(&self) -> MatrixView<'_>
pub fn get(&self, row: usize, column: usize) -> Option<f64>
pub fn transpose(&self) -> Result<Self, SolverError>
Trait Implementations§
Source§impl LinearOperator for Matrix
impl LinearOperator for Matrix
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