pub struct CsMatrix<T, R = Dynamic, C = Dynamic, S = CsVecStorage<T, R, C>>{ /* private fields */ }Expand description
A compressed sparse column matrix.
Implementations§
Source§impl<T, R, C> CsMatrix<T, R, C>
impl<T, R, C> CsMatrix<T, R, C>
Sourcepub fn new_uninitialized_generic(
nrows: R,
ncols: C,
nvals: usize,
) -> CsMatrix<T, R, C>
pub fn new_uninitialized_generic( nrows: R, ncols: C, nvals: usize, ) -> CsMatrix<T, R, C>
Creates a new compressed sparse column matrix with the specified dimension and
nvals possible non-zero values.
Source§impl<T, R, C, S> CsMatrix<T, R, C, S>
impl<T, R, C, S> 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 nisself.len(). All operations of CSC matrices on nalgebra assume, and will return, sorted indices. If at any time this is_sortedmethod returnsfalse`, then, something went wrong
and an issue should be open on the nalgebra repository with details on how to reproduce
this.
Source§impl<T, R, C, S> CsMatrix<T, R, C, S>
impl<T, R, C, S> 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<T, D, S> CsMatrix<T, D, D, S>
impl<T, D, S> CsMatrix<T, D, D, S>
Sourcepub fn solve_lower_triangular<R2, C2, S2>(
&self,
b: &Matrix<T, R2, C2, S2>,
) -> Option<Matrix<T, R2, C2, <DefaultAllocator as Allocator<T, R2, C2>>::Buffer>>where
R2: Dim,
C2: Dim,
S2: Storage<T, R2, C2>,
DefaultAllocator: Allocator<T, R2, C2>,
ShapeConstraint: SameNumberOfRows<D, R2>,
pub fn solve_lower_triangular<R2, C2, S2>(
&self,
b: &Matrix<T, R2, C2, S2>,
) -> Option<Matrix<T, R2, C2, <DefaultAllocator as Allocator<T, R2, C2>>::Buffer>>where
R2: Dim,
C2: Dim,
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, C2, S2>(
&self,
b: &Matrix<T, R2, C2, S2>,
) -> Option<Matrix<T, R2, C2, <DefaultAllocator as Allocator<T, R2, C2>>::Buffer>>where
R2: Dim,
C2: Dim,
S2: Storage<T, R2, C2>,
DefaultAllocator: Allocator<T, R2, C2>,
ShapeConstraint: SameNumberOfRows<D, R2>,
pub fn tr_solve_lower_triangular<R2, C2, S2>(
&self,
b: &Matrix<T, R2, C2, S2>,
) -> Option<Matrix<T, R2, C2, <DefaultAllocator as Allocator<T, R2, C2>>::Buffer>>where
R2: Dim,
C2: Dim,
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, C2, S2>(
&self,
b: &mut Matrix<T, R2, C2, S2>,
) -> bool
pub fn solve_lower_triangular_mut<R2, C2, 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, C2, S2>(
&self,
b: &mut Matrix<T, R2, C2, S2>,
) -> bool
pub fn tr_solve_lower_triangular_mut<R2, C2, 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, S2>(
&self,
b: &CsMatrix<T, D2, Const<1>, S2>,
) -> Option<CsMatrix<T, D2, Const<1>>>where
D2: Dim,
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, S2>(
&self,
b: &CsMatrix<T, D2, Const<1>, S2>,
) -> Option<CsMatrix<T, D2, Const<1>>>where
D2: Dim,
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<'a, T, R, C, S> From<CsMatrix<T, R, C, S>> for Matrix<T, R, C, <DefaultAllocator as Allocator<T, R, C>>::Buffer>
impl<'a, T, R, C, S> From<CsMatrix<T, R, C, S>> for Matrix<T, R, C, <DefaultAllocator as Allocator<T, R, C>>::Buffer>
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, R, C, S> PartialEq for CsMatrix<T, R, C, S>
impl<T, R, C, S> PartialEq for CsMatrix<T, R, C, S>
impl<T, R, C, S> 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> UnsafeUnpin for CsMatrix<T, R, C, S>where
S: UnsafeUnpin,
impl<T, R, C, S> UnwindSafe for CsMatrix<T, R, C, S>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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>
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>
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 moreSource§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.