diff --git a/Project.toml b/Project.toml index d8ec44ac1..1651aab2a 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "NonlinearSolve" uuid = "8913a72c-1f9b-4ce2-8d82-65094dcecaec" authors = ["SciML"] -version = "3.15.0" +version = "3.15.1" [deps] ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b" diff --git a/src/internal/helpers.jl b/src/internal/helpers.jl index afc24ce5b..5334f11dc 100644 --- a/src/internal/helpers.jl +++ b/src/internal/helpers.jl @@ -1,9 +1,8 @@ # Evaluate the residual function at a given point function evaluate_f(prob::AbstractNonlinearProblem{uType, iip}, u) where {uType, iip} - (; f, u0, p) = prob + (; f, p) = prob if iip - fu = f.resid_prototype === nothing ? zero(u) : - promote_type(eltype(u), eltype(f.resid_prototype)).(f.resid_prototype) + fu = f.resid_prototype === nothing ? zero(u) : similar(f.resid_prototype) f(fu, u, p) else fu = f(u, p) diff --git a/src/internal/jacobian.jl b/src/internal/jacobian.jl index 390c0947f..b78eb7383 100644 --- a/src/internal/jacobian.jl +++ b/src/internal/jacobian.jl @@ -92,13 +92,11 @@ function JacobianCache(prob, alg, f::F, fu_, u, p; stats, autodiff = nothing, end end else - jac_proto = if eltype(f.jac_prototype) <: Bool + if eltype(f.jac_prototype) <: Bool similar(f.jac_prototype, promote_type(eltype(fu), eltype(u))) else similar(f.jac_prototype) end - fill!(jac_proto, false) - jac_proto end end