Solve a symmetric linear system using an LDL factorization.
Given produced by ldl_factor,
solves
by chaining three substitutions:
followed by an inverse permutation to undo the Bunch-Kaufman row swaps.
Parameters
Returns
TensorSolution , same shape as B.
Notes
Supports indefinite symmetric (unlike Cholesky), so it is appropriate for KKT / saddle-point systems where Cholesky would fail. Cost per solve is once the LDL factor is in hand.
Examples
>>> import lucid
>>> from lucid.linalg import ldl_factor, ldl_solve
>>> A = lucid.tensor([[4.0, 1.0], [1.0, 3.0]])
>>> LD, piv = ldl_factor(A)
>>> b = lucid.tensor([[5.0], [4.0]])
>>> ldl_solve(LD, piv, b)