Skip to content

Commit

Permalink
test: do not rely on singular roots
Browse files Browse the repository at this point in the history
  • Loading branch information
AayushSabharwal committed Jan 27, 2025
1 parent ac6c3dc commit 8fa843c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/NonlinearSolveHomotopyContinuation/test/allroots.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ alg = HomotopyContinuationJL{true}(; threading = false)

@testset "`HomotopyContinuationFunction`" begin
denominator = function (u, p)
return [u - 0.7]
return [u - 0.7, u - 0.9]
end
polynomialize = function (u, p)
return sin(u)
Expand All @@ -59,7 +59,7 @@ alg = HomotopyContinuationJL{true}(; threading = false)
@test sin(sol.u[1][1]) 0.5

@testset "no valid solutions" begin
prob2 = remake(prob; p = [0.7, 0.7])
prob2 = remake(prob; p = [0.7, 0.9])
sol2 = solve(prob2, alg)
@test !sol2.converged
@test length(sol2) == 1
Expand Down
4 changes: 2 additions & 2 deletions lib/NonlinearSolveHomotopyContinuation/test/single_root.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ alg = HomotopyContinuationJL{false}(; threading = false)

@testset "`HomotopyContinuationFunction`" begin
denominator = function (u, p)
return [u - 0.7]
return [u - 0.7, u - 0.9]
end
polynomialize = function (u, p)
return sin(u)
Expand All @@ -49,7 +49,7 @@ alg = HomotopyContinuationJL{false}(; threading = false)
@test sin(sol.u[1])0.5 atol=1e-10

@testset "no valid solutions" begin
prob2 = remake(prob; p = [0.7, 0.7])
prob2 = remake(prob; p = [0.7, 0.9])
sol2 = solve(prob2, alg)
@test sol2.retcode == SciMLBase.ReturnCode.Infeasible
end
Expand Down

0 comments on commit 8fa843c

Please sign in to comment.