Mercurial > octave-nkf
diff src/DLD-FUNCTIONS/chol.cc @ 8871:fb1c929dbbb7
tests vs. 64-bit indexing
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 25 Feb 2009 12:56:36 -0500 |
parents | a6edd5c23cb5 |
children | 0d7ebf353400 |
line wrap: on
line diff
--- a/src/DLD-FUNCTIONS/chol.cc Wed Feb 25 10:21:33 2009 +0100 +++ b/src/DLD-FUNCTIONS/chol.cc Wed Feb 25 12:56:36 2009 -0500 @@ -195,7 +195,7 @@ else retval(0) = fact.R(); } - else +p else error ("chol: matrix not positive definite"); } } @@ -470,16 +470,20 @@ /* -%!test +%!shared A, Ainv %! A = [2,0.2;0.2,1]; %! Ainv = inv(A); +%!test %! Ainv1 = cholinv(A); +%! assert (norm(Ainv-Ainv1),0,1e-10) +%!testif HAVE_CHOLMOD %! Ainv2 = inv(sparse(A)); +%! assert (norm(Ainv-Ainv2),0,1e-10) +%!testif HAVE_CHOLDMOD %! Ainv3 = cholinv(sparse(A)); +%! assert (norm(Ainv-Ainv3),0,1e-10) +%!testif HAVE_CHOLDMOD %! Ainv4 = spcholinv(sparse(A)); -%! assert (norm(Ainv-Ainv1),0,1e-10) -%! assert (norm(Ainv-Ainv2),0,1e-10) -%! assert (norm(Ainv-Ainv3),0,1e-10) %! assert (norm(Ainv-Ainv4),0,1e-10) */