changeset 29557:50aa945836c3 stable

qz.cc: Let test pass with LAPACK 3.9.1 and earlier versions (bug #60357). * libinterp/corefcn/qz.cc: Re-phrase BIST to have it pass with the results returned by LAPACK 3.9.1 and with the (differing) result returned by earlier versions. (grafted from 33556123b892449d14fb90fe1a7c0b244f0bc3d1)
author Markus Mützel <markus.muetzel@gmx.de>
date Fri, 23 Apr 2021 19:30:43 +0200
parents d75aa2bf4915
children e8e9f815945a 6fc423987872
files libinterp/corefcn/qz.cc
diffstat 1 files changed, 5 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/qz.cc	Fri Apr 23 08:04:48 2021 -0700
+++ b/libinterp/corefcn/qz.cc	Fri Apr 23 19:30:43 2021 +0200
@@ -915,14 +915,11 @@
 %! [aa, bb, q, z, v, w, lambda] = qz (a, b);
 %! assert (q * a * z, aa, norm (aa) * 1e-14);
 %! assert (q * b * z, bb, norm (bb) * 1e-14);
-%! sz = find (isinf (lambda), 1);
-%! if (isempty (sz))
-%!   sz = numel (lamdda);
-%! endif
-%! observed = (b * v * diag (lambda)) (:, 1:sz);
-%! assert ((a*v)(:, 1:sz), observed, norm (observed) * 1e-14);
-%! observed = (diag (lambda) * w' * b) (1:sz, :);
-%! assert ((w'*a)(1:sz, :) , observed, norm (observed) * 1e-13);
+%! is_finite = abs (lambda) < 1 / eps (max (a(:)));
+%! observed = (b * v * diag (lambda))(:,is_finite);
+%! assert (observed, (a*v)(:,is_finite), norm (observed) * 1e-14);
+%! observed = (diag (lambda) * w' * b)(is_finite,:);
+%! assert (observed, (w'*a)(is_finite,:), norm (observed) * 1e-13);
 
 %!test
 %! A = [0, 0, -1, 0; 1, 0, 0, 0; -1, 0, -2, -1; 0, -1, 1, 0];