Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 19 additions & 9 deletions src/fletchcr.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
# Source: The second problem given by
# R. Fletcher,
# "An optimal positive definite update for sparse Hessian matrices"
# Numerical Analysis report NA/145, University of Dundee, 1992.

# Scaled version.

# SIF input: Nick Gould, Oct 1992.

# Source:
# problem 32 in
# L. Luksan, C. Matonoha and J. Vlcek
# Modified CUTE problems for sparse unconstrained optimization,
Expand All @@ -16,6 +8,24 @@
#
# http://www.cs.cas.cz/matonoha/download/V1081.pdf
#
# CUTEst cites
# The second problem given by
# R. Fletcher,
# "An optimal positive definite update for sparse Hessian matrices"
# Numerical Analysis report NA/145, University of Dundee, 1992.
#
# Scaled version.
#
# SIF input: Nick Gould, Oct 1992.
#
# as source for this problem.
# It is possible that Fletcher may have used this problem in his
# technical report, but the published version of his report
#
# SIAM J. Optimization, 5(1), pp 192-218, 1995
#
# uses the chained Rosenbrock problem, not the one below.
#
# classification OUR2-AN-V-0
#
# J.-P. Dussault, Rennes 09/2015.
Expand Down
2 changes: 1 addition & 1 deletion src/hs105.jl
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function hs105(args...)
@NLobjective(
nlp,
Min,
- sum(log(a[i] + b[i] + c[i])/sqrt(2*pi) for i=1:235)
- sum(log((a[i] + b[i] + c[i])/sqrt(2*pi)) for i=1:235)
)

return nlp
Expand Down
4 changes: 2 additions & 2 deletions src/hs55.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function hs55(args...)
@variable(nlp, 0 <= x[i=1:6] <= uvar[i], start = x0[i])

@constraint(nlp, x[1] + 2*x[2] + 5*x[5] - 6 == 0)
@constraint(nlp, x[3] + x[2] + x[3] - 3 == 0)
@constraint(nlp, x[1] + x[2] + x[3] - 3 == 0)
@constraint(nlp, x[4] + x[5] + x[6] - 2 == 0)
@constraint(nlp, x[1] + x[4] - 1 == 0)
@constraint(nlp, x[2] + x[5] - 2 == 0)
Expand All @@ -35,4 +35,4 @@ function hs55(args...)
)

return nlp
end
end
12 changes: 7 additions & 5 deletions src/hs70.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ function hs70(args...)
yobs[11:19] = [.702,.528,.385,.257,.159,.0869,.0453,.01509,.00189]

@NLexpression(nlp, b, x[3] + (1-x[3])*x[4])
@NLexpression(nlp, ycal[i=1:19], (1 + 1/(12*x[2]))*(x[3]*b^x[2])*((x[2]/6.2832)^(0.5))
*(c[i]/7.685)^(x[2] - 1)*exp(x[2] - b*c[i]*x[2]/7.658)
+ (1 + (1/(12*x[1])))*(1 - x[3])*(b/x[4])^x[1]*(x[1]/6.2832)^0.5
* (c[i]/7.658)^(x[1]-1)*exp(x[1] - b*c[i]*x[1]/(7.658*x[4]))
@NLexpression(nlp,
ycal[i=1:19],
(1 + 1 / (12 * x[2])) * (x[3] * b^x[2] * (x[2] / 6.2832)^(0.5) *
(c[i] / 7.685)^(x[2] - 1) * exp(x[2] - b * c[i] * x[2] / 7.658)) +
(1 + 1 / (12 * x[1])) * (1 - x[3]) * (b / x[4])^x[1] * (x[1] / 6.2832)^0.5 *
(c[i] / 7.658)^(x[1] - 1) * exp(x[1] - b * c[i] * x[1] / (7.658 * x[4]))
)

@NLconstraint(nlp, x[3] + (1-x[3])*x[4] >= 0)
Expand All @@ -47,4 +49,4 @@ function hs70(args...)
)

return nlp
end
end
4 changes: 2 additions & 2 deletions src/hs93.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ function hs93(args...)
@NLobjective(
nlp,
Min,
0.204*x[1]*x[4]*(x[1] + x[2] + x[3])
0.0204*x[1]*x[4]*(x[1] + x[2] + x[3])
+ 0.0187*x[2]*x[3]*(x[1] + 1.57*x[2] + x[4])
+ 0.0607*x[1]*x[4]*x[5]^2*(x[1] + x[2] + x[3])
+ 0.0437*x[2]*x[3]*x[6]^2*(x[1] + 1.57*x[2] + x[4])
)

return nlp
end
end
4 changes: 2 additions & 2 deletions test/compare_cutest.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ function compute_status(probname; showvals=false)
x0 = optnlp.meta.x0
if !(obj(cutenlp, x0) ≈ obj(optnlp, x0))
sameobjval = false
showvals && @show obj(cutenlp, x0) obj(d, x0)
showvals && @show obj(cutenlp, x0) obj(optnlp, x0)
end
if !(grad(cutenlp, x0) ≈ grad(optnlp, x0))
samegradval = false
showvals && @show [grad(cutenlp, x0) grad(d, x0)]
showvals && @show [grad(cutenlp, x0) grad(optnlp, x0)]
end
isok = true
end
Expand Down