Mercurial > hg > octave-lyh
diff test/build_sparse_tests.sh @ 5610:9761b7d24e9e
[project @ 2006-02-09 09:12:02 by dbateman]
author | dbateman |
---|---|
date | Thu, 09 Feb 2006 09:12:03 +0000 |
parents | 2c66c36d2698 |
children | 512d0d11ae39 |
line wrap: on
line diff
--- a/test/build_sparse_tests.sh +++ b/test/build_sparse_tests.sh @@ -914,6 +914,26 @@ %!assert(sparse(tcs\xs),sparse(tcf\xf),1e-10); EOF + +cat >>$TESTS <<EOF +%% QR solver tests + +%!function f(a, sz, feps) +%! b = randn(sz); x = a \b; +%! assert (a * x, b, feps); +%! b = randn(sz)+1i*randn(sz); x = a \ b; +%! assert (a * x, b, feps); +%! b = sprandn(sz(1),sz(2),0.2); x = a \b; +%! assert (sparse(a * x), b, feps); +%! b = sprandn(sz(1),sz(2),0.2)+1i*sprandn(sz(1),sz(2),0.2); x = a \b; +%! assert (sparse(a * x), b, feps); +%!test +%! a = alpha*sprandn(10,11,0.2)+speye(10,11); f(a,[10,2],1e-10); +%! ## Test this by forcing matrix_type +%! a = alpha*sprandn(10,10,0.2)+speye(10,10); matrix_type(a, "Singular"); +%! f(a,[10,2],1e-10); + +EOF }