sparsax.lu_slogdet

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

Sign and log-absolute-determinant of a sparse matrix via KLU.

lu_logdet() with the sign that its absolute value drops, as in numpy.linalg.slogdet(). The sign shows when a spatial parameter has crossed a singularity: det(I - rho W) is positive at rho = 0 and changes sign each time rho passes the reciprocal of a real eigenvalue of W. Shares the factor cache with lu_solve(). Not differentiable.

Parameters:
Ai

as in lu_logdet().

Aj

as in lu_logdet().

Ax

as in lu_logdet().

n

as in lu_logdet().

Returns:

(sign, logabsdet), each a float64 scalar; sign is 1.0 or -1.0.

Raises:

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