pub struct ScipySparseData {
pub format: ScipyFormat,
pub shape: (usize, usize),
pub data: Vec<f64>,
pub indices: Vec<usize>,
pub indptr_or_row: Vec<usize>,
pub blocksize: Option<(usize, usize)>,
pub diagonals: Option<Vec<i32>>,
}
Expand description
SciPy sparse matrix representation for data exchange
Fields§
§format: ScipyFormat
Matrix format
shape: (usize, usize)
Matrix shape (rows, cols)
data: Vec<f64>
Data values
indices: Vec<usize>
Row indices (for COO and CSR) or column indices (for CSC)
indptr_or_row: Vec<usize>
Row pointers (for CSR) or column pointers (for CSC) or coordinate rows (for COO)
blocksize: Option<(usize, usize)>
Block size for BSR format
diagonals: Option<Vec<i32>>
Number of diagonals for DIA format
Implementations§
Source§impl ScipySparseData
impl ScipySparseData
Sourcepub fn new(format: ScipyFormat, shape: (usize, usize)) -> Self
pub fn new(format: ScipyFormat, shape: (usize, usize)) -> Self
Create new SciPy sparse data
Sourcepub fn from_coo(
shape: (usize, usize),
row_indices: Vec<usize>,
col_indices: Vec<usize>,
values: Vec<f64>,
) -> Self
pub fn from_coo( shape: (usize, usize), row_indices: Vec<usize>, col_indices: Vec<usize>, values: Vec<f64>, ) -> Self
Create from COO data
Trait Implementations§
Source§impl Clone for ScipySparseData
impl Clone for ScipySparseData
Source§fn clone(&self) -> ScipySparseData
fn clone(&self) -> ScipySparseData
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for ScipySparseData
impl RefUnwindSafe for ScipySparseData
impl Send for ScipySparseData
impl Sync for ScipySparseData
impl Unpin for ScipySparseData
impl UnwindSafe for ScipySparseData
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> 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