sparsax.lu_logdet¶
- sparsax.lu_logdet(Ai, Aj, Ax, n)[source]¶
Log-determinant of a general (non-symmetric) sparse matrix via KLU.
The non-symmetric counterpart of
logdet(): computeslog|det(A)|from the KLU factor’sUdiagonal (plus the row-scale correction), anO(n)C-side sum. Use it whenAis not symmetric positive definite — e.g.A = I - rho Wfor a row-standardised spatial weights matrixW. Works inside@jax.jit/lax.scan; shares the per-pattern LRU factor cache withlu_solve(), so alu_solveand alu_logdetwith identical values factorize only once.Not differentiable (the non-symmetric logdet gradient is the full selected inverse, which KLU does not expose). Use
logdet()for symmetricAwhen a gradient is needed.