This repository has been archived by the owner on Jan 30, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'public/t18920' of trac.sagemath.org:sage into ecl1613
- Loading branch information
Showing
36 changed files
with
302 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
tarball=maxima-VERSION.tar.gz | ||
sha1=4431afec577e3cc42370fd768262cf7e1cef9f7f | ||
md5=4bb0b999645ec2b20b7e301d36f83a4c | ||
cksum=80051208 | ||
sha1=db4fb31512299e9971cfbc75cc60ca628861d3f5 | ||
md5=bc21a56e0e413c24a31408ee5900cb59 | ||
cksum=1205153224 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
5.35.1.p2 | ||
5.38.1.p1 |
73 changes: 73 additions & 0 deletions
73
build/pkgs/maxima/patches/0001-Another-fix-for-summation-of-rational-functions-make.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
From 8ec3a05cd24c756f29e0501488be971fe13f7c1f Mon Sep 17 00:00:00 2001 | ||
From: Andrej Vodopivec <andrej.vodopivec@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(-) | ||
|
||
diff --git a/share/solve_rec/rtest_simplify_sum.mac b/share/solve_rec/rtest_simplify_sum.mac | ||
index eda37e1..9f47c7e 100644 | ||
--- a/share/solve_rec/rtest_simplify_sum.mac | ||
+++ b/share/solve_rec/rtest_simplify_sum.mac | ||
@@ -597,3 +597,19 @@ test_sum( | ||
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; | ||
diff --git a/share/solve_rec/simplify_sum.mac b/share/solve_rec/simplify_sum.mac | ||
index a0c2da3..0502f25 100644 | ||
--- a/share/solve_rec/simplify_sum.mac | ||
+++ b/share/solve_rec/simplify_sum.mac | ||
@@ -658,10 +658,16 @@ split_sum(expr) := | ||
*******************/ | ||
|
||
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], | ||
|
||
@@ -806,9 +812,6 @@ simp_harmonic_number(x__):= | ||
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%], | ||
-- | ||
2.10.2 | ||
|
61 changes: 61 additions & 0 deletions
61
build/pkgs/maxima/patches/0001-In-RGRP-rephrase-test-for-ECL-to-avoid-comparing-flo.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
From e916dd0776f636eec6ce73f1bbb8706b268d7e14 Mon Sep 17 00:00:00 2001 | ||
From: Robert Dodier <robert_dodier@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(-) | ||
|
||
diff --git a/src/compar.lisp b/src/compar.lisp | ||
index 2954abf..cf51f4f 100644 | ||
--- a/src/compar.lisp | ||
+++ b/src/compar.lisp | ||
@@ -2334,8 +2334,8 @@ TDNEG TDZERO TDPN) to store it, and also sets SIGN." | ||
(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) | ||
diff --git a/tests/rtest_limit.mac b/tests/rtest_limit.mac | ||
index 88bcf78..b112eeb 100644 | ||
--- a/tests/rtest_limit.mac | ||
+++ b/tests/rtest_limit.mac | ||
@@ -790,3 +790,25 @@ block([modulus:7], sum(i^-2,i,1,inf)); | ||
block([modulus:7], limit(inf)); | ||
inf; | ||
|
||
+/* 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; | ||
-- | ||
2.5.5 | ||
|
76 changes: 76 additions & 0 deletions
76
build/pkgs/maxima/patches/0001-In-eigenvectors-iterate-over-all-eigenvalues.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
From 3e4e107715ac7f99f53785e4991887253183205c Mon Sep 17 00:00:00 2001 | ||
From: Robert Dodier <robert_dodier@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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.