Skip to content

Commit 33e9387

Browse files
committed
fixup! add tests
1 parent d3e99fd commit 33e9387

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

Project.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
6262
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
6363
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
6464
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
65+
DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e"
6566

6667
[targets]
67-
test = ["Enzyme", "BenchmarkTools", "SafeTestsets", "Pkg", "Test", "ForwardDiff", "StaticArrays", "Symbolics", "LinearSolve", "Random", "LinearAlgebra", "Zygote", "SparseDiffTools", "NonlinearProblemLibrary"]
68+
test = ["Enzyme", "BenchmarkTools", "SafeTestsets", "Pkg", "Test", "ForwardDiff", "StaticArrays", "Symbolics", "LinearSolve", "Random", "LinearAlgebra", "Zygote", "SparseDiffTools", "NonlinearProblemLibrary", "DiffEqBase"]

src/trustRegion.jl

-5
Original file line numberDiff line numberDiff line change
@@ -420,14 +420,9 @@ function retrospective_step!(cache::TrustRegionCache)
420420
end
421421

422422
function trust_region_step!(cache::TrustRegionCache)
423-
<<<<<<< HEAD
424423
@unpack fu_new, du, g, H, loss, max_trust_r, radius_update_scheme = cache
425-
=======
426-
@unpack fu_new, step_size, g, H, loss, max_trust_r, radius_update_scheme = cache
427-
428424
tc_storage = cache.tc_storage
429425
termination_condition = cache.alg.termination_condition(tc_storage)
430-
>>>>>>> Update all algorithms to use termination condition
431426
cache.loss_new = get_loss(fu_new)
432427

433428
# Compute the ratio of the actual reduction to the predicted reduction.

test/basictests.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using BenchmarkTools, LinearSolve, NonlinearSolve, StaticArrays, Random, LinearAlgebra,
2-
Test, ForwardDiff, Zygote, Enzyme, SparseDiffTools
2+
Test, ForwardDiff, Zygote, Enzyme, SparseDiffTools, DiffEqBase
33

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

@@ -445,7 +445,7 @@ end
445445
end
446446
termination_condition = NLSolveTerminationCondition(mode; abstol = nothing,
447447
reltol = nothing)
448-
probN2 = NonlinearProblem(quadratic_f, u0, 2.0)
448+
probN = NonlinearProblem(quadratic_f, u0, 2.0)
449449
@test all(solve(probN, LevenbergMarquardt(; termination_condition)).u .≈ sqrt(2.0))
450450
end
451451
end

0 commit comments

Comments
 (0)