changeset 7371:fe9a44d753d6

[project @ 2008-01-14 19:34:22 by jwe]
author jwe
date Mon, 14 Jan 2008 19:34:22 +0000
parents 74d64ead0cd7
children c51426c80045
files scripts/ChangeLog scripts/optimization/sqp.m
diffstat 2 files changed, 11 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Mon Jan 14 19:14:26 2008 +0000
+++ b/scripts/ChangeLog	Mon Jan 14 19:34:22 2008 +0000
@@ -1,3 +1,7 @@
+2008-01-14  John W. Eaton  <jwe@octave.org>
+
+	* optimization/sqp.m: Fix function definitions in test code.
+
 2008-01-12  John W. Eaton  <jwe@octave.org>
 
 	* plot/gnuplot_binary.in: New file.
--- a/scripts/optimization/sqp.m	Mon Jan 14 19:14:26 2008 +0000
+++ b/scripts/optimization/sqp.m	Mon Jan 14 19:34:22 2008 +0000
@@ -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));