Add extended_powell functions and their tests.
[octave.git] / tests / extended_powell1_tests.m
1 ## Test the optimal point.
2
3 for m = [ 1 : 10 ]
4 x = repmat([0;0;0;0], m, 1);
5
6 msg = sprintf("extended_powell1([0;0;0;0...]) == 0 (m = %d)", m);
7 unit_test_equals(msg, 0, extended_powell1(x));
8 end
9
10 ## It should fail with the wrong number of coordinates.
11 f = extended_powell1([1]);
12 unit_test_equals("extended_powell1 fails when length(x) is odd", ...
13 true, ...
14 isna(f));