-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rework VecJac Operator #272
Rework VecJac Operator #272
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #272 +/- ##
==========================================
- Coverage 87.08% 86.62% -0.46%
==========================================
Files 21 21
Lines 1254 1286 +32
==========================================
+ Hits 1092 1114 +22
- Misses 162 172 +10
☔ View full report in Codecov by Sentry. |
This might have to be a breaking change. The previous API dropped things and a lot of code was written to work around it. But now the API is more strict which breaks code 😞 |
## Allowed Function Signatures | ||
|
||
For Out of Place Functions: | ||
|
||
```julia | ||
f(u, p, t) # t !== nothing | ||
f(u, p) # p !== nothing | ||
f(u) # Otherwise | ||
``` | ||
|
||
For In Place Functions: | ||
|
||
```julia | ||
f(du, u, p, t) # t !== nothing | ||
f(du, u, p) # p !== nothing | ||
f(du, u) # Otherwise |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this match jacvec?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is v?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That also drops p
and t
after asking from them. JacVec basically only allows f(du, u)
and f(u)
. So this one is a strict superset
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I always pass in the general function and then get an error that f
can't take p
or t
as inputs, which is kind of weird to do if the function takes them as inputs)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is v?
Oh I see the confusion. I meant to say function signatures for the input and not the constructed operator
# FIXME: FunctionOperator is terribly type unstable. It makes it `::Any` | ||
# NOTE: We pass `p`, `t` to Function Operator but we always use the cached version from | ||
# VecJacFunctionWrapper |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like the right thing to do is fix FunctionOperator?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the note
part or the fixme
part? The fixme
part definitely needs fixing, but the note
part is needed, because p
and t
need to be propagated via update_coefficients
p
andt
are no longer droppedVecJac
matches the size offu
I will test with SciML/NonlinearSolve.jl#268 a bit before merging