Closed jlperla closed 5 years ago
My guess is that checking that the typeof(f) <: Union{InplaceObjective, NotInplaceObjective}
might also be important for the nlsolve case.. But if we only do this for fixedpoint
that would be fine with me.
Is applicable a Base function?
Yeah
TIL
Opened https://github.com/JuliaNLSolvers/NLsolve.jl/pull/192 to incorporate this change (only for fixedpoint()
for now). Also, it turns out it's actually just Base.applicable
Closing because the PR #192 has been merged.
@pkofod and @arnavs
I am finding that the code using the
fixedpoint
andsolve
functions look uglier than they need to be when usinginplace = false
all over the place.I think this could have an almost trivial change: For the following:
and if you want to do it for the
nlsolve
interface:CHange
inplace = true
to something likethat is, check if it can be called with just the initial condition... if so, then we can use
inplace = false
Of course, there is a small chance that there is a method for both
f(out, x)
andf(x)
for the same function (at which point this would choose thef(x)
one by default)... but I doubt that would happen in practice. People are very careful to use the!
for modifying functions, so it is pretty rare to have both.