]> gitweb.michael.orlitzky.com - octave.git/blobdiff - optimization/test_functions/rosenbrock_hessian1.m
Add the Rosenbrock functions and their tests.
[octave.git] / optimization / test_functions / rosenbrock_hessian1.m
diff --git a/optimization/test_functions/rosenbrock_hessian1.m b/optimization/test_functions/rosenbrock_hessian1.m
new file mode 100644 (file)
index 0000000..63a105f
--- /dev/null
@@ -0,0 +1,12 @@
+function H = rosenbrock_hessian1(x)
+  ##
+  ## A version of the rosenbrock_hessian() function which takes a column
+  ## 2-vector instead of two distinct arguments. See rosenbrock_hessian.m
+  ## for more information.
+  ##
+  if (length(x) == 2)
+    H = rosenbrock_hessian(x(1), x(2));
+  else
+    H = NA;
+  end
+end