Skip to content

Commit 7aed2f6

Browse files
committed
Save allocations cons_nln in FeasibilityFormNLS
1 parent 456f394 commit 7aed2f6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/feasibility-form-nls.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,12 @@ function NLPModels.cons_nln!(nlp::FeasibilityFormNLS, xr::AbstractVector, c::Abs
124124
@lencheck nlp.meta.nnln c
125125
increment!(nlp, :neval_cons_nln)
126126
n, m, ne = nlp.internal.meta.nvar, nlp.internal.meta.nnln, nlp.internal.nls_meta.nequ
127-
x = @view xr[1:n]
128-
r = @view xr[(n + 1):end]
129-
residual!(nlp.internal, x, @view c[1:ne])
130-
c[1:ne] .-= r
131-
if m > 0
132-
cons_nln!(nlp.internal, x, @view c[(ne + 1):end])
127+
@views begin
128+
residual!(nlp.internal, xr[1:n], c[1:ne])
129+
c[1:ne] .-= xr[(n + 1):end]
130+
if m > 0
131+
cons_nln!(nlp.internal, xr[1:n], c[(ne + 1):end])
132+
end
133133
end
134134
return c
135135
end

0 commit comments

Comments
 (0)