Skip to content

Commit 8f3b82e

Browse files
committed
make StopWhenAny and StopWhenAll behave the same
1 parent e75ba99 commit 8f3b82e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/stopping_criterion.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,14 @@ when _all_ of them indicate to stop.
140140
141141
# Constructor
142142
143-
StopWhenAll(c::NTuple{N, StoppingCriterion} where {N})
143+
StopWhenAll(c::AbstractVector{<:StoppingCriterion})
144144
StopWhenAll(c::StoppingCriterion...)
145145
"""
146146
struct StopWhenAll{TCriteria <: Tuple} <: StoppingCriterion
147147
criteria::TCriteria
148+
StopWhenAll(c::StoppingCriterion...) = new{typeof(c)}(c)
148149
end
149-
StopWhenAll(c::AbstractVector{<:StoppingCriterion}) = StopWhenAll(Tuple(c))
150-
StopWhenAll(c...) = StopWhenAll(c)
150+
StopWhenAll(c::AbstractVector{<:StoppingCriterion}) = StopWhenAll(c...)
151151
function indicates_convergence(stop_when_all::StopWhenAll)
152152
return any(indicates_convergence, stop_when_all.criteria)
153153
end

0 commit comments

Comments
 (0)