Skip to content

Commit da20065

Browse files
committed
Use the last release of NLPModelsTest.jl
1 parent 8614e02 commit da20065

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ JuMP = "1.25"
1616
LinearAlgebra = "1.10"
1717
MathOptInterface = "1.46"
1818
NLPModels = "0.21.6"
19-
NLPModelsTest = "0.10.5"
19+
NLPModelsTest = "0.10.6"
2020
Percival = "0.7.3"
2121
Printf = "1.10"
22-
SolverCore = "0.3"
22+
SolverCore = "0.3.9"
2323
SparseArrays = "1.10"
2424
Test = "1.10"
2525
julia = "1.10"

src/moi_nlp_model.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function nlp_model(moimodel::MOI.ModelLike; hessian::Bool = true, name::String =
3535
parser_MOI(moimodel, index_map, nvar)
3636

3737
nlp_data = _nlp_block(moimodel)
38-
nlcon, nl_lcon, nl_ucon = parser_NL(nlp_data, hessian = hessian)
38+
nlcon = parser_NL(nlp_data, hessian = hessian)
3939
oracles = parser_oracles(moimodel)
4040
counters = Counters()
4141
λ = zeros(Float64, nlcon.nnln) # Lagrange multipliers for hess_coord! and hprod! without y
@@ -49,8 +49,8 @@ function nlp_model(moimodel::MOI.ModelLike; hessian::Bool = true, name::String =
4949

5050
# Total counts
5151
ncon = nlin + quadcon.nquad + nlcon.nnln + oracles.ncon
52-
lcon = vcat(lin_lcon, quad_lcon, nl_lcon, oracles.lcon)
53-
ucon = vcat(lin_ucon, quad_ucon, nl_ucon, oracles.ucon)
52+
lcon = vcat(lin_lcon, quad_lcon, nlcon.nl_lcon, oracles.lcon)
53+
ucon = vcat(lin_ucon, quad_ucon, nlcon.nl_ucon, oracles.ucon)
5454
nnzj = lincon.nnzj + quadcon.nnzj + nlcon.nnzj + oracles.nnzj
5555
nnzh = obj.nnzh + quadcon.nnzh + nlcon.nnzh + oracles.nnzh
5656
meta = NLPModelMeta(

src/moi_nls_model.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ function MathOptNLSModel(cmodel::JuMP.Model, F; hessian::Bool = true, name::Stri
3636
parser_MOI(moimodel, index_map, nvar)
3737

3838
nlp_data = _nlp_block(moimodel)
39-
nlcon, nl_lcon, nl_ucon = parser_NL(nlp_data, hessian = hessian)
39+
nlcon = parser_NL(nlp_data, hessian = hessian)
4040
λ = zeros(nlcon.nnln) # Lagrange multipliers for hess_coord! and hprod! without y
4141

4242
nequ = nlinequ + nnlnequ
4343
Fnnzj = linequ.nnzj + nlequ.nnzj
4444
Fnnzh = nlequ.nnzh
4545

4646
ncon = nlin + quadcon.nquad + nlcon.nnln
47-
lcon = vcat(lin_lcon, quad_lcon, nl_lcon)
48-
ucon = vcat(lin_ucon, quad_ucon, nl_ucon)
47+
lcon = vcat(lin_lcon, quad_lcon, nlcon.nl_lcon)
48+
ucon = vcat(lin_ucon, quad_ucon, nlcon.nl_ucon)
4949
cnnzj = lincon.nnzj + quadcon.nnzj + nlcon.nnzj
5050
cnnzh = lls.nnzh + quadcon.nnzh + nlcon.nnzh
5151

src/utils.jl

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ end
9696
9797
Structure containing Jacobian and Hessian structures of nonlinear constraints:
9898
- nnln: number of nonlinear constraints
99+
- nl_lcon: lower bounds of nonlinear constraints
100+
- nl_ucon: upper bounds of nonlinear constraints
99101
- jac_rows: row indices of the Jacobian in Coordinate format (COO) format
100102
- jac_cols: column indices of the Jacobian in COO format
101103
- nnzj: number of non-zero entries in the Jacobian
@@ -105,6 +107,8 @@ Structure containing Jacobian and Hessian structures of nonlinear constraints:
105107
"""
106108
mutable struct NonLinearStructure
107109
nnln::Int
110+
nl_lcon::Vector{Float64}
111+
nl_ucon::Vector{Float64}
108112
jac_rows::Vector{Int}
109113
jac_cols::Vector{Int}
110114
nnzj::Int
@@ -589,8 +593,6 @@ Parse nonlinear constraints of an `nlp_data`.
589593
590594
Returns:
591595
- nlcon: NonLinearStructure containing Jacobian and Hessian structures
592-
- nl_lcon: lower bounds of nonlinear constraints
593-
- nl_ucon: upper bounds of nonlinear constraints
594596
"""
595597
function parser_NL(nlp_data; hessian::Bool = true)
596598
nnln = length(nlp_data.constraint_bounds)
@@ -608,9 +610,9 @@ function parser_NL(nlp_data; hessian::Bool = true)
608610
hess_rows = hessian ? getindex.(hess, 1) : Int[]
609611
hess_cols = hessian ? getindex.(hess, 2) : Int[]
610612
nnzh = length(hess)
611-
nlcon = NonLinearStructure(nnln, jac_rows, jac_cols, nnzj, hess_rows, hess_cols, nnzh)
613+
nlcon = NonLinearStructure(nnln, nl_lcon, nl_ucon, jac_rows, jac_cols, nnzj, hess_rows, hess_cols, nnzh)
612614

613-
return nlcon, nl_lcon, nl_ucon
615+
return nlcon
614616
end
615617

616618
"""
@@ -886,7 +888,7 @@ function parser_nonlinear_expression(cmodel, nvar, F; hessian::Bool = true)
886888
Fhess_cols = hessian && Feval nothing ? getindex.(Fhess, 2) : Int[]
887889
nl_Fnnzh = length(Fhess)
888890

889-
nlequ = NonLinearStructure(nnlnequ, Fjac_rows, Fjac_cols, nl_Fnnzj, Fhess_rows, Fhess_cols, nl_Fnnzh)
891+
nlequ = NonLinearStructure(nnlnequ, Float64[], Float64[], Fjac_rows, Fjac_cols, nl_Fnnzj, Fhess_rows, Fhess_cols, nl_Fnnzh)
890892

891893
return Feval, nlequ, nnlnequ
892894
end

0 commit comments

Comments
 (0)