diff --git a/src/linesearch.jl b/src/linesearch.jl index 833361607..a2b396b06 100644 --- a/src/linesearch.jl +++ b/src/linesearch.jl @@ -122,8 +122,7 @@ function LineSearchesJLCache(ls::LineSearch, f::F, u, p, fu1, IIP::Val{iip}) whe end function g!(u, fu) - # FIXME: Upstream patch to allow non-square Jacobians - op = VecJac((args...) -> f(args..., p), u; autodiff) + op = VecJac(f, u, p; fu = fu1, autodiff) if iip mul!(g₀, op, fu) return g₀ diff --git a/test/basictests.jl b/test/basictests.jl index 6ee51e8da..e5d7aad88 100644 --- a/test/basictests.jl +++ b/test/basictests.jl @@ -133,10 +133,6 @@ const TERMINATION_CONDITIONS = [ @testset "Termination condition: $(termination_condition) u0: $(_nameof(u0))" for termination_condition in TERMINATION_CONDITIONS, u0 in (1.0, [1.0, 1.0]) -<<<<<<< HEAD - -======= ->>>>>>> 1a0df4e (Improve termination conditions) probN = NonlinearProblem(quadratic_f, u0, 2.0) @test all(solve(probN, NewtonRaphson(); termination_condition).u .≈ sqrt(2.0)) end @@ -301,10 +297,6 @@ end @testset "Termination condition: $(termination_condition) u0: $(_nameof(u0))" for termination_condition in TERMINATION_CONDITIONS, u0 in (1.0, [1.0, 1.0]) -<<<<<<< HEAD - -======= ->>>>>>> 1a0df4e (Improve termination conditions) probN = NonlinearProblem(quadratic_f, u0, 2.0) @test all(solve(probN, TrustRegion(); termination_condition).u .≈ sqrt(2.0)) end @@ -421,10 +413,6 @@ end @testset "Termination condition: $(termination_condition) u0: $(_nameof(u0))" for termination_condition in TERMINATION_CONDITIONS, u0 in (1.0, [1.0, 1.0]) -<<<<<<< HEAD - -======= ->>>>>>> 1a0df4e (Improve termination conditions) probN = NonlinearProblem(quadratic_f, u0, 2.0) @test all(solve(probN, LevenbergMarquardt(); termination_condition).u .≈ sqrt(2.0)) end @@ -559,10 +547,6 @@ end @testset "Termination condition: $(termination_condition) u0: $(_nameof(u0))" for termination_condition in TERMINATION_CONDITIONS, u0 in (1.0, [1.0, 1.0]) -<<<<<<< HEAD - -======= ->>>>>>> 1a0df4e (Improve termination conditions) probN = NonlinearProblem(quadratic_f, u0, 2.0) @test all(solve(probN, DFSane(); termination_condition).u .≈ sqrt(2.0)) end @@ -683,10 +667,6 @@ end @testset "Termination condition: $(termination_condition) u0: $(_nameof(u0))" for termination_condition in TERMINATION_CONDITIONS, u0 in (1.0, [1.0, 1.0]) -<<<<<<< HEAD - -======= ->>>>>>> 1a0df4e (Improve termination conditions) probN = NonlinearProblem(quadratic_f, u0, 2.0) @test all(solve(probN, PseudoTransient(; alpha_initial = 10.0); termination_condition).u .≈ sqrt(2.0)) @@ -784,10 +764,6 @@ end @testset "Termination condition: $(termination_condition) u0: $(_nameof(u0))" for termination_condition in TERMINATION_CONDITIONS, u0 in (1.0, [1.0, 1.0]) -<<<<<<< HEAD - -======= ->>>>>>> 1a0df4e (Improve termination conditions) probN = NonlinearProblem(quadratic_f, u0, 2.0) @test all(solve(probN, GeneralBroyden(); termination_condition).u .≈ sqrt(2.0)) end @@ -884,14 +860,9 @@ end @testset "Termination condition: $(termination_condition) u0: $(_nameof(u0))" for termination_condition in TERMINATION_CONDITIONS, u0 in (1.0, [1.0, 1.0]) -<<<<<<< HEAD probN = NonlinearProblem(quadratic_f, u0, 2.0) @test all(solve(probN, GeneralKlement(); termination_condition).u .≈ sqrt(2.0)) -======= - probN = NonlinearProblem(quadratic_f, u0, 2.0) - @test all(solve(probN,GeneralKlement(); termination_condition).u .≈ sqrt(2.0)) ->>>>>>> 1a0df4e (Improve termination conditions) end end @@ -990,14 +961,9 @@ end @testset "Termination condition: $(termination_condition) u0: $(_nameof(u0))" for termination_condition in TERMINATION_CONDITIONS, u0 in (1.0, [1.0, 1.0]) -<<<<<<< HEAD probN = NonlinearProblem(quadratic_f, u0, 2.0) @test all(solve(probN, LimitedMemoryBroyden(); -======= - probN = NonlinearProblem(quadratic_f, u0, 2.0) - @test all(solve(probN, LimitedMemoryBroyden(); ->>>>>>> 1a0df4e (Improve termination conditions) termination_condition).u .≈ sqrt(2.0)) end end