changeset 25316:60fd2d84c9a0 stable

eigs.m: Fix failing BIST test (bug #53700). * eigs.m: Use isreal() to determine whether NaN or NaN+1i*NaN should be the expected value.
author Marco Caliari <marco.caliari@univr.it>
date Thu, 26 Apr 2018 08:47:11 +0200
parents 159b359ccc13
children 4a46c83bcb71
files scripts/sparse/eigs.m
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/sparse/eigs.m	Thu Apr 26 05:29:36 2018 -0400
+++ b/scripts/sparse/eigs.m	Thu Apr 26 08:47:11 2018 +0200
@@ -1430,7 +1430,11 @@
 %! opts.maxit = 10;
 %! warning ("off", "Octave:eigs:UnconvergedEigenvalues", "local");
 %! d = eigs (A, 10, "sm", opts);
-%! assert (d(10), NaN+1i*NaN);
+%! if (isreal (d))
+%!   assert (d(10), NaN);
+%! else
+%!   assert (d(10), NaN +1i*NaN);
+%! endif
 %!testif HAVE_ARPACK
 %! A = toeplitz ([0, 1, zeros(1, 8)], [0, -1, zeros(1, 8)]);
 %! A = kron (A, eye (10)) + kron (eye (10), A);