Ticket #9538: maxima_package.patch

File maxima_package.patch, 4.8 KB (added by burcin, 12 years ago)

patch for maxima spkg

  • SPKG.txt

    # HG changeset patch
    # User Burcin Erocal <burcin@erocal.org>
    # Date 1285516452 -7200
    # Node ID da861ea0353e007ae653c307469cdf85e9675738
    # Parent  ea35ea796988ae7735f92ff3b5e29baa54db8dff
    Patch maxima to kill variables used for testing implementation of Zeilberger's
    algorithm. #9538
    
    diff --git a/SPKG.txt b/SPKG.txt
    a b  
    3232
    3333== Changelog ==
    3434
     35=== maxima-5.20.1.p1 (Burcin Erocal, 26 September 2010) ===
     36 * patch share/contrib/Zeilberger/testZeilberger.mac to kill the variables
     37   used for testing. Fixes #9538.
     38
    3539=== maxima-5.20.1.p0 (William Stein, 3 April 2010) ===
    3640 * Artificially bump version number to force rebuild, due to Maxima being broken without
    3741   doing so on upgrade.
  • new file patches/testZeilberger.mac

    diff --git a/patches/testZeilberger.mac b/patches/testZeilberger.mac
    new file mode 100644
    - +  
     1
     2/* ------------------------------ */
     3/* Gosper's algorithm's Test File */
     4
     5g1:(-1)^k*k/(4*k^2-1);
     6
     7g2:1/(4*k^2-1);
     8
     9g3:x^k;
     10
     11g4:(-1)^k*a!/(k!*(a-k)!);
     12
     13g5:k*k!;
     14
     15g6:(k+1)*k!/(k+1)!;
     16
     17/* Non-Gosper summable                                        */
     18/* It has been checked against the Mathematica package "Zb"   */
     19/* by Paule/Schorn/Riese available at www.risc.uni-linz.ac.at */
     20g7:1/((a-k)!*k!);
     21
     22/* --------------------------------- */
     23/* Zeiberger's Algorithm's Test File */
     24
     25f1 : binomial(n,k);
     26
     27f2 : binomial(n,k)^2;
     28
     29f3 : binomial(n,k)^3;
     30
     31f4 : binomial(n,k)^4;
     32
     33f5 : binomial(n,k)^5;
     34
     35f6 : binomial(n,k)^6;
     36
     37f7 : binomial(n,k)^7;
     38
     39f8 : binomial(n,k)^8;
     40
     41f9: binomial(n,k)^9;
     42
     43f10: binomial(n,k)^10;
     44
     45/* Binomial theorem */
     46h1: binomial(n,k)*x^k;
     47
     48/* Vandermonde identity recurrence */
     49h2: binomial(a, k)* binomial(b, n-k);
     50
     51/* Dixon's identity */
     52h3: binomial(n+b, n+k)* binomial(n+c, c+k)*binomial(b+c, b+k)*(-1)^k;
     53
     54/* Karlsson-Gosper identity 1 */
     55h4: binomial(n,k)*(n-1/4)!/(n-k-1/4)!/(2*n+k + 1/4)!*9^(-k);
     56
     57/* Karlsson-Gosper identity 2 */
     58h5: binomial(n,k) * (n-1/4)! / (n-k-1/4)! / (2*n+k+5/4)! * 9^(-k);
     59
     60/* Wilson polynomials recurrence */
     61h6: binomial(n,k) * (n+a+b+c+d-2+k)! * (a+x+k-1)! * (a-x+k-1)! /
     62               (n+a+b+c+d-2)! / (a+b+k-1)! / (a+c+k-1)! / (a+d+k-1)! * (-1)^k;
     63
     64
     65/* Wilson polynomials without constants in k (for debugging) */
     66h6b : removeBinomial(h6)/(n!)*((n+d+c+b+a-2)!);
     67
     68/* Laguerre-Orthogonality */
     69h7: (k+k2)! * (n1)! * (n2)! / (k)! / (n1-k)! / (k2)! / (n2-k2)! /
     70                (k)! / (k2)! * (-1)^k;
     71
     72/*  Fibonacci-Recurrence */
     73h8: (-k+n)! / k! / (-2*k+n)!;
     74
     75/* Trinomial coefficients */
     76h9: n! / k! / (k+m)! / (-2*k-m+n)!;
     77
     78/*  First special case of Strehl identity (MEMO, Feb 25, 1992) */
     79h10: binomial(n, k)^2 * binomial( 2*k, k);
     80
     81
     82/* Second special case of Strehl identity (MEMO, Feb 25, 1992) */
     83h11: binomial(n, k)^2 * binomial( 2*k, k+a);
     84
     85/* Third special case of Strehl identity (MEMO, Feb 25, 1992) */
     86h12: binomial(n, k)^2 * binomial( 2*k, k) * binomial(2*k,n-k);
     87
     88/* Fibonacci recurrence */
     89h13: (n+k)! * n! / k!^3 / (n-k)!^2;
     90
     91/* Debugging artificial examples */
     92d1 : (2*n+k-1)!/(4*n+2*k)!;
     93
     94d2 : (3*n+k-1)!/(6*n+2*k)!;
     95
     96
     97GOSPER_TEST :
     98  [[g1,k,n,0],[g2,k,n,0],[g3,k,n,0],
     99   [g4,k,n,0],[g5,k,n,0],[g6,k,n,0]];
     100
     101EASY_TEST :
     102[[f1,k,n,1],[f2,k,n,1],[f3,k,n,2],[f4,k,n,2],
     103 [h1,k,n,1],[h2,k,n,1],[h8,k,n,2],[h9,k,n,2],
     104 [h10,k,n,2],[h13,k,n,2],[d1,k,n,1],[d2,k,n,1]];
     105
     106HARD_TEST :
     107[[h3,k,n,1],[h4,k,n,1],[h5,k,n,1],[h7,k,n1,1],[h11,k,n,3]];
     108
     109EXTREME_TEST : [[f5,k,n,3], [h6,k,n,2],[h12,k,n,5]];
     110
     111FULL_TEST : append(GOSPER_TEST,EASY_TEST,
     112                   HARD_TEST,EXTREME_TEST);
     113
     114kill (g1, g2, g3, g4, g5, g6, g7,
     115    f1, f2, f3, f4, f5, f6, f7, f8, f9, f10,
     116    h1, h2, h3, h4, h5, h6, h6b, h7, h8, h9, h10, h11, h12, h13,
     117    d1, d2);
     118
  • new file patches/testZeilberger.mac.patch

    diff --git a/patches/testZeilberger.mac.patch b/patches/testZeilberger.mac.patch
    new file mode 100644
    - +  
     1--- share/contrib/Zeilberger/testZeilberger.mac.org     2010-09-26 17:28:45.000000000 +0200
     2+++ share/contrib/Zeilberger/testZeilberger.mac 2010-09-26 17:29:24.000000000 +0200
     3@@ -110,3 +110,9 @@
     4 
     5 FULL_TEST : append(GOSPER_TEST,EASY_TEST,
     6                    HARD_TEST,EXTREME_TEST);
     7+
     8+kill (g1, g2, g3, g4, g5, g6, g7,
     9+    f1, f2, f3, f4, f5, f6, f7, f8, f9, f10,
     10+    h1, h2, h3, h4, h5, h6, h6b, h7, h8, h9, h10, h11, h12, h13,
     11+    d1, d2);
     12+
  • spkg-install

    diff --git a/spkg-install b/spkg-install
    a b  
    88
    99CUR=`pwd`
    1010
    11 # patch() {}
    12 # no current patches against Maxima
    13 # patch
     11patch() {
     12        # add a few lines at the end of
     13        # share/contrib/Zeilberger/testZeilberger.mac
     14        # to kill variables used for tests.
     15        # These become available in the maxima instance and interfere with
     16        # computations from Sage.
     17        cp patches/testZeilberger.mac src/share/contrib/Zeilberger/
     18}
     19patch
    1420
    1521cd src/
    1622