-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
24852cc
commit 8614ebe
Showing
5 changed files
with
33 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using LinearAlgebra, NonlinearSolve, Test | ||
|
||
@testset "[IIP] no AD" begin | ||
f_iip = Base.Experimental.@opaque (du, u, p) -> du .= u .* u .- p | ||
u0 = [0.0] | ||
prob = NonlinearProblem(f_iip, u0, 1.0) | ||
for alg in [RobustMultiNewton(autodiff = AutoFiniteDiff()())] | ||
sol = solve(prob, alg) | ||
@test isapprox(only(sol.u), 1.0) | ||
@test SciMLBase.successful_retcode(sol.retcode) | ||
end | ||
end | ||
|
||
@testset "[OOP] no AD" begin | ||
f_oop = Base.Experimental.@opaque (u, p) -> u .* u .- p | ||
u0 = [0.0] | ||
prob = NonlinearProblem{false}(f_oop, u0, 1.0) | ||
for alg in [RobustMultiNewton(autodiff = AutoFiniteDiff())] | ||
sol = solve(prob, alg) | ||
@test isapprox(only(sol.u), 1.0) | ||
@test SciMLBase.successful_retcode(sol.retcode) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters