# HG changeset patch # User Rik # Date 1273517716 25200 # Node ID 773566827bcf24b91fc7e275f163e75858f36d63 # Parent 9c9e07f5eb1caf4e5b42a72ec29ce3434292f30d Split qrdelete test into high precision test when QRUPDATE is present and low precision when it is not. diff -r 9c9e07f5eb1c -r 773566827bcf src/ChangeLog --- a/src/ChangeLog Mon May 10 07:50:56 2010 +0200 +++ b/src/ChangeLog Mon May 10 11:55:16 2010 -0700 @@ -1,3 +1,8 @@ +2010-05-10 Rik + + * DLD-FUNCTIONS/qr.cc: Split qrdelete test into high precision test + when QRUPDATE is present and low precision when it is not. + 2010-05-10 Jaroslav Hajek * DLD-FUNCTIONS/schur.cc (Fschur): Mark triangular matrices on output. diff -r 9c9e07f5eb1c -r 773566827bcf src/DLD-FUNCTIONS/qr.cc --- a/src/DLD-FUNCTIONS/qr.cc Mon May 10 07:50:56 2010 +0200 +++ b/src/DLD-FUNCTIONS/qr.cc Mon May 10 11:55:16 2010 -0700 @@ -1396,6 +1396,19 @@ %! %! [Q,R] = qr(AA); %! [Q,R] = qrdelete(Q,R,3,'row'); +%! assert(norm(vec(Q'*Q - eye(4,'single')),Inf) < 1.5e1*eps('single')) +%! assert(norm(vec(triu(R)-R),Inf) == 0) +%! assert(norm(vec(Q*R - [AA(1:2,:);AA(4:5,:)]),Inf) < norm(AA)*1e1*eps('single')) +%!testif HAVE_QRUPDATE +%! # Same test as above but with more precicision +%! AA = single([0.091364 0.613038 0.027504 0.999083; +%! 0.594638 0.425302 0.562834 0.603537; +%! 0.383594 0.291238 0.742073 0.085574; +%! 0.265712 0.268003 0.783553 0.238409; +%! 0.669966 0.743851 0.457255 0.445057 ]); +%! +%! [Q,R] = qr(AA); +%! [Q,R] = qrdelete(Q,R,3,'row'); %! assert(norm(vec(Q'*Q - eye(4,'single')),Inf) < 1e1*eps('single')) %! assert(norm(vec(triu(R)-R),Inf) == 0) %! assert(norm(vec(Q*R - [AA(1:2,:);AA(4:5,:)]),Inf) < norm(AA)*1e1*eps('single'))