changeset 10618:773566827bcf

Split qrdelete test into high precision test when QRUPDATE is present and low precision when it is not.
author Rik <octave@nomad.inbox5.com>
date Mon, 10 May 2010 11:55:16 -0700
parents 9c9e07f5eb1c
children 9f0a264d2f60
files src/ChangeLog src/DLD-FUNCTIONS/qr.cc
diffstat 2 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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 <octave@nomad.inbox5.com>
+
+	* 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  <highegg@gmail.com>
 
 	* DLD-FUNCTIONS/schur.cc (Fschur): Mark triangular matrices on output.
--- 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'))