Package: maxima-sage / 5.41.0+ds-4

matrixexp.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Description: Fix error in matrix exponentiation
 This patch was written by SageMath but not yet committed into Maxima releases.
 However, it is needed for SageMath to work correctly:
 .
 https://git.sagemath.org/sage.git/tree/build/pkgs/maxima/patches/matrixexp.patch
Author: Peter Bruin <P.J.Bruin@math.leidenuniv.nl>
Bug-Sage: http://trac.sagemath.org/ticket/13973
Bug: https://sourceforge.net/p/maxima/bugs/2596/
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/share/linearalgebra/matrixexp.lisp
+++ b/share/linearalgebra/matrixexp.lisp
@@ -138,8 +138,8 @@
 	   (print `(ratvars = ,$ratvars gcd = '$gcd algebraic = ,$algebraic))
 	   (print `(ratfac = ,$ratfac))
 	   (merror "Unable to find the spectrum")))
-   
-    (setq res ($fullratsimp (ncpower (sub (mult z ($ident n)) mat) -1) z))
+
+    (setq res ($fullratsimp ($invert_by_lu (sub (mult z ($ident n)) mat) '$crering) z))
     (setq m (length sp))
     (dotimes (i m)
       (setq zi (nth i sp))