[maxima-sage] 01/01: Apply more patches from sage trac #18920.
Tobias Hansen
thansen at moszumanska.debian.org
Sun Nov 13 17:04:41 UTC 2016
This is an automated email from the git hooks/post-receive script.
thansen pushed a commit to branch master-5.38
in repository maxima-sage.
commit f2392806b7bca0e2347a24d973d617f3089a1943
Author: Tobias Hansen <thansen at broeselmaschine.fc.up.pt>
Date: Mon Nov 7 21:25:36 2016 +0000
Apply more patches from sage trac #18920.
---
debian/changelog | 2 +-
...-for-summation-of-rational-functions-make.patch | 66 +++++++++++++++++++
...hrase-test-for-ECL-to-avoid-comparing-flo.patch | 54 +++++++++++++++
...eigenvectors-iterate-over-all-eigenvalues.patch | 76 ++++++++++++++++++++++
...id-blowing-the-stack-when-diff-expand-isn.patch | 14 +---
debian/patches/series | 5 +-
6 files changed, 203 insertions(+), 14 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 91e15dc..2d12ceb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,7 +3,7 @@ maxima (5.38.1-5+sage1) unstable-sage; urgency=medium
* Create new package maxima-ecl including the maxima ecl binary
and a fasl library for ecl.
* Apply patch build-fasl.patch from Sage to build the fasl library.
- * Apply two other patches of Sage to fix tests.
+ * Apply five other patches of Sage to fix tests.
-- Tobias Hansen <thansen at debian.org> Sat, 15 Oct 2016 12:12:58 +0000
diff --git a/debian/patches/0001-Another-fix-for-summation-of-rational-functions-make.patch b/debian/patches/0001-Another-fix-for-summation-of-rational-functions-make.patch
new file mode 100644
index 0000000..25088fe
--- /dev/null
+++ b/debian/patches/0001-Another-fix-for-summation-of-rational-functions-make.patch
@@ -0,0 +1,66 @@
+From 8ec3a05cd24c756f29e0501488be971fe13f7c1f Mon Sep 17 00:00:00 2001
+From: Andrej Vodopivec <andrej.vodopivec at gmail.com>
+Date: Sun, 6 Nov 2016 20:58:04 +0100
+Subject: [PATCH] Another fix for summation of rational functions: make sure
+ there are no poles in the summation area.
+
+Fixes bug #3236.
+
+Added the two test cases from bugreport #3236.
+---
+ share/solve_rec/rtest_simplify_sum.mac | 16 ++++++++++++++++
+ share/solve_rec/simplify_sum.mac | 11 +++++++----
+ 2 files changed, 23 insertions(+), 4 deletions(-)
+
+--- a/share/solve_rec/rtest_simplify_sum.mac
++++ b/share/solve_rec/rtest_simplify_sum.mac
+@@ -597,3 +597,19 @@
+ 1
+ );
+ 0;
++
++test_sum(
++ sum(1/((n+1)*(2*n-1)), n, 1,inf),
++ [],
++ false,
++ [],
++ (2*log(2)+1)/3);
++0;
++
++test_sum(
++ sum(1/((2*n-1)^2*(2*n+1)^2*(2*n+3)^2),n,0,inf),
++ [],
++ false,
++ [],
++ (3*%pi^2)/256);
++0;
+--- a/share/solve_rec/simplify_sum.mac
++++ b/share/solve_rec/simplify_sum.mac
+@@ -657,10 +657,16 @@
+ *******************/
+
+ ratfun_to_psi(ratfun, var, lo, hi) := block(
+- [pf, sum: 0, denom_f : factor_with_solve(denom(ratfun), var)],
++ [pf, sum: 0, denom_f : factor_with_solve(denom(ratfun), var), max_root],
+
+ pf : partfrac(num(ratfun)/denom_f, var),
+
++ max_root: lmax(sublist(map(rhs, solve(denom_f, var)), numberp)),
++ if (numberp(max_root) and numberp(lo)) then (
++ while (lo < max_root) do (
++ sum: sum+subst(var=lo, ratfun),
++ lo: lo+1)),
++
+ if inpart(pf, 0)="+" then pf: args(pf)
+ else pf: [pf],
+
+@@ -805,9 +811,6 @@
+ if x__=0 then 0
+ else if integerp(x__) and x__<1 then error("Zero to negative power computed.")
+ else if integerp(x__) then num_harmonic_number(1, x__)
+- else if numberp(x__) and x__<-1 then block(
+- [a:-floor(x__), k%],
+- simp_harmonic_number(x__+a)-apply('sum, [1/k%, k%, x__, x__+a-1]))
+ else if numberp(x__) or imagpart(x__)#0 then psi[0](x__+1) + %gamma
+ else block(
+ [a, b, var, k%],
diff --git a/debian/patches/0001-In-RGRP-rephrase-test-for-ECL-to-avoid-comparing-flo.patch b/debian/patches/0001-In-RGRP-rephrase-test-for-ECL-to-avoid-comparing-flo.patch
new file mode 100644
index 0000000..1a6d158
--- /dev/null
+++ b/debian/patches/0001-In-RGRP-rephrase-test-for-ECL-to-avoid-comparing-flo.patch
@@ -0,0 +1,54 @@
+From e916dd0776f636eec6ce73f1bbb8706b268d7e14 Mon Sep 17 00:00:00 2001
+From: Robert Dodier <robert_dodier at users.sourceforge.net>
+Date: Sun, 30 Oct 2016 17:41:44 -0700
+Subject: [PATCH] In RGRP, rephrase test for ECL to avoid comparing float
+ infinity with rational, which tickles a bug in ECL (reported as
+ https://gitlab.com/embeddable-common-lisp/ecl/issues/299). Fixes SF bug
+ #3235: "ECL lisp arithmetic error in definite integration with large limits"
+
+---
+ src/compar.lisp | 4 ++--
+ tests/rtest_limit.mac | 22 ++++++++++++++++++++++
+ 2 files changed, 24 insertions(+), 2 deletions(-)
+
+--- a/src/compar.lisp
++++ b/src/compar.lisp
+@@ -2316,8 +2316,8 @@
+ (if (not (numberp y))
+ (setq y (/ (cadr y) (caddr y))))
+ (cond
+- ((> x y) '$pos)
+- ((> y x) '$neg)
++ (#-ecl (> x y) #+ecl (> (- x y) 0) '$pos)
++ (#-ecl (> y x) #+ecl (> (- y x) 0) '$neg)
+ (t '$zero)))
+
+ (defun mcons (x l)
+--- a/tests/rtest_limit.mac
++++ b/tests/rtest_limit.mac
+@@ -751,3 +751,25 @@
+ +1.0*x^3*log(1-%e^x)-0.25*x^4,x,inf,minus)
+ -6.0*li[4](1.0)$
+
++/* SF bug #3235: "ECL lisp arithmetic error in definite integration with large limits"
++ * the bug is actually in ECL (https://gitlab.com/embeddable-common-lisp/ecl/issues/299);
++ * here we'll test a work around.
++ */
++
++block ([actual, expected],
++ actual : limit(x*exp(x)*log(exp(x)+1),x,-1000,plus),
++ expected : -1000*%e^-1000*log(%e^-1000*(%e^1000+1)),
++ if ev (equal (actual, expected), logexpand='super) then true else [actual, expected]);
++true;
++
++/* accommodate different equivalent forms via 'equal' */
++block ([actual, expected],
++ actual : integrate((x^2)*exp(x) / (1 + exp(x))^2,x,-1000,1000),
++ expected : (-(2000*%e^1000*log(%e^-1000*(%e^1000+1)))/(%e^1000+1))
++ -(2000*log(%e^-1000*(%e^1000+1)))/(%e^1000+1)
++ -((2000*%e^1000+2000)*log(%e^1000+1)
++ +(2*%e^1000+2)*li[2](-%e^1000)-1000000*%e^1000)
++ /(%e^1000+1)+(2*%e^1000*li[2](-%e^-1000))/(%e^1000+1)
++ +(2*li[2](-%e^-1000))/(%e^1000+1)-1000000/(%e^1000+1),
++ if ev (equal (actual, expected), logexpand='super) then true else [actual, expected]);
++true;
diff --git a/debian/patches/0001-In-eigenvectors-iterate-over-all-eigenvalues.patch b/debian/patches/0001-In-eigenvectors-iterate-over-all-eigenvalues.patch
new file mode 100644
index 0000000..46be5da
--- /dev/null
+++ b/debian/patches/0001-In-eigenvectors-iterate-over-all-eigenvalues.patch
@@ -0,0 +1,76 @@
+From 3e4e107715ac7f99f53785e4991887253183205c Mon Sep 17 00:00:00 2001
+From: Robert Dodier <robert_dodier at users.sourceforge.net>
+Date: Wed, 18 May 2016 17:35:55 -0700
+Subject: [PATCH] In eigenvectors, iterate over all eigenvalues.
+
+Fixes SF bug #3008: "Eigenvectors are missing", #3085: "missed eigenvectors",
+#3149: "eigenvectors does not show eigenvectors with eigenvalue zero".
+---
+ share/matrix/eigen.mac | 3 +--
+ tests/rtest15.mac | 39 +++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 40 insertions(+), 2 deletions(-)
+
+diff --git a/share/matrix/eigen.mac b/share/matrix/eigen.mac
+index ae1c51a..eddf05d 100644
+--- a/share/matrix/eigen.mac
++++ b/share/matrix/eigen.mac
+@@ -119,8 +119,7 @@ eigenvectors(mat):=
+ nondiagonalizable:false,
+ eigvecs:[],realonly:false,algebraic:true,
+ for index1 thru count do
+- (count:mi(count-part(multiplicities,index1)+1),
+- mmatrx:matrx-part(eigvals,1,index1)*vectr,
++ (mmatrx:matrx-part(eigvals,1,index1)*vectr,
+ equations:[],
+ for index2 thru dimnsn do
+ equations:cons(mmatrx[index2,1],equations),%rnum:0,
+diff --git a/tests/rtest15.mac b/tests/rtest15.mac
+index 137a4b1..6e512ae 100644
+--- a/tests/rtest15.mac
++++ b/tests/rtest15.mac
+@@ -1363,3 +1363,42 @@ trigrat(e^x * sin(x));
+ trigrat(f^x * sin(x));
+ %i*abs(f)^x*sin(x)*sin(atan2(0, f)*x) + abs(f)^x*sin(x)*cos(atan2(0, f)*x);
+
++(check_eigenvectors (M) := block ([vals, vecs, mults, eqns],
++ [[vals, mults], vecs] : eigenvectors (M),
++ eqns : [lsum (m, m, mults) = length (M),
++ apply ("*", map (lambda ([v, m], v^m), vals, mults)) = determinant (M),
++ length (vecs) = length (vals),
++ every (lambda ([mults1, vecs1], length (vecs1) <= mults1), mults, vecs),
++ every (lambda ([val, vecs1], every (lambda ([vec], transpose (M . vec) = val * matrix (vec)), vecs1)), vals, vecs)],
++ if apply ("and", eqns)
++ then true
++ else [M, eqns]),
++ 0);
++0;
++
++/* SF bug #3008: "Eigenvectors are missing" */
++
++eigenvectors (matrix([1, 1, 0], [0, 1, 0], [0, 0, 2]));
++[[[1, 2], [2, 1]], [[[1, 0, 0]], [[0, 0, 1]]]];
++
++check_eigenvectors (matrix([1, 1, 0], [0, 1, 0], [0, 0, 2]));
++true;
++
++/* SF bug #3085: "missed eigenvectors" */
++
++eigenvectors (matrix([3,1,0,0,0], [1,3,0,0,0], [0,0,2,1,1], [0,0,1,2,1], [0,0,1,1,2]));
++[[[2, 1, 4], [1, 2, 2]],
++ [[[1, - 1, 0, 0, 0]],
++ [[0, 0, 1, 0, - 1], [0, 0, 0, 1, - 1]],
++ [[1, 1, 0, 0, 0], [0, 0, 1, 1, 1]]]];
++
++check_eigenvectors (matrix([3,1,0,0,0], [1,3,0,0,0], [0,0,2,1,1], [0,0,1,2,1], [0,0,1,1,2]));
++true;
++
++/* SF bug #3149: "eigenvectors does not show eigenvectors with eigenvalue zero" */
++
++eigenvectors (matrix([2,3,1],[4,4,2],[-4,-8,-2]));
++[[[2, 0], [2, 1]], [[[1, 1, - 3]], [[1, 0, - 2]]]];
++
++check_eigenvectors (matrix([2,3,1],[4,4,2],[-4,-8,-2]));
++true;
+--
+2.10.1
+
diff --git a/debian/patches/0001-taylor2-Avoid-blowing-the-stack-when-diff-expand-isn.patch b/debian/patches/0001-taylor2-Avoid-blowing-the-stack-when-diff-expand-isn.patch
index 56e6f2c..49abbb1 100644
--- a/debian/patches/0001-taylor2-Avoid-blowing-the-stack-when-diff-expand-isn.patch
+++ b/debian/patches/0001-taylor2-Avoid-blowing-the-stack-when-diff-expand-isn.patch
@@ -1,3 +1,5 @@
+diff --git a/src/hayat.lisp b/src/hayat.lisp
+index 07699d6..ab8984d 100644
--- a/src/hayat.lisp
+++ b/src/hayat.lisp
@@ -2189,6 +2189,23 @@
@@ -81,15 +83,3 @@
(check-inf-sing (mapcar (function caddr) l))
(cond ((not l) exp)
(t
---- a/tests/rtest_taylor.mac
-+++ b/tests/rtest_taylor.mac
-@@ -539,3 +539,9 @@
- + 2856700692480*x^2 + 3370143559680*x + 2386516803584)],
- pade (t, 5, 5), is (equal (%%, foo)));
- true;
-+
-+/* Avoid blowing the stack if diff-expand doesn't return anything
-+ helpful. Example comes from Bug ID: 2520
-+ */
-+errcatch(taylor (sin(x)/abs(sin(x)), x, 0, 0))$
-+[];
diff --git a/debian/patches/series b/debian/patches/series
index 8f1f904..3d4cc17 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -9,5 +9,8 @@ do_not_remake_docs_2
pathname
pathname1
build-fasl.patch
-0001-taylor2-Avoid-blowing-the-stack-when-diff-expand-isn.patch
matrixexp.patch
+0001-Another-fix-for-summation-of-rational-functions-make.patch
+0001-In-eigenvectors-iterate-over-all-eigenvalues.patch
+0001-In-RGRP-rephrase-test-for-ECL-to-avoid-comparing-flo.patch
+0001-taylor2-Avoid-blowing-the-stack-when-diff-expand-isn.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/maxima-sage.git
More information about the debian-science-commits
mailing list