diff --git a/src/fletchcr.jl b/src/fletchcr.jl index d8a91dcf..c01cb13a 100644 --- a/src/fletchcr.jl +++ b/src/fletchcr.jl @@ -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, @@ -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. diff --git a/src/hs105.jl b/src/hs105.jl index 0cb2c8de..887b08f6 100644 --- a/src/hs105.jl +++ b/src/hs105.jl @@ -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 diff --git a/src/hs55.jl b/src/hs55.jl index e51db2f0..b510f925 100644 --- a/src/hs55.jl +++ b/src/hs55.jl @@ -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) @@ -35,4 +35,4 @@ function hs55(args...) ) return nlp -end \ No newline at end of file +end diff --git a/src/hs70.jl b/src/hs70.jl index bbaa9568..b6cee1ce 100644 --- a/src/hs70.jl +++ b/src/hs70.jl @@ -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) @@ -47,4 +49,4 @@ function hs70(args...) ) return nlp -end \ No newline at end of file +end diff --git a/src/hs93.jl b/src/hs93.jl index 3603cc6e..28285469 100644 --- a/src/hs93.jl +++ b/src/hs93.jl @@ -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 \ No newline at end of file +end diff --git a/test/compare_cutest.jl b/test/compare_cutest.jl index 8be6ca56..7f6d02fb 100644 --- a/test/compare_cutest.jl +++ b/test/compare_cutest.jl @@ -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