xnn.common.models.eeq.lu_solve_refined#
- xnn.common.models.eeq.lu_solve_refined(lu, pivots, full, rhs, rounds)[source]#
full^-1 @ rhsfrom the LU factor offull, withroundsrounds of iterative refinement.A float32 factor alone leaves the charges and, through the adjoint, the forces well short of the float32 matrix’s own accuracy. Each round (residual of the current solution, in float64 when the factor is float32, solved with the same factor and added back) recovers about four digits; one round brings the solution to the accuracy of the float32 matrix itself.
rounds=0is the plain LAPACK solution. Scriptable; whenfullandrhscarry gradients, autograd runs through the factor as well, which costs O(N^3) in the backward (seelu_solve_implicit()for the O(N^2) form).