Skip to content

Commit bebc93f

Browse files
committed
fix convergence indication of StopWhenChangeLess
1 parent 8060ae5 commit bebc93f

3 files changed

Lines changed: 5 additions & 7 deletions

File tree

Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1717
### Fixed
1818

1919
* Line searches consistently respect `stop_when_stepsize_exceeds` keyword argument as a hard limit. (#554)
20+
* `StopWhenChangeLess` falsely claimed to indicate convergence. This is now fixed.
2021

2122
## [0.5.32] January 15, 2026
2223

src/plans/stopping_criterion.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ function status_summary(c::StopWhenChangeLess)
323323
s = has_stopped ? "reached" : "not reached"
324324
return "|Δp| < $(c.threshold): $s"
325325
end
326-
indicates_convergence(c::StopWhenChangeLess) = true
326+
indicates_convergence(c::StopWhenChangeLess) = false
327327
function show(io::IO, c::StopWhenChangeLess)
328328
s = ismissing(c.outer_norm) ? "" : "and outer norm $(c.outer_norm)"
329329
return print(

test/plans/test_stopping_criteria.jl

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,18 @@ end
88

99
@testset "StoppingCriteria" begin
1010
@testset "Generic Tests" begin
11-
@test_throws ErrorException get_stopping_criteria(
12-
Manopt.Test.DummyStoppingCriteriaSet()
13-
)
11+
@test_throws ErrorException get_stopping_criteria(Manopt.Test.DummyStoppingCriteriaSet())
1412

1513
s = StopWhenAll(StopAfterIteration(10), StopWhenChangeLess(Euclidean(), 0.1))
16-
@test Manopt.indicates_convergence(s) #due to all and change this is true
14+
@test !Manopt.indicates_convergence(s) # Neither of the two indicates convergence
1715
@test startswith(repr(s), "StopWhenAll with the")
1816
@test get_reason(s) === ""
1917
# Trigger second one manually
2018
s.criteria[2].last_change = 0.05
2119
s.criteria[2].at_iteration = 3
2220
@test length(get_reason(s.criteria[2])) > 0
2321
s2 = StopWhenAll([StopAfterIteration(10), StopWhenChangeLess(Euclidean(), 0.1)])
24-
@test get_stopping_criteria(s)[1].max_iterations ==
25-
get_stopping_criteria(s2)[1].max_iterations
22+
@test get_stopping_criteria(s)[1].max_iterations == get_stopping_criteria(s2)[1].max_iterations
2623

2724
s3 = StopWhenCostLess(0.1)
2825
p = DefaultManoptProblem(

0 commit comments

Comments
 (0)