diff liboctave/fMatrix.cc @ 10213:f7ba6cfe7fb7

fix det() after singular matrix is flagged
author Jaroslav Hajek <highegg@gmail.com>
date Thu, 28 Jan 2010 08:06:13 +0100
parents 4c0cdbe0acca
children 07ebe522dac2
line wrap: on
line diff
--- a/liboctave/fMatrix.cc	Thu Jan 28 07:12:59 2010 +0100
+++ b/liboctave/fMatrix.cc	Thu Jan 28 08:06:13 2010 +0100
@@ -1241,8 +1241,14 @@
     {
       volatile int typ = mattype.type ();
 
+      // Even though the matrix is marked as singular (Rectangular), we may
+      // still get a useful number from the LU factorization, because it always
+      // completes.
+
       if (typ == MatrixType::Unknown)
         typ = mattype.type (*this);
+      else if (typ == MatrixType::Rectangular)
+        typ = MatrixType::Full;
 
       if (typ == MatrixType::Lower || typ == MatrixType::Upper)
         {