def estimate_spectral_norm(A, its=20):
    '\n    Estimate spectral norm of a matrix by the randomized power method.\n\n    ..  This function automatically detects the matrix data type and calls the\n        appropriate backend. For details, see :func:`_backend.idd_snorm` and\n        :func:`_backend.idz_snorm`.\n\n    Parameters\n    ----------\n    A : :class:`scipy.sparse.linalg.LinearOperator`\n        Matrix given as a :class:`scipy.sparse.linalg.LinearOperator` with the\n        `matvec` and `rmatvec` methods (to apply the matrix and its adjoint).\n    its : int, optional\n        Number of power method iterations.\n\n    Returns\n    -------\n    float\n        Spectral norm estimate.\n    '
    from scipy.sparse.linalg import aslinearoperator
    A = aslinearoperator(A)
    (m, n) = A.shape
    matvec = (lambda x: A.matvec(x))
    matveca = (lambda x: A.rmatvec(x))
    if _is_real(A):
        return _backend.idd_snorm(m, n, matveca, matvec, its=its)
    else:
        return _backend.idz_snorm(m, n, matveca, matvec, its=its)
Estimate spectral norm of a matrix by the randomized power method.

..  This function automatically detects the matrix data type and calls the
    appropriate backend. For details, see :func:`_backend.idd_snorm` and
    :func:`_backend.idz_snorm`.

Parameters
----------
A : :class:`scipy.sparse.linalg.LinearOperator`
    Matrix given as a :class:`scipy.sparse.linalg.LinearOperator` with the
    `matvec` and `rmatvec` methods (to apply the matrix and its adjoint).
its : int, optional
    Number of power method iterations.

Returns
-------
float
    Spectral norm estimate.
def estimate_spectral_norm(A, its=20):
    '\n    Estimate spectral norm of a matrix by the randomized power method.\n\n    ..  This function automatically detects the matrix data type and calls the\n        appropriate backend. For details, see :func:`_backend.idd_snorm` and\n        :func:`_backend.idz_snorm`.\n\n    Parameters\n    ----------\n    A : :class:`scipy.sparse.linalg.LinearOperator`\n        Matrix given as a :class:`scipy.sparse.linalg.LinearOperator` with the\n        `matvec` and `rmatvec` methods (to apply the matrix and its adjoint).\n    its : int, optional\n        Number of power method iterations.\n\n    Returns\n    -------\n    float\n        Spectral norm estimate.\n    '
    from scipy.sparse.linalg import aslinearoperator
    A = aslinearoperator(A)
    (m, n) = A.shape
    matvec = (lambda x: A.matvec(x))
    matveca = (lambda x: A.rmatvec(x))
    if _is_real(A):
        return _backend.idd_snorm(m, n, matveca, matvec, its=its)
    else:
        return _backend.idz_snorm(m, n, matveca, matvec, its=its)