@@ -19,6 +19,11 @@ const SQF = MOI.ScalarQuadraticFunction{Float64} # ScalarQuadraticFunction{T}(a
1919const VQF = MOI. VectorQuadraticFunction{Float64} # VectorQuadraticFunction{T}(affine_terms, quadratic_terms, constants)
2020const QF = Union{SQF, VQF}
2121
22+ # ScalarNonlinearFunction and VectorNonlinearFunction
23+ const SNF = MOI. ScalarNonlinearFunction
24+ const VNF = MOI. VectorNonlinearFunction
25+ const NF = Union{SNF, VNF}
26+
2227# AffLinSets and VecLinSets
2328const ALS = Union{
2429 MOI. EqualTo{Float64},
@@ -375,11 +380,7 @@ function parser_MOI(moimodel, index_map, nvar)
375380
376381 contypes = MOI. get (moimodel, MOI. ListOfConstraintTypesPresent ())
377382 for (F, S) in contypes
378- F <: AF ||
379- F <: QF ||
380- F == MOI. ScalarNonlinearFunction ||
381- F == VI ||
382- error (" Function $F is not supported." )
383+ F <: AF || F <: QF || F == NF || F == VI || error (" Function $F is not supported." )
383384 S <: LS || error (" Set $S is not supported." )
384385
385386 conindices = MOI. get (moimodel, MOI. ListOfConstraintIndices {F, S} ())
@@ -431,7 +432,7 @@ _nlp_model(::MOI.Nonlinear.Model, ::MOI.ModelLike, ::Type, ::Type) = false
431432function _nlp_model (
432433 dest:: MOI.Nonlinear.Model ,
433434 src:: MOI.ModelLike ,
434- F:: Type{<:Union{MOI.ScalarNonlinearFunction, MOI.VectorNonlinearFunction} } ,
435+ F:: Type{<:NF } ,
435436 S:: Type ,
436437)
437438 has_nonlinear = false
@@ -460,7 +461,7 @@ function _nlp_model(model::MOI.ModelLike)::Union{Nothing, MOI.Nonlinear.Model}
460461 has_nonlinear |= _nlp_model (nlp_model, model, F, S)
461462 end
462463 F = MOI. get (model, MOI. ObjectiveFunctionType ())
463- if F <: MOI.ScalarNonlinearFunction
464+ if F <: SNF
464465 MOI. Nonlinear. set_objective (nlp_model, MOI. get (model, MOI. ObjectiveFunction {F} ()))
465466 has_nonlinear = true
466467 end
0 commit comments