Commit de7aba9
Fix copy method for StatefulJacobianOperator with Tuple parameters
- Add `_safe_copy` helper functions to handle immutable types (Tuple,
NamedTuple, Number) that don't need copying
- Fix the `Base.copy` method for `StatefulJacobianOperator` to use
`_safe_copy(J.p)` instead of `applicable(copy, J.p) ? copy(J.p) : J.p`
which fails for Tuple types
- Fix typo: `nohting` -> `nothing` in `JacobianOperator.copy`
This fixes the JFNK (Jacobian-Free Newton-Krylov) example from the
documentation which was failing with:
MethodError: no method matching copy(::NTuple{4, Float64})
Fixes #752
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <[email protected]>1 parent d2a9b8a commit de7aba9
1 file changed
+11
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
407 | 415 | | |
408 | | - | |
| 416 | + | |
409 | 417 | | |
410 | 418 | | |
411 | 419 | | |
412 | 420 | | |
413 | 421 | | |
414 | | - | |
| 422 | + | |
415 | 423 | | |
416 | 424 | | |
417 | 425 | | |
418 | 426 | | |
419 | 427 | | |
420 | 428 | | |
421 | 429 | | |
422 | | - | |
| 430 | + | |
423 | 431 | | |
424 | 432 | | |
425 | 433 | | |
| |||
429 | 437 | | |
430 | 438 | | |
431 | 439 | | |
432 | | - | |
433 | 440 | | |
434 | 441 | | |
435 | | - | |
436 | 442 | | |
437 | 443 | | |
438 | 444 | | |
| |||
0 commit comments