void-packages/srcpkgs/maxima/patches/matrixexp.patch
Gonzalo Tornaría ab0d3102b5 maxima: add a subpkg maxima-ecl needed for sagemath
- Added a build option 'ecl' (enabled by default)
 - The ecl binary and library will be in a subpkg maxima-ecl so this
   should not affect current users of maxima
 - new patches:
   - a0d7a43...: build a FASL library for ECL (this is merged upstream)
   - handle-multiple-ldflags.patch: otherwise compilation with multiple
     options in LDFLAGS fails (taken from debian)
   - matrixexp.patch: fixes an error in matrix exponentiation (taken
     from debian, this originates in sagemath)

A weak point is that the library maxima.fas is installed in
/usr/lib/ecl-${ecl_version} which is where ecl looks for them, but this
doesn't seem right.

Maybe an alternative would be to have the ecl package ship a symlink at
/usr/lib/ecl pointing to the versioned directory, then have the
maxima-ecl package place its library in the non-versioned directory.
2021-12-21 14:19:58 +01:00

23 lines
986 B
Diff

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))