# HG changeset patch # User jwe # Date 1200339262 0 # Node ID fe9a44d753d63435e3cd29eebff1c96b07f58483 # Parent 74d64ead0cd7cd001243cef038075b9f1d116023 [project @ 2008-01-14 19:34:22 by jwe] diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2008-01-14 John W. Eaton + + * optimization/sqp.m: Fix function definitions in test code. + 2008-01-12 John W. Eaton * plot/gnuplot_binary.in: New file. diff --git a/scripts/optimization/sqp.m b/scripts/optimization/sqp.m --- a/scripts/optimization/sqp.m +++ b/scripts/optimization/sqp.m @@ -713,16 +713,13 @@ ### endfunction -%! function r = g (x) +%!function r = g (x) +%! r = [sumsq(x)-10; +%! x(2)*x(3)-5*x(4)*x(5); +%! x(1)^3+x(2)^3+1 ]; %! -%! r = [ sumsq(x)-10; -%! x(2)*x(3)-5*x(4)*x(5); -%! x(1)^3+x(2)^3+1 ]; -%! endfunction -%! -%! function obj = phi (x) -%! obj = exp(prod(x)) - 0.5*(x(1)^3+x(2)^3+1)^2; -%! endfunction +%!function obj = phi (x) +%! obj = exp(prod(x)) - 0.5*(x(1)^3+x(2)^3+1)^2; %! %!test %! x0 = [-1.8; 1.7; 1.9; -0.8; -0.8]; @@ -735,6 +732,6 @@ %! -0.763643103133572; %! -0.763643068453300]; %! -%! obj_opt = 0.0539498477702739 +%! obj_opt = 0.0539498477702739; %! %! assert (all (abs (x-x_opt) < sqrt (eps)) && abs (obj-obj_opt) < sqrt (eps));