Skip to content

Commit 60f3acd

Browse files
minor fixes
1 parent c10d206 commit 60f3acd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/systems/optimization/modelingtoolkitize.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function modelingtoolkitize(prob::DiffEqBase.OptimizationProblem; kwargs...)
2626
if !isnothing(prob.lcons)
2727
for i in 1:num_cons
2828
if !isinf(prob.lcons[i])
29-
if prob.lcons[i] != prob.ucons[i] &&
29+
if prob.lcons[i] != prob.ucons[i]
3030
push!(cons, prob.lcons[i] lhs[i])
3131
else
3232
push!(cons, lhs[i] ~ prob.ucons[i])

src/systems/optimization/optimizationsystem.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ function DiffEqBase.OptimizationProblem{iip}(sys::OptimizationSystem, u0map,
349349
lcons = lcons_
350350
ucons = ucons_
351351
else # use the user supplied constraints bounds
352-
haskey(kwargs, :lcons) && haskey(kwargs, :ucons) &&
352+
(haskey(kwargs, :lcons) haskey(kwargs, :ucons)) &&
353353
throw(ArgumentError("Expected both `ucons` and `lcons` to be supplied"))
354354
haskey(kwargs, :lcons) && length(kwargs[:lcons]) != length(cstr) &&
355355
throw(ArgumentError("Expected `lcons` to be of the same length as the vector of constraints"))
@@ -527,7 +527,7 @@ function OptimizationProblemExpr{iip}(sys::OptimizationSystem, u0map,
527527
lcons = lcons_
528528
ucons = ucons_
529529
else # use the user supplied constraints bounds
530-
!haskey(kwargs, :lcons) && !haskey(kwargs, :ucons) &&
530+
(haskey(kwargs, :lcons) haskey(kwargs, :ucons)) &&
531531
throw(ArgumentError("Expected both `ucons` and `lcons` to be supplied"))
532532
haskey(kwargs, :lcons) && length(kwargs[:lcons]) != length(cstr) &&
533533
throw(ArgumentError("Expected `lcons` to be of the same length as the vector of constraints"))

0 commit comments

Comments
 (0)