Skip to content

Commit 70ba563

Browse files
authored
Minor typo fixes (#2148)
1 parent 403bc58 commit 70ba563

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/Bridges/Constraint/bridges/norm_one.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ function MOI.get(
186186
bridge::NormOneBridge,
187187
)
188188
nn_primal = MOI.get(model, attr, bridge.nn_index)
189-
if nn_primal == nothing
189+
if nn_primal === nothing
190190
return nothing
191191
end
192192
t = (nn_primal[1] + sum(nn_primal)) / 2

src/Bridges/Constraint/bridges/quad_to_soc.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ function MOI.get(
237237
# `(Ux)'Ux / 2 - (-a'x + ub) + ub`
238238
# Otherwise, `Q = -U'U` and we have the value of
239239
# `Ux` and `a'x - ub`, so we get it with
240-
# `-(Ux)'Ux / 2 + (a'x - lb) + ub`
240+
# `-(Ux)'Ux / 2 + (a'x - lb) + lb`
241241
soc = MOI.get(model, attr, bridge.soc)
242242
if soc === nothing
243243
return nothing

src/Bridges/Constraint/bridges/soc_to_psd.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,5 +274,5 @@ function MOI.Bridges.inverse_adjoint_map_function(
274274
t, u, x = func[1], func[2], func[3:end]
275275
Q = (u / (2 * (x' * x))) * (x * x')
276276
M = [t x'/2; x/2 Q]
277-
return [M[i, j] for j in 1:size(M, 2) for i in 1:j]
277+
return [M[i, j] for j in axes(M, 2) for i in 1:j]
278278
end

src/Nonlinear/operators.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -617,11 +617,11 @@ function eval_multivariate_gradient(
617617
else
618618
total = prod(x)
619619
if iszero(total)
620-
for i in 1:length(x)
621-
g[i] = prod(x[j] for j in 1:length(x) if i != j)
620+
for i in eachindex(x)
621+
g[i] = prod(x[j] for j in eachindex(x) if i != j)
622622
end
623623
else
624-
for i in 1:length(x)
624+
for i in eachindex(x)
625625
g[i] = total / x[i]
626626
end
627627
end

0 commit comments

Comments
 (0)