Implementing kernel
C++ engine symbols that back this Python API.Solve a linear system from a precomputed LU factorization.
Given the packed factorization returned by
lu_factor, solves
by applying the permutation and performing two triangular solves (forward + back substitution).
Parameters
Returns
TensorSolution , same shape as B.
Notes
Backed by LAPACK getrs. Cost per solve is —
much cheaper than a fresh solve () when the
same is reused.
Examples
>>> import lucid
>>> from lucid.linalg import lu_factor, lu_solve
>>> A = lucid.tensor([[3.0, 1.0], [1.0, 2.0]])
>>> LU, piv = lu_factor(A)
>>> b = lucid.tensor([[9.0], [8.0]])
>>> lu_solve(LU, piv, b)
Tensor([[2.0000],
[3.0000]])