]> gitweb.michael.orlitzky.com - octave.git/blobdiff - optimization/test_functions/himmelblau1.m
Add the Himmelblau function, as defined in Applied Nonlinear Programming.
[octave.git] / optimization / test_functions / himmelblau1.m
diff --git a/optimization/test_functions/himmelblau1.m b/optimization/test_functions/himmelblau1.m
new file mode 100644 (file)
index 0000000..c975af2
--- /dev/null
@@ -0,0 +1,12 @@
+function f = himmelblau1(x)
+  ##
+  ## A version of the Himmelblau function which takes a column
+  ## 2-vector instead of two distinct arguments. See himmelblau.m for
+  ## more information.
+  ##
+  if (length(x) == 2)
+    f = himmelblau(x(1), x(2));
+  else
+    f = NA;
+  end
+end