DemandVectorSP.sparse¶
- DemandVectorSP.sparse(dtype=None) scipy.sparse.csc.csc_matrix [source]¶
Get demand as sparse matrix.
- Total in/outflow per node (row) per commodity (column), e.g.,:
Data:
(0, 2, 100) (3, 1, 66)
Resulting matrix:
[[-100, 0], [ 0, 66], [ 100, 0], [ 0, -66]]
- Parameters
- dtype: dtype, optional
Datatype of returned sparse matrix.
- Returns
- scipy.sparse.csc_matrix
Demand as sparse matrix.