* Fix a bug that selected the wrong algorithm for determinants of purely
authorRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Fri, 23 Sep 2005 00:02:29 +0000 (00:02 +0000)
committerRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Fri, 23 Sep 2005 00:02:29 +0000 (00:02 +0000)
  numeric matrices with at least one floating point element.

ginac/matrix.cpp

index 3cc20039e9f66e103ee4c1d19bd1fa36806e0aaf..623537febbb965f5ac1324e77f85e07d59a00768 100644 (file)
@@ -730,12 +730,12 @@ ex matrix::determinant(unsigned algo) const
        unsigned sparse_count = 0;  // counts non-zero elements
        exvector::const_iterator r = m.begin(), rend = m.end();
        while (r != rend) {
+               if (!r->info(info_flags::numeric))
+                       numeric_flag = false;
                exmap srl;  // symbol replacement list
                ex rtest = r->to_rational(srl);
                if (!rtest.is_zero())
                        ++sparse_count;
-               if (!rtest.info(info_flags::numeric))
-                       numeric_flag = false;
                if (!rtest.info(info_flags::crational_polynomial) &&
                         rtest.info(info_flags::rational_function))
                        normal_flag = true;