Add is_positive_definite() and its tests.
[octave.git] / tests / is_positive_definite_tests.m
1 A = [1,0;0,1];
2 unit_test_equals("The identity is positive definite", ...
3 true, ...
4 is_positive_definite(A));
5
6 A = [1,1;1,1];
7 unit_test_equals("All-ones matrix is not positive definite", ...
8 false, ...
9 is_positive_definite(A));
10
11 A = [5,1,2;1,6,3;2,3,7];
12 unit_test_equals("A diagonally-dominant matrix is positive definite", ...
13 true, ...
14 is_positive_definite(A));