sparsax.lu_rcond

sparsax.lu_rcond(Ai, Aj, Ax, n)[source]

A cheap estimate of the reciprocal condition number of A, via KLU.

The smallest over the largest pivot of U: 1 is perfectly conditioned, and near 0 means nearly singular. It reads the factor, so it costs nothing beyond the factorization, which it shares with lu_solve(), but it is a rough indicator rather than a bound. KLU scales the rows first, so a matrix that is merely badly scaled is not flagged, and values from different backends are not comparable. Not differentiable.

Parameters:
Ai

as in lu_logdet().

Aj

as in lu_logdet().

Ax

as in lu_logdet().

n

as in lu_logdet().

Returns:

Scalar float64 in [0, 1].

Raises:

Exception – if A is exactly singular or holds a non-finite value. set_options(on_failure="nan") returns NaN instead.