Commit 872dace
Fix isinplace detection for Basis types (#554)
Implement `DiffEqBase.isinplace` for `Basis` to correctly report whether
the basis supports in-place evaluation based on the `IMPL` type parameter.
The issue was that when creating an `ODEProblem` from a `Basis` with
controls but without implicit variables (Basis{false, true}), SciMLBase
would incorrectly detect it as in-place compatible. This caused a
MethodError because:
- Basis{false, CTRLS} only supports out-of-place signatures: (u, p, t) or (u, p, t, c)
- Basis{true, CTRLS} supports in-place signatures: (du, u, p, t) or (du, u, p, t, c)
The fix adds:
```julia
DiffEqBase.isinplace(::Basis{IMPL, CTRLS}, n) where {IMPL, CTRLS} = IMPL
```
This ensures that `isinplace` returns `true` only when the basis has
implicit variables (IMPL=true) and supports in-place evaluation,
and `false` otherwise.
Fixes #554
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent 46d8a0e commit 872dace
1 file changed
+5
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
605 | 605 | | |
606 | 606 | | |
607 | 607 | | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
0 commit comments