pub struct CsMatrix<T: Scalar, R: Dim = Dyn, C: Dim = Dyn, S: CsStorage<T, R, C> = CsVecStorage<T, R, C>> { /* private fields */ }
Expand description
A compressed sparse column matrix.
Implementations§
source§impl<T: Scalar, R: Dim, C: Dim> CsMatrix<T, R, C>
impl<T: Scalar, R: Dim, C: Dim> CsMatrix<T, R, C>
sourcepub fn new_uninitialized_generic(nrows: R, ncols: C, nvals: usize) -> Self
pub fn new_uninitialized_generic(nrows: R, ncols: C, nvals: usize) -> Self
Creates a new compressed sparse column matrix with the specified dimension and
nvals
possible non-zero values.
source§impl<T: Scalar, R: Dim, C: Dim, S: CsStorage<T, R, C>> CsMatrix<T, R, C, S>
impl<T: Scalar, R: Dim, C: Dim, S: CsStorage<T, R, C>> CsMatrix<T, R, C, S>
sourcepub fn is_sorted(&self) -> bool
pub fn is_sorted(&self) -> bool
Should always return true
.
This method is generally used for debugging and should typically not be called in user code.
This checks that the row inner indices of this matrix are sorted. It takes O(n)
time,
where nis
self.len(). All operations of CSC matrices on nalgebra assume, and will return, sorted indices. If at any time this
is_sortedmethod returns
false`, then, something went wrong
and an issue should be open on the nalgebra repository with details on how to reproduce
this.
source§impl<T: Scalar, R: Dim, C: Dim, S: CsStorageMut<T, R, C>> CsMatrix<T, R, C, S>
impl<T: Scalar, R: Dim, C: Dim, S: CsStorageMut<T, R, C>> CsMatrix<T, R, C, S>
sourcepub fn values_mut(&mut self) -> impl Iterator<Item = &mut T>
pub fn values_mut(&mut self) -> impl Iterator<Item = &mut T>
Iterator through all the mutable values of this sparse matrix.
source§impl<'a, T: Scalar + Zero + ClosedAdd, R: Dim, C: Dim> CsMatrix<T, R, C>
impl<'a, T: Scalar + Zero + ClosedAdd, R: Dim, C: Dim> CsMatrix<T, R, C>
sourcepub fn from_triplet_generic(
nrows: R,
ncols: C,
irows: &[usize],
icols: &[usize],
vals: &[T]
) -> Self
pub fn from_triplet_generic( nrows: R, ncols: C, irows: &[usize], icols: &[usize], vals: &[T] ) -> Self
Creates a column-compressed sparse matrix from a sparse matrix in triplet form.
source§impl<T: RealField, D: Dim, S: CsStorage<T, D, D>> CsMatrix<T, D, D, S>
impl<T: RealField, D: Dim, S: CsStorage<T, D, D>> CsMatrix<T, D, D, S>
sourcepub fn solve_lower_triangular<R2: Dim, C2: Dim, S2>(
&self,
b: &Matrix<T, R2, C2, S2>
) -> Option<OMatrix<T, R2, C2>>where
S2: Storage<T, R2, C2>,
DefaultAllocator: Allocator<T, R2, C2>,
ShapeConstraint: SameNumberOfRows<D, R2>,
pub fn solve_lower_triangular<R2: Dim, C2: Dim, S2>(
&self,
b: &Matrix<T, R2, C2, S2>
) -> Option<OMatrix<T, R2, C2>>where
S2: Storage<T, R2, C2>,
DefaultAllocator: Allocator<T, R2, C2>,
ShapeConstraint: SameNumberOfRows<D, R2>,
Solve a lower-triangular system with a dense right-hand-side.
sourcepub fn tr_solve_lower_triangular<R2: Dim, C2: Dim, S2>(
&self,
b: &Matrix<T, R2, C2, S2>
) -> Option<OMatrix<T, R2, C2>>where
S2: Storage<T, R2, C2>,
DefaultAllocator: Allocator<T, R2, C2>,
ShapeConstraint: SameNumberOfRows<D, R2>,
pub fn tr_solve_lower_triangular<R2: Dim, C2: Dim, S2>(
&self,
b: &Matrix<T, R2, C2, S2>
) -> Option<OMatrix<T, R2, C2>>where
S2: Storage<T, R2, C2>,
DefaultAllocator: Allocator<T, R2, C2>,
ShapeConstraint: SameNumberOfRows<D, R2>,
Solve a lower-triangular system with self
transposed and a dense right-hand-side.
sourcepub fn solve_lower_triangular_mut<R2: Dim, C2: Dim, S2>(
&self,
b: &mut Matrix<T, R2, C2, S2>
) -> bool
pub fn solve_lower_triangular_mut<R2: Dim, C2: Dim, S2>( &self, b: &mut Matrix<T, R2, C2, S2> ) -> bool
Solve in-place a lower-triangular system with a dense right-hand-side.
sourcepub fn tr_solve_lower_triangular_mut<R2: Dim, C2: Dim, S2>(
&self,
b: &mut Matrix<T, R2, C2, S2>
) -> bool
pub fn tr_solve_lower_triangular_mut<R2: Dim, C2: Dim, S2>( &self, b: &mut Matrix<T, R2, C2, S2> ) -> bool
Solve a lower-triangular system with self
transposed and a dense right-hand-side.
sourcepub fn solve_lower_triangular_cs<D2: Dim, S2>(
&self,
b: &CsVector<T, D2, S2>
) -> Option<CsVector<T, D2>>where
S2: CsStorage<T, D2>,
DefaultAllocator: Allocator<bool, D> + Allocator<T, D2> + Allocator<usize, D2>,
ShapeConstraint: SameNumberOfRows<D, D2>,
pub fn solve_lower_triangular_cs<D2: Dim, S2>(
&self,
b: &CsVector<T, D2, S2>
) -> Option<CsVector<T, D2>>where
S2: CsStorage<T, D2>,
DefaultAllocator: Allocator<bool, D> + Allocator<T, D2> + Allocator<usize, D2>,
ShapeConstraint: SameNumberOfRows<D, D2>,
Solve a lower-triangular system with a sparse right-hand-side.
Trait Implementations§
source§impl<'a, 'b, T, R1, R2, C1, C2, S1, S2> Add<&'b CsMatrix<T, R2, C2, S2>> for &'a CsMatrix<T, R1, C1, S1>
impl<'a, 'b, T, R1, R2, C1, C2, S1, S2> Add<&'b CsMatrix<T, R2, C2, S2>> for &'a CsMatrix<T, R1, C1, S1>
source§impl<T: Clone + Scalar, R: Clone + Dim, C: Clone + Dim, S: Clone + CsStorage<T, R, C>> Clone for CsMatrix<T, R, C, S>
impl<T: Clone + Scalar, R: Clone + Dim, C: Clone + Dim, S: Clone + CsStorage<T, R, C>> Clone for CsMatrix<T, R, C, S>
source§impl<T: Debug + Scalar, R: Debug + Dim, C: Debug + Dim, S: Debug + CsStorage<T, R, C>> Debug for CsMatrix<T, R, C, S>
impl<T: Debug + Scalar, R: Debug + Dim, C: Debug + Dim, S: Debug + CsStorage<T, R, C>> Debug for CsMatrix<T, R, C, S>
source§impl<'a, T: Scalar + Zero, R: Dim, C: Dim, S> From<CsMatrix<T, R, C, S>> for OMatrix<T, R, C>
impl<'a, T: Scalar + Zero, R: Dim, C: Dim, S> From<CsMatrix<T, R, C, S>> for OMatrix<T, R, C>
source§impl<'a, 'b, T, R1, R2, C1, C2, S1, S2> Mul<&'b CsMatrix<T, R2, C2, S2>> for &'a CsMatrix<T, R1, C1, S1>
impl<'a, 'b, T, R1, R2, C1, C2, S1, S2> Mul<&'b CsMatrix<T, R2, C2, S2>> for &'a CsMatrix<T, R1, C1, S1>
source§impl<T: PartialEq + Scalar, R: PartialEq + Dim, C: PartialEq + Dim, S: PartialEq + CsStorage<T, R, C>> PartialEq for CsMatrix<T, R, C, S>
impl<T: PartialEq + Scalar, R: PartialEq + Dim, C: PartialEq + Dim, S: PartialEq + CsStorage<T, R, C>> PartialEq for CsMatrix<T, R, C, S>
impl<T: Scalar, R: Dim, C: Dim, S: CsStorage<T, R, C>> StructuralPartialEq for CsMatrix<T, R, C, S>
Auto Trait Implementations§
impl<T, R, C, S> Freeze for CsMatrix<T, R, C, S>where
S: Freeze,
impl<T, R, C, S> RefUnwindSafe for CsMatrix<T, R, C, S>
impl<T, R, C, S> Send for CsMatrix<T, R, C, S>
impl<T, R, C, S> Sync for CsMatrix<T, R, C, S>
impl<T, R, C, S> Unpin for CsMatrix<T, R, C, S>
impl<T, R, C, S> UnwindSafe for CsMatrix<T, R, C, S>
Blanket Implementations§
source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
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
source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.