Skip to content

Commit 213110c

Browse files
authored
Remove limits_box (#1261)
1 parent d6334b9 commit 213110c

2 files changed

Lines changed: 2 additions & 24 deletions

File tree

src/multivariate/solvers/constrained/fminbox.jl

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -145,27 +145,6 @@ function NLSolversBase.value_jvp!(obj::BarrierWrapper, x, v)
145145
return obj.Ftotal, JVPtotal
146146
end
147147

148-
function limits_box(
149-
x::AbstractArray{T},
150-
d::AbstractArray{T},
151-
l::AbstractArray{T},
152-
u::AbstractArray{T},
153-
) where {T}
154-
alphamax = convert(T, Inf)
155-
@inbounds for i in eachindex(x)
156-
if d[i] < 0
157-
alphamax = min(alphamax, ((l[i] - x[i]) + eps(l[i])) / d[i])
158-
elseif d[i] > 0
159-
alphamax = min(alphamax, ((u[i] - x[i]) - eps(u[i])) / d[i])
160-
end
161-
end
162-
epsilon = eps(max(alphamax, one(T)))
163-
if !isinf(alphamax) && alphamax > epsilon
164-
alphamax -= epsilon
165-
end
166-
return alphamax
167-
end
168-
169148
# Default preconditioner for box-constrained optimization
170149
# This creates the inverse Hessian of the barrier penalty
171150
function precondprepbox!(P, x, l, u, dfbox)

src/multivariate/solvers/first_order/cg.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,8 @@
3838
# exterior points. It's just more efficient if you know the
3939
# maximum, because you don't have to test values that won't
4040
# work.) The maximum should be specified as the largest value for
41-
# which a finite value will be returned. See, e.g., limits_box
42-
# below. The default value for alphamax is Inf. See alphamaxfunc
43-
# for cgdescent and alphamax for linesearch_hz.
41+
# which a finite value will be returned. The default value for
42+
# alphamax is Inf.
4443

4544
struct ConjugateGradient{Tf,T,Tprep,IL,L} <: FirstOrderOptimizer
4645
eta::Tf

0 commit comments

Comments
 (0)