lineax icon indicating copy to clipboard operation
lineax copied to clipboard

Implement Normal, a solver applying an inner solver to the normal equations

Open adconner opened this issue 7 months ago • 0 comments

This fixes #157 by implementing what we discussed there, a wrapper which takes any solver and applies it to the normal equations.

I've stacked this change atop #158 as the implementation is significantly cleaner taken with the change there.

This currently includes the breaking change of removing lx.NormalCG(...) in favor of lx.Normal(lx.CG(...)), so perhaps a simple definition should be made for backward compatibility. It was not clear how I should handle that from the standpoint of the documentation, as the following suffices

def NormalCG(rtol: float,
        atol: float,
        norm: Callable[[PyTree], Scalar] = max_norm,
        stabilise_every: int | None = 10,
        max_steps: int | None = None):
    return Normal(CG(rtol,atol,norm,stabilise_every,max_steps))

but now the name NormalCG is a function, not a class, and its not clear if it be documented along with the other solvers. Would you want to add the above as an alternative, possibly deprecated interface? And if so should it be documented, and if so how?

adconner avatar Jun 09 '25 20:06 adconner