Skip to content

Commit

Permalink
fixup! add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
utkarsh530 committed Oct 9, 2023
1 parent d3e99fd commit 33e9387
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
3 changes: 2 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e"

[targets]
test = ["Enzyme", "BenchmarkTools", "SafeTestsets", "Pkg", "Test", "ForwardDiff", "StaticArrays", "Symbolics", "LinearSolve", "Random", "LinearAlgebra", "Zygote", "SparseDiffTools", "NonlinearProblemLibrary"]
test = ["Enzyme", "BenchmarkTools", "SafeTestsets", "Pkg", "Test", "ForwardDiff", "StaticArrays", "Symbolics", "LinearSolve", "Random", "LinearAlgebra", "Zygote", "SparseDiffTools", "NonlinearProblemLibrary", "DiffEqBase"]
5 changes: 0 additions & 5 deletions src/trustRegion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -420,14 +420,9 @@ function retrospective_step!(cache::TrustRegionCache)
end

function trust_region_step!(cache::TrustRegionCache)
<<<<<<< HEAD
@unpack fu_new, du, g, H, loss, max_trust_r, radius_update_scheme = cache
=======
@unpack fu_new, step_size, g, H, loss, max_trust_r, radius_update_scheme = cache

tc_storage = cache.tc_storage
termination_condition = cache.alg.termination_condition(tc_storage)
>>>>>>> Update all algorithms to use termination condition
cache.loss_new = get_loss(fu_new)

# Compute the ratio of the actual reduction to the predicted reduction.
Expand Down
4 changes: 2 additions & 2 deletions test/basictests.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using BenchmarkTools, LinearSolve, NonlinearSolve, StaticArrays, Random, LinearAlgebra,
Test, ForwardDiff, Zygote, Enzyme, SparseDiffTools
Test, ForwardDiff, Zygote, Enzyme, SparseDiffTools, DiffEqBase

_nameof(x) = applicable(nameof, x) ? nameof(x) : _nameof(typeof(x))

Expand Down Expand Up @@ -445,7 +445,7 @@ end
end
termination_condition = NLSolveTerminationCondition(mode; abstol = nothing,
reltol = nothing)
probN2 = NonlinearProblem(quadratic_f, u0, 2.0)
probN = NonlinearProblem(quadratic_f, u0, 2.0)
@test all(solve(probN, LevenbergMarquardt(; termination_condition)).u .≈ sqrt(2.0))
end
end

0 comments on commit 33e9387

Please sign in to comment.