Skip to content

Conversation

@j-fu
Copy link
Contributor

@j-fu j-fu commented Nov 29, 2025

Checklist

  • Appropriate tests were added
  • Any code changes were done in a way that does not break public API
  • All documentation related to code changes were updated
  • The new code follows the
    contributor guidelines, in particular the SciML Style Guide and
    COLPRAC.
  • Any new documentation only uses public API

Additional context

This is an attempt to implement the missing reinit! metod for the dual cache.
I am however unsure if this is correct, at least the test works.

reinit!(cache; A = sparse(A))
overload_x_p = solve!(cache, UMFPACKFactorization())
backslash_x_p = A \ b
@test (overload_x_p, backslash_x_p, rtol = 1e-9)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe there's an extra space here?


isfresh = !isnothing(A)
precsisfresh = !reuse_precs && (isfresh || !isnothing(p))
isfresh |= cache.isfresh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DualLinearCache doesn't have a field isfresh. Should this be cache.linear_cache.isfresh ?

@jClugstor
Copy link
Member

I forgot that I have to hit submit review for my comments to show up...

ChrisRackauckas-Claude pushed a commit to ChrisRackauckas-Claude/LinearSolve.jl that referenced this pull request Dec 8, 2025
This adds the missing reinit! method for the DualLinearCache type, which
is needed when using ForwardDiff with LinearSolve and wanting to update
the cache values without creating a new cache.

The implementation directly mutates the cache fields (following the same
pattern as the regular LinearCache reinit! method) rather than using
the setX! helper functions.

Closes SciML#836

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ChrisRackauckas ChrisRackauckas merged commit dac8f53 into SciML:main Dec 12, 2025
131 of 142 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants