Skip to content

Commit cefe5b0

Browse files
committed
Most 23 test problems now pass
1 parent 445e97b commit cefe5b0

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/trustRegion.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,7 @@ function retrospective_step!(cache::TrustRegionCache{iip}) where {iip}
384384
__update_JᵀJ!(cache, J)
385385
__update_Jᵀf!(cache, J)
386386

387-
num = __trust_region_loss(cache, cache.fu) -
388-
__get_trust_region_loss(cache, cache.fu_cache)
387+
num = __trust_region_loss(cache, cache.fu) - __trust_region_loss(cache, cache.fu_cache)
389388
denom = dot(_vec(cache.du), _vec(cache.Jᵀf)) + __lr_mul(cache, cache.JᵀJ, cache.du) / 2
390389
return num / denom
391390
end
@@ -441,7 +440,7 @@ function trust_region_step!(cache::TrustRegionCache)
441440
end
442441
elseif radius_update_scheme === RadiusUpdateSchemes.Hei
443442
@unpack shrink_threshold, p1, p2, p3, p4 = cache
444-
tr_new = __rfunc(r, shrink_threshold, p1, p3, p4, p2) * cache.internalnorm(du)
443+
tr_new = __rfunc(r, shrink_threshold, p1, p3, p4, p2) * cache.internalnorm(cache.du)
445444
if tr_new < cache.trust_r
446445
cache.shrink_counter += 1
447446
else
@@ -479,7 +478,7 @@ function trust_region_step!(cache::TrustRegionCache)
479478
elseif radius_update_scheme === RadiusUpdateSchemes.Bastin
480479
if r > cache.step_threshold
481480
if retrospective_step!(cache) cache.expand_threshold
482-
cache.trust_r = max(cache.p1 * cache.internalnorm(du), cache.trust_r)
481+
cache.trust_r = max(cache.p1 * cache.internalnorm(cache.du), cache.trust_r)
483482
end
484483
cache.shrink_counter = 0
485484
else

test/23_test_problems.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ end
5959
broken_tests = Dict(alg => Int[] for alg in alg_ops)
6060
broken_tests[alg_ops[1]] = [6, 11, 21]
6161
broken_tests[alg_ops[2]] = [6, 11, 21]
62-
broken_tests[alg_ops[3]] = [1, 6, 11, 12, 15, 16, 21]
63-
broken_tests[alg_ops[4]] = [1, 6, 8, 11, 15, 16, 21, 22]
62+
broken_tests[alg_ops[3]] = [6, 11, 21]
63+
broken_tests[alg_ops[4]] = [6, 11, 21]
6464
broken_tests[alg_ops[5]] = [6, 21]
6565
broken_tests[alg_ops[6]] = [6, 21]
6666

0 commit comments

Comments
 (0)