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