Some sparse matrix utilities missing in scipy.
Compose sparse matrices into a global sparse matrix.
Parameters: | blocks : sequence of sequences
row_sizes : sequence, optional
col_sizes : sequence, optional
|
---|---|
Returns: | mtx : coo_matrix
|
Examples
Stokes-like problem matrix.
>>> import scipy.sparse as sp
>>> A = sp.csr_matrix([[1, 0], [0, 1]])
>>> B = sp.coo_matrix([[1, 1]])
>>> K = compose_sparse([[A, B.T], [B, 0]])
>>> print K.todense()
[[1 0 1]
[0 1 1]
[1 1 0]]
Infinity norm of a sparse matrix (maximum absolute row sum).
Parameters: | mtx : spmatrix or array
|
---|---|
Returns: | norm : float
|
See also
Notes