]> gitweb.michael.orlitzky.com - octave.git/blobdiff - optimization/test_functions/rosenbrock_hessian.m
Add the Rosenbrock functions and their tests.
[octave.git] / optimization / test_functions / rosenbrock_hessian.m
diff --git a/optimization/test_functions/rosenbrock_hessian.m b/optimization/test_functions/rosenbrock_hessian.m
new file mode 100644 (file)
index 0000000..cd2a2b5
--- /dev/null
@@ -0,0 +1,11 @@
+function H = rosenbrock_hessian(x1, x2)
+  ##
+  ## The Hessian of the Rosenbrock function. See rosenbrock.m for more
+  ## information.
+  ##
+  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,2) = 200;
+end