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>>,

source

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>,

source

pub fn len(&self) -> usize

The size of the data buffer.

source

pub fn nrows(&self) -> usize

The number of rows of this matrix.

source

pub fn ncols(&self) -> usize

The number of rows of this matrix.

source

pub fn shape(&self) -> (usize, usize)

The shape of this matrix.

source

pub fn is_square(&self) -> bool

Whether this matrix is square or not.

source

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

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>,

source

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>>,

source

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>,

source

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.

source

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.

source

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.

source

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.

source

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.

Trait Implementations§

source§

impl<T, R, C, S> Clone for CsMatrix<T, R, C, S>where T: Clone + Scalar, R: Clone + Dim, C: Clone + Dim, S: Clone + CsStorage<T, R, C>,

source§

fn clone(&self) -> CsMatrix<T, R, C, S>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T, R, C, S> Debug for CsMatrix<T, R, C, S>where T: Debug + Scalar, R: Debug + Dim, C: Debug + Dim, S: Debug + CsStorage<T, R, C>,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<'a, T, R, C, S> From<Matrix<T, R, C, S>> for CsMatrix<T, R, C, CsVecStorage<T, R, C>>where T: Scalar + Zero, R: Dim, C: Dim, S: Storage<T, R, C>, DefaultAllocator: Allocator<T, R, C> + Allocator<usize, C, Const<1>>,

source§

fn from(m: Matrix<T, R, C, S>) -> CsMatrix<T, R, C, CsVecStorage<T, R, C>>

Converts to this type from the input type.
source§

impl<'a, 'b, T, R, C, S> Mul<T> for CsMatrix<T, R, C, S>where T: Scalar + ClosedAdd<T> + ClosedMul<T> + Zero, R: Dim, C: Dim, S: CsStorageMut<T, R, C>,

§

type Output = CsMatrix<T, R, C, S>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: T) -> <CsMatrix<T, R, C, S> as Mul<T>>::Output

Performs the * operation. Read more
source§

impl<T, R, C, S> PartialEq<CsMatrix<T, R, C, S>> for CsMatrix<T, R, C, S>where T: PartialEq<T> + Scalar, R: PartialEq<R> + Dim, C: PartialEq<C> + Dim, S: PartialEq<S> + CsStorage<T, R, C>,

source§

fn eq(&self, other: &CsMatrix<T, R, C, S>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T, R, C, S> StructuralPartialEq for CsMatrix<T, R, C, S>where T: Scalar, R: Dim, C: Dim, S: CsStorage<T, R, C>,