Skip to content

Commit 2cb5dbb

Browse files
committed
specify nlpmeta type
1 parent 460cf12 commit 2cb5dbb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/slack-model.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ The slack variables are implicitly ordered as linear and then nonlinear, and
6767
``c_L ≤ c(x) < ∞``, ``-∞ < c(x) ≤ c_U`` and
6868
``c_L ≤ c(x) ≤ c_U``, respectively.
6969
"""
70-
mutable struct SlackModel{T, S, M <: AbstractNLPModel{T}} <: AbstractNLPModel{T, S}
70+
mutable struct SlackModel{T, S, M <: AbstractNLPModel{T, S}} <: AbstractNLPModel{T, S}
7171
meta::NLPModelMeta{T, S}
7272
model::M
7373

@@ -90,7 +90,7 @@ end
9090

9191
"""Like `SlackModel`, this model converts inequalities into equalities and bounds.
9292
"""
93-
mutable struct SlackNLSModel{T, S, M <: AbstractNLPModel{T}} <: AbstractNLSModel{T, S}
93+
mutable struct SlackNLSModel{T, S, M <: AbstractNLPModel{T, S}} <: AbstractNLSModel{T, S}
9494
meta::NLPModelMeta{T, S}
9595
nls_meta::NLSMeta{T, S}
9696
model::M
@@ -131,7 +131,7 @@ function slack_meta(meta::AbstractNLPModelMeta{T, S}; name = meta.name * "-slack
131131
x0 = similar(meta.x0, meta.nvar + ns)
132132
x0[1:(meta.nvar)] .= meta.x0
133133
x0[(meta.nvar + 1):end] .= zero(T)
134-
return NLPModelMeta(
134+
return NLPModelMeta{T, S}(
135135
meta.nvar + ns,
136136
x0 = x0,
137137
lvar = lvar,
@@ -177,7 +177,7 @@ function SlackNLSModel(
177177
x0 = similar(model.meta.x0, model.meta.nvar + ns)
178178
x0[(model.meta.nvar + 1):end] .= zero(T)
179179
x0[1:(model.meta.nvar)] .= model.meta.x0
180-
nls_meta = NLSMeta{T, typeof(meta.x0)}( # might differ from S
180+
nls_meta = NLSMeta{T, S}(
181181
model.nls_meta.nequ,
182182
model.meta.nvar + ns,
183183
x0 = x0,

0 commit comments

Comments
 (0)