bundles / scipy 1.17.1 / scipy / sparse / linalg / _onenormest / onenormest
function
scipy.sparse.linalg._onenormest:onenormest
Signature
def onenormest ( A , t = 2 , itmax = 5 , compute_v = False , compute_w = False ) Summary
Compute a lower bound of the 1-norm of a sparse array.
Parameters
A: ndarray or other linear operatorA linear operator that can be transposed and that can produce matrix products.
t: int, optionalA positive parameter controlling the tradeoff between accuracy versus time and memory usage. Larger values take longer and use more memory but give more accurate output.
itmax: int, optionalUse at most this many iterations.
compute_v: bool, optionalRequest a norm-maximizing linear operator input vector if True.
compute_w: bool, optionalRequest a norm-maximizing linear operator output vector if True.
Returns
est: floatAn underestimate of the 1-norm of the sparse array.
v: ndarray, optionalThe vector such that ||Av||_1 == est*||v||_1. It can be thought of as an input to the linear operator that gives an output with particularly large norm.
w: ndarray, optionalThe vector Av which has relatively large 1-norm. It can be thought of as an output of the linear operator that is relatively large in norm compared to the input.
Notes
This is algorithm 2.4 of [1].
In [2] it is described as follows. "This algorithm typically requires the evaluation of about 4t matrix-vector products and almost invariably produces a norm estimate (which is, in fact, a lower bound on the norm) correct to within a factor 3."
Examples
import numpy as np from scipy.sparse import csc_array from scipy.sparse.linalg import onenormest A = csc_array([[1., 0., 0.], [5., 8., 2.], [0., -1., 0.]], dtype=float) A.toarray()✓
onenormest(A) np.linalg.norm(A.toarray(), ord=1)✗
Aliases
-
scipy.sparse.linalg.onenormest