pub type CsVector<T, R = Dynamic, S = CsVecStorage<T, R, Const<1>>> = CsMatrix<T, R, Const<1>, S>;
Expand description
A column compressed sparse vector.
Aliased Type§
struct CsVector<T, R = Dynamic, S = CsVecStorage<T, R, Const<1>>> { /* private fields */ }
Implementations§
source§impl<T, R, C> CsMatrix<T, R, C, CsVecStorage<T, R, C>>where
T: Scalar,
R: Dim,
C: Dim,
DefaultAllocator: Allocator<usize, C, Const<1>>,
impl<T, R, C> CsMatrix<T, R, C, CsVecStorage<T, R, C>>where T: Scalar, R: Dim, C: Dim, DefaultAllocator: Allocator<usize, C, Const<1>>,
sourcepub fn new_uninitialized_generic(
nrows: R,
ncols: C,
nvals: usize
) -> CsMatrix<T, R, C, CsVecStorage<T, R, C>>
pub fn new_uninitialized_generic( nrows: R, ncols: C, nvals: usize ) -> CsMatrix<T, R, C, CsVecStorage<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>where
T: Scalar,
R: Dim,
C: Dim,
S: CsStorage<T, R, C>,
impl<T, R, C, S> CsMatrix<T, R, C, S>where T: Scalar, R: Dim, C: Dim, S: CsStorage<T, R, C>,
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.
sourcepub fn transpose(&self) -> CsMatrix<T, C, R, CsVecStorage<T, C, R>>where
DefaultAllocator: Allocator<usize, R, Const<1>>,
pub fn transpose(&self) -> CsMatrix<T, C, R, CsVecStorage<T, C, R>>where DefaultAllocator: Allocator<usize, R, Const<1>>,
Computes the transpose of this sparse matrix.
source§impl<T, R, C, S> CsMatrix<T, R, C, S>where
T: Scalar,
R: Dim,
C: Dim,
S: CsStorageMut<T, R, C>,
impl<T, R, C, S> CsMatrix<T, R, C, S>where T: Scalar, R: Dim, C: Dim, S: CsStorageMut<T, R, C>,
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, R, C> CsMatrix<T, R, C, CsVecStorage<T, R, C>>where
T: Scalar + Zero + ClosedAdd<T>,
R: Dim,
C: Dim,
DefaultAllocator: Allocator<usize, C, Const<1>> + Allocator<T, R, Const<1>>,
impl<'a, T, R, C> CsMatrix<T, R, C, CsVecStorage<T, R, C>>where T: Scalar + Zero + ClosedAdd<T>, R: Dim, C: Dim, DefaultAllocator: Allocator<usize, C, Const<1>> + Allocator<T, R, Const<1>>,
sourcepub fn from_triplet_generic(
nrows: R,
ncols: C,
irows: &[usize],
icols: &[usize],
vals: &[T]
) -> CsMatrix<T, R, C, CsVecStorage<T, R, C>>
pub fn from_triplet_generic( nrows: R, ncols: C, irows: &[usize], icols: &[usize], vals: &[T] ) -> CsMatrix<T, R, C, CsVecStorage<T, R, C>>
Creates a column-compressed sparse matrix from a sparse matrix in triplet form.
source§impl<T, D, S> CsMatrix<T, D, D, S>where
T: RealField,
D: Dim,
S: CsStorage<T, D, D>,
impl<T, D, S> CsMatrix<T, D, D, S>where T: RealField, D: Dim, S: CsStorage<T, D, D>,
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>
) -> boolwhere
R2: Dim,
C2: Dim,
S2: StorageMut<T, R2, C2>,
ShapeConstraint: SameNumberOfRows<D, R2>,
pub fn solve_lower_triangular_mut<R2, C2, S2>( &self, b: &mut Matrix<T, R2, C2, S2> ) -> boolwhere R2: Dim, C2: Dim, S2: StorageMut<T, R2, C2>, ShapeConstraint: SameNumberOfRows<D, R2>,
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>
) -> boolwhere
R2: Dim,
C2: Dim,
S2: StorageMut<T, R2, C2>,
ShapeConstraint: SameNumberOfRows<D, R2>,
pub fn tr_solve_lower_triangular_mut<R2, C2, S2>( &self, b: &mut Matrix<T, R2, C2, S2> ) -> boolwhere R2: Dim, C2: Dim, S2: StorageMut<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_cs<D2, S2>(
&self,
b: &CsMatrix<T, D2, Const<1>, S2>
) -> Option<CsMatrix<T, D2, Const<1>, CsVecStorage<T, D2, Const<1>>>>where
D2: Dim,
S2: CsStorage<T, D2, Const<1>>,
DefaultAllocator: Allocator<bool, D, Const<1>> + Allocator<T, D2, Const<1>> + Allocator<usize, D2, Const<1>>,
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>, CsVecStorage<T, D2, Const<1>>>>where D2: Dim, S2: CsStorage<T, D2, Const<1>>, DefaultAllocator: Allocator<bool, D, Const<1>> + Allocator<T, D2, Const<1>> + Allocator<usize, D2, Const<1>>, ShapeConstraint: SameNumberOfRows<D, D2>,
Solve a lower-triangular system with a sparse right-hand-side.