A sparse matrix in the compressed sparse row(CSR) format.
LpSparseMatrix
00 Remarks
This matrix object is specially designed for the large scale linear programming problem, example as the FBA problem of the genome scale metabolic network: the stoichiometric matrix of a GEM model is a highly sparse matrix, so that a dense matrix storage in such a large scale problem will run out of the memory.
The column index in each row is always kept in ascending order, so that the element lookup in a row can be done via binary search.
01 Syntax
02 Methods
| Name | Overloads | Summary |
|---|---|---|
| FromJagged | 1 | create a sparse matrix from a dense jagged matrix |
| FromTriplets | 1 | create a sparse matrix from the triplet data |
| Empty | 1 | the empty matrix |
| ToJagged | 1 | expands the sparse matrix as a dense jagged matrix, note that this operation may cost a lot of memory in a large scale problem |
| ToString | 1 |
03 Properties
| Name | Overloads | Summary |
|---|---|---|
| NonZeros | 1 | the number of the non-zero elements in this matrix |
04 Fields
05 Members
Double()())create a sparse matrix from a dense jagged matrix
| Name | Type | Description |
|---|---|---|
jagged | Double()() | - |
Int32, Int32, Int32(), Int32(), Double())create a sparse matrix from the triplet data
the empty matrix
expands the sparse matrix as a dense jagged matrix, note that this operation may cost a lot of memory in a large scale problem
the number of the non-zero elements in this matrix
number of the constraint rows
number of the variables
row pointer, the length is LpSparseMatrix.Rows + 1
the column index of each non-zero element
the value of each non-zero element