Skip to content

Commit de3f89e

Browse files
farhadrclassdpo
authored andcommitted
bug 359, Issue with 'gulf' when use_nls= true
1 parent 190077e commit de3f89e

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/ADNLPProblems/gulf.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function gulf(
3535
m = min(m, 100)
3636

3737
function F!(r, x; m = m)
38-
for i = 1:n
38+
for i = 1:m
3939
r[i] =
4040
exp(-abs((25 + (-50 * log(i * one(T) / 100))^(2 // 3)) * m * i * x[2])^x[3] / x[1]) -
4141
i // 100

test/runtests.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ include("test_utils.jl")
4545
end
4646
end
4747

48+
@testset "Test for nls_prob flag for $prob" begin
49+
nls_prob = eval(Meta.parse("ADNLPProblems.$(prob)(use_nls = true)"))
50+
if (typeof(nls_prob) <: ADNLPModels.ADNLSModel) # if the nls_flag is not supported we ignore the prob
51+
test_in_place_residual(prob, nls_prob)
52+
end
53+
end
54+
4855
@testset "Test problems compatibility for $prob" begin
4956
prob_fn = eval(Meta.parse("PureJuMP.$(prob)"))
5057
model = prob_fn(n = ndef)

0 commit comments

Comments
 (0)