GNU bug report logs - #41223
28.0.50; Calc gives wrong determinant for some matrices with symbolic variables

Previous Next

Package: emacs;

Reported by: Mauro Aranda <maurooaranda <at> gmail.com>

Date: Tue, 12 May 2020 23:26:02 UTC

Severity: normal

Found in version 28.0.50

Done: Mattias EngdegÄrd <mattiase <at> acm.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Mattias EngdegÄrd <mattiase <at> acm.org>
To: Mauro Aranda <maurooaranda <at> gmail.com>
Cc: 41223 <at> debbugs.gnu.org
Subject: bug#41223: 28.0.50; Calc gives wrong determinant for some matrices with symbolic  variables 
Date: Wed, 13 May 2020 14:58:33 +0200
Thank you for reporting this. If Calc cannot compute something, at least it shouldn't lie.

In this case I'm tempted to apply the expedient below. Would that suffice for you?

--- a/lisp/calc/calc-mtx.el
+++ b/lisp/calc/calc-mtx.el
@@ -275,7 +275,7 @@ math-do-matrix-lud
                k (1+ k)))
        (setcar (nthcdr j (nth i lu)) sum)
        (let ((dum (math-lud-pivot-check sum)))
-         (if (Math-lessp big dum)
+         (if (or (math-zerop big) (Math-lessp big dum))
              (setq big dum
                    imax i)))
        (setq i (1+ i)))





This bug report was last modified 5 years and 11 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.