You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NonlinearSolveBase: add public get_linear_cache accessor (#1065)
Add `get_linear_cache(cache)`, a read-only accessor that returns the
`LinearSolve.jl` `LinearCache` the solver holds its Jacobian (and, for a
factorization, that factorization) in — the cache-level companion to the
existing public `get_linear_solver(alg)`. It lets a caller reuse the solver's
current Jacobian for an auxiliary linear solve `J x = b` (e.g. a smoothed error
estimate) instead of building and factorizing a second copy.
It walks the existing cache chain: `cache.descent_cache.lincache` ->
`LinearSolveJLCache.lincache` -> the raw `LinearCache`, and returns `nothing`
where there is no single reusable cache (polyalgorithms, and the native
`\`/`SMatrix`/`Number`/`Diagonal` paths). Read-only: it does not refactorize;
the returned cache is in the state the last `step!`/`solve!` left it, so reuse
it through the normal LinearSolve caching interface (set `b`/`u`, `solve!`, no
new `A`), which reuses the existing factorization for a direct solver and
re-runs the iterative solve for a Krylov cache.
Made `@compat public`, documented (docstring + devdocs `@docs` entry). Minor
version bump (new public API): NonlinearSolveBase 2.34.1 -> 2.35.0.
Claude-Session: https://claude.ai/code/session_01NB3oFTNzGW79UtDt8AyjsM
Co-authored-by: Christopher Rackauckas <accounts@chrisrackauckas.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
0 commit comments