Skip to content

Commit

Permalink
Handle linear constructor without linear constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
tmigot authored and amontoison committed Dec 8, 2024
1 parent 1fe420b commit 21ac60a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/nlp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ function ADNLPModel!(
@lencheck nvar x0
@lencheck ncon ucon y0

nlin = maximum(clinrows)
nlin = isempty(clinrows) ? 0 : maximum(clinrows)
lin = 1:nlin
lin_nnzj = length(clinvals)
@lencheck lin_nnzj clinrows clincols
Expand Down Expand Up @@ -470,7 +470,7 @@ function ADNLPModel!(
@lencheck nvar x0 lvar uvar
@lencheck ncon y0 ucon

nlin = maximum(clinrows)
nlin = isempty(clinrows) ? 0 : maximum(clinrows)
lin = 1:nlin
lin_nnzj = length(clinvals)
@lencheck lin_nnzj clinrows clincols
Expand Down
4 changes: 2 additions & 2 deletions src/nls.jl
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ function ADNLSModel!(
ncon = length(lcon)
@lencheck ncon ucon y0

nlin = maximum(clinrows)
nlin = isempty(clinrows) ? 0 : maximum(clinrows)
lin = 1:nlin
lin_nnzj = length(clinvals)
@lencheck lin_nnzj clinrows clincols
Expand Down Expand Up @@ -714,7 +714,7 @@ function ADNLSModel!(
@lencheck nvar lvar uvar
@lencheck ncon ucon y0

nlin = maximum(clinrows)
nlin = isempty(clinrows) ? 0 : maximum(clinrows)
lin = 1:nlin
lin_nnzj = length(clinvals)
@lencheck lin_nnzj clinrows clincols
Expand Down

0 comments on commit 21ac60a

Please sign in to comment.