From: Michael Orlitzky Date: Thu, 14 Mar 2013 04:22:03 +0000 (-0400) Subject: Two minor optimizations to test functions. X-Git-Url: http://gitweb.michael.orlitzky.com/?p=octave.git;a=commitdiff_plain;h=e5d2c4a2963be5eb6c767b47d3c7427db3d00ec4 Two minor optimizations to test functions. --- diff --git a/optimization/test_functions/himmelblau_hessian.m b/optimization/test_functions/himmelblau_hessian.m index 5a8752f..24b277a 100644 --- a/optimization/test_functions/himmelblau_hessian.m +++ b/optimization/test_functions/himmelblau_hessian.m @@ -6,6 +6,6 @@ function H = himmelblau_hessian(x1, x2) H = zeros(2,2); H(1,1) = 12*x1^2 + 4*x2 - 42; H(1,2) = 4*x1 + 4*x2; - H(2,1) = 4*x1 + 4*x2; + H(2,1) = H(1,2); H(2,2) = 12*x2^2 + 4*x1 - 26; end diff --git a/optimization/test_functions/rosenbrock_hessian.m b/optimization/test_functions/rosenbrock_hessian.m index cd2a2b5..066b5ae 100644 --- a/optimization/test_functions/rosenbrock_hessian.m +++ b/optimization/test_functions/rosenbrock_hessian.m @@ -6,6 +6,6 @@ function H = rosenbrock_hessian(x1, x2) H = zeros(2,2); H(1,1) = 1200*x1^2 - 400*x2 + 2; H(1,2) = -400*x1; - H(2,1) = -400*x1; + H(2,1) = H(1,2); H(2,2) = 200; end