Assembly: Extreme.Numerics (in Extreme.Numerics)
Version: 2.1.7017.0
Syntax
Remarks
The components of a sparse matrix can be specified in a variety of ways. A common method is to
supply the rows, columns, and values of the nonzero components. Another way is to build up the matrix
using the
CopyC#Insert
Sparse matrices can also be read directly from data files in Matrix Market format. Use the MatrixMarketReader for this purpose.
The NonzeroCount property returns the number of nonzero components. The FillFactor property returns a number between 0 and 1 that is the proportion of nonzero components to the total number of components in the matrix. To iterate through the nonzero components of a sparse matrix, use the NonzeroComponents property. This property enumerates RowColumnValueTriplet objects, each containing the row, column, and value of a nonzero component.
A disadvantage of sparse matrices is that working with individual components tends to be slower. Every access usually requires a lookup in a list. To avoid duplicate lookups for elementary operations on components, use one of the specialized methods: AddAt(Int32, Int32, Double), SubtractAt(Int32, Int32, Double), MultiplyAt(Int32, Int32, Double) and DivideAt(Int32, Int32, Double).
The SparseMatrix class is an abstract base class for all types that represent sparse matrices. The class cannot be instantiated. Instead, create instances of one of its derived types:| Class | Description |
|---|---|
| SparseCompressedColumnMatrix | Represents a sparse matrix in Compressed Sparse Column (CSC) format, sometimes also called
Compressed Column Storage (CCS).
|
Inheritance Hierarchy
Extreme.Mathematics.LinearAlgebra.LinearTransformation
Extreme.Mathematics.LinearAlgebra.Matrix
Extreme.Mathematics.LinearAlgebra.Sparse.SparseMatrix
Extreme.Mathematics.LinearAlgebra.Sparse.SparseCompressedColumnMatrix