changeset 29906:e7c10a552ecc

Emit more informative error message when ARPACK fails to converge (bug #60924) * eigs-base.cc (arpack_errno2str): For errno=-14 (failure to converge), emit a warning that suggests possible solutions. Correct typo where variable "errno" was used where "errnum" was desired.
author Rik <rik@octave.org>
date Thu, 22 Jul 2021 08:27:12 -0700
parents ad023dbe9606
children 39780b2456a8
files liboctave/numeric/eigs-base.cc
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/numeric/eigs-base.cc	Thu Jul 22 08:03:41 2021 -0700
+++ b/liboctave/numeric/eigs-base.cc	Thu Jul 22 08:27:12 2021 -0700
@@ -157,6 +157,8 @@
       else if (fcn_name.compare ("dseupd") == 0)
         msg = "DSAUPD did not find any eigenvalues to sufficient accuracy.";
 
+      msg += "  Consider changing tolerance (TOL), maximum iterations (MAXIT), number of Lanzcos basis vectors (P), or starting vector (V0) in OPTS structure.";
+
       break;
 
     case -15:
@@ -207,9 +209,8 @@
 
     }
 
-  if ((errno != -9) & (errno != -14) & (errno != -9999))
-    // This is a bug in Octave interface to ARPACK
-    msg.append (bug_msg);
+  if ((errnum != -9) && (errnum != -14) && (errnum != -9999))
+    msg.append (bug_msg);  // This is a bug in Octave interface to ARPACK
 
   return msg;
 }