Skip to content

Conversation

@ChrisRackauckas-Claude
Copy link
Contributor

Summary

  • Implements the missing reinit! method for DualLinearCache
  • Uses direct mutation pattern (same as LinearCache reinit!) instead of setX! helper functions
  • Properly updates all DualLinearCache fields: dual_A, dual_b, dual_u, partials_A, partials_b, partials_u, and partials_*_list caches
  • Handles freshness flags correctly for cache invalidation

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 completes the work started in #836, implementing the reinit! method using direct mutation instead of the setX! helper functions, matching the pattern used in the regular LinearCache reinit! implementation.

Tests verify:

  • reinit! with A only
  • reinit! with both A and b
  • reinit! with b only

Closes #836

🤖 Generated with Claude Code

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>
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.

2 participants