Add the Rosenbrock functions and their tests.
[octave.git] / tests / rosenbrock1_tests.m
1 ## Test the optimal point.
2
3 unit_test_equals("rosenbrock1([1;1]) == 0", ...
4 0, ...
5 rosenbrock1([1;1]));
6
7 ## It should fail with the wrong number of coordinates.
8 f = rosenbrock1([1]);
9 unit_test_equals("rosenbrock1 fails with too few coordinates", ...
10 true, ...
11 isna(f));
12
13 f = rosenbrock1([1;2;3]);
14 unit_test_equals("rosenbrock1 fails with too many coordinates", ...
15 true, ...
16 isna(f));