A single row in the simplex tableau, stored in the sparse format.
SparseTableauRow
00 Remarks
The column index in SparseTableauRow.Idx is always kept in ascending order, so that:
- the element lookup can be done via the binary search method
- the row merge operation (AXPY) can be done via a forward merge into a spare buffer, and then the buffers are swapped: there is no array copy and no extra allocation is required by this operation (the ping-pong buffer).
01 Syntax
02 Methods
| Name | Overloads | Summary |
|---|---|---|
| Add | 1 | append a new non-zero element at the end of this row, the given col should be greater than the last column index in this row. |
| Item | 1 | get the element value at the given column index |
| Scale | 1 | this row = this row * factor |
| Axpy | 1 | this row = this row - factor * other |
| RemoveFrom | 1 | removes all of the columns which index is greater than or equals to the given minCol from this row. |
| Compress | 1 | remove all of the tiny value in this row |
| ToString | 1 |
03 Fields
04 Members
Int32, Double)append a new non-zero element at the end of this row, the given col should be greater than the last column index in this row.
Int32)get the element value at the given column index
zero when the given column is a structural zero
Double, Double)this row = this row factor*
| Name | Type | Description |
|---|---|---|
dropTol | Double | the tiny value will be removed from this row |
this row = this row - factor other*
a forward merge into the spare buffer is applied by this operation, then the spare buffer is swapped with the row buffer, so that there is no array copy cost on this operation.
| Name | Type | Description |
|---|---|---|
other | SparseTableauRow | the pivot row, which is already scaled |
factor | Double | - |
dropTol | Double | - |
Int32)removes all of the columns which index is greater than or equals to the given minCol from this row.
| Name | Type | Description |
|---|---|---|
minCol | Int32 | - |
the number of the removed elements
Double)remove all of the tiny value in this row
the column index of each non-zero element, in ascending order
the value of each non-zero element
the number of the non-zero elements in this row
the spare buffer of SparseTableauRow.Idx
the spare buffer of SparseTableauRow.Val