Skip to content

Commit b123918

Browse files
committed
🤖 Format .jl files
1 parent a212d5e commit b123918

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

src/utils.jl

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,9 @@ function parser_MOI(moimodel, index_map, nvar)
380380

381381
contypes = MOI.get(moimodel, MOI.ListOfConstraintTypesPresent())
382382
for (F, S) in contypes
383-
(F == VNF) && error("The function $F is not supported. Please use `.<=`, `.==`, and `.>=` in your constraints to ensure compatibility with ScalarNonlinearFunction.")
383+
(F == VNF) && error(
384+
"The function $F is not supported. Please use `.<=`, `.==`, and `.>=` in your constraints to ensure compatibility with ScalarNonlinearFunction.",
385+
)
384386
F <: AF || F <: QF || F == SNF || F == VI || error("Function $F is not supported.")
385387
S <: LS || error("Set $S is not supported.")
386388

@@ -430,12 +432,7 @@ end
430432
# Affine or quadratic, nothing to do
431433
_nlp_model(::MOI.Nonlinear.Model, ::MOI.ModelLike, ::Type, ::Type) = false
432434

433-
function _nlp_model(
434-
dest::MOI.Nonlinear.Model,
435-
src::MOI.ModelLike,
436-
F::Type{SNF},
437-
S::Type,
438-
)
435+
function _nlp_model(dest::MOI.Nonlinear.Model, src::MOI.ModelLike, F::Type{SNF}, S::Type)
439436
has_nonlinear = false
440437
for ci in MOI.get(src, MOI.ListOfConstraintIndices{F, S}())
441438
MOI.Nonlinear.add_constraint(

test/nlp_problems/nf.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
function nf()
22
f(x::Vector{VariableRef}) = sqrt.(x)
3-
g(x::Vector{VariableRef}) = x.^3
4-
h(x::Vector{VariableRef}) = sum(x.^4)
3+
g(x::Vector{VariableRef}) = x .^ 3
4+
h(x::Vector{VariableRef}) = sum(x .^ 4)
55
nlp = Model()
66
@variable(nlp, x[1:2])
77
@constraint(nlp, f(x) .- g(x) .>= 0)

0 commit comments

Comments
 (0)