[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #63384] Error for "inv(NaN)" with LAPACK 3.11.
From: |
Markus Mützel |
Subject: |
[Octave-bug-tracker] [bug #63384] Error for "inv(NaN)" with LAPACK 3.11.0 |
Date: |
Mon, 21 Nov 2022 10:16:43 -0500 (EST) |
Follow-up Comment #25, bug #63384 (project octave):
Does the following change help?
diff -r 288a917d728e liboctave/array/dMatrix.cc
--- a/liboctave/array/dMatrix.cc Sun Nov 20 15:29:28 2022 +0100
+++ b/liboctave/array/dMatrix.cc Mon Nov 21 15:48:48 2022 +0100
@@ -28,6 +28,7 @@
#endif
#include <algorithm>
+#include <cmath>
#include <istream>
#include <limits>
#include <ostream>
@@ -596,19 +597,24 @@
info = -1;
else if (calc_cond)
{
- F77_INT dgecon_info = 0;
-
- // Now calculate the condition number for non-singular matrix.
- char job = '1';
- Array<F77_INT> iz (dim_vector (nc, 1));
- F77_INT *piz = iz.fortran_vec ();
- F77_XFCN (dgecon, DGECON, (F77_CONST_CHAR_ARG2 (&job, 1),
- nc, tmp_data, nr, anorm,
- rcon, pz, piz, dgecon_info
- F77_CHAR_ARG_LEN (1)));
-
- if (dgecon_info != 0)
- info = -1;
+ if (std::isnan (anorm))
+ rcon = std::nan ("0");
+ else
+ {
+ F77_INT dgecon_info = 0;
+
+ // Now calculate the condition number for non-singular matrix.
+ char job = '1';
+ Array<F77_INT> iz (dim_vector (nc, 1));
+ F77_INT *piz = iz.fortran_vec ();
+ F77_XFCN (dgecon, DGECON, (F77_CONST_CHAR_ARG2 (&job, 1),
+ nc, tmp_data, nr, anorm,
+ rcon, pz, piz, dgecon_info
+ F77_CHAR_ARG_LEN (1)));
+
+ if (dgecon_info != 0)
+ info = -1;
+ }
}
if (info == -1 && ! force)
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?63384>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #63384] [MXE Octave] Error for "inv" with default branch, (continued)
- [Octave-bug-tracker] [bug #63384] [MXE Octave] Error for "inv" with default branch, Dmitri A. Sergatskov, 2022/11/20
- [Octave-bug-tracker] [bug #63384] [MXE Octave] Error for "inv" with default branch, Markus Mützel, 2022/11/21
- [Octave-bug-tracker] [bug #63384] [MXE Octave] Error for "inv" with default branch, Dmitri A. Sergatskov, 2022/11/21
- [Octave-bug-tracker] [bug #63384] Error for "inv(NaN)" with LAPACK 3.11.0, Markus Mützel, 2022/11/21
- [Octave-bug-tracker] [bug #63384] Error for "inv(NaN)" with LAPACK 3.11.0, John W. Eaton, 2022/11/21
- [Octave-bug-tracker] [bug #63384] Error for "inv(NaN)" with LAPACK 3.11.0, Dmitri A. Sergatskov, 2022/11/21
- [Octave-bug-tracker] [bug #63384] Error for "inv(NaN)" with LAPACK 3.11.0, Dmitri A. Sergatskov, 2022/11/21
- [Octave-bug-tracker] [bug #63384] Error for "inv(NaN)" with LAPACK 3.11.0, Markus Mützel, 2022/11/21
- [Octave-bug-tracker] [bug #63384] Error for "inv(NaN)" with LAPACK 3.11.0, Markus Mützel, 2022/11/21
- [Octave-bug-tracker] [bug #63384] Error for "inv(NaN)" with LAPACK 3.11.0, John W. Eaton, 2022/11/21
- [Octave-bug-tracker] [bug #63384] Error for "inv(NaN)" with LAPACK 3.11.0,
Markus Mützel <=
- [Octave-bug-tracker] [bug #63384] Error for "inv(NaN)" with LAPACK 3.11.0, Dmitri A. Sergatskov, 2022/11/21
- [Octave-bug-tracker] [bug #63384] Error for "inv(NaN)" with LAPACK 3.11.0, Dmitri A. Sergatskov, 2022/11/21
- [Octave-bug-tracker] [bug #63384] Error for "inv(NaN)" with LAPACK 3.11.0, Markus Mützel, 2022/11/21
- [Octave-bug-tracker] [bug #63384] Error for "inv(NaN)" with LAPACK 3.11.0, John W. Eaton, 2022/11/21
- [Octave-bug-tracker] [bug #63384] Error for "inv(NaN)" with LAPACK 3.11.0, Rik, 2022/11/21
- [Octave-bug-tracker] [bug #63384] Error for "inv(NaN)" with LAPACK 3.11.0, Markus Mützel, 2022/11/22
- [Octave-bug-tracker] [bug #63384] Error for "inv(NaN)" with LAPACK 3.11.0, Julien Langou, 2022/11/23
- [Octave-bug-tracker] [bug #63384] Error for "inv(NaN)" with LAPACK 3.11.0, Markus Mützel, 2022/11/23
- [Octave-bug-tracker] [bug #63384] Error for "inv(NaN)" with LAPACK 3.11.0, Julien Langou, 2022/11/23
- [Octave-bug-tracker] [bug #63384] Error for "inv(NaN)" with LAPACK 3.11.0, Rik, 2022/11/24