Create a Sparse matrix in compressed row (CSR) format from a dense matrix.
Namespace:
CenterSpace.NMath.MatrixAssembly: NMath (in NMath.dll) Version: 5.1.0.0
Syntax
| C# |
|---|
public static DoubleCsrSparseMatrix ToSparseMatrix( DoubleMatrix A, int maximumNumberNonzero ) |
| Visual Basic (Declaration) |
|---|
Public Shared Function ToSparseMatrix ( _ A As DoubleMatrix, _ maximumNumberNonzero As Integer _ ) As DoubleCsrSparseMatrix |
| Visual C++ |
|---|
public: static DoubleCsrSparseMatrix^ ToSparseMatrix( DoubleMatrix^ A, int maximumNumberNonzero ) |
Parameters
- A
- Type: CenterSpace.NMath.Core..::.DoubleMatrix
A matrix.
- maximumNumberNonzero
- Type: System..::.Int32
The maximum number of nonzero elements to include in the output sparse matrix.
Return Value
A sparse matrix in CSR format containing at most
Exceptions
| Exception | Condition |
|---|---|
| CenterSpace.NMath.Core..::.NMathException | Thrown if the routine is interrupted processing because there is no space in the CSR arrays according to the value on maximumNumberNonzero. |