]> gitweb.michael.orlitzky.com - octave.git/blobdiff - tests/powell1_tests.m
Add powell(), powell1() and their tests.
[octave.git] / tests / powell1_tests.m
diff --git a/tests/powell1_tests.m b/tests/powell1_tests.m
new file mode 100644 (file)
index 0000000..dbcf71e
--- /dev/null
@@ -0,0 +1,16 @@
+## Test the optimal point.
+
+unit_test_equals("powell1([0;0;0;0]) == 0", ...
+                0, ...
+                powell1([0;0;0;0]));
+
+## It should fail with the wrong number of coordinates.
+f = powell1([1;2;3]);
+unit_test_equals("powell1 fails with too few coordinates", ...
+                true, ...
+                isna(f));
+
+f = powell1([1;2;3;4;5]);
+unit_test_equals("powell1 fails with too many coordinates", ...
+                true, ...
+                isna(f));