Add random_positive_definite_matrix() and its tests.
[octave.git] / tests / random_positive_definite_matrix_tests.m
1 for n = [ 5, 10, 25, 50, 100 ]
2 A = random_positive_definite_matrix(n);
3 [R, P] = chol(A);
4
5 # chol() will set P=0 if A was symmetric positive-definite.
6 expected = 0;
7 msg = sprintf('random_positive_definite_matrix(%d) has a chol()', n);
8 unit_test_equals(msg, expected, P);
9 end