[genus2reduction] Adapt to newer versions of pari. Minor spec file cleanups. New description courtesy of Debian.

Jerry James jjames at fedoraproject.org
Wed Jul 25 16:09:55 UTC 2012


commit 99ce1a7fe17c968c2c2e5cd206cc2d2c3da51f71
Author: Jerry James <loganjerry at gmail.com>
Date:   Wed Jul 25 10:09:22 2012 -0600

    Adapt to newer versions of pari.
    Minor spec file cleanups.
    New description courtesy of Debian.

 genus2reduction-compile.patch     |  350 +++++++++++++++++++++++++++++++++++--
 genus2reduction-header-path.patch |   11 --
 genus2reduction.spec              |   47 +++---
 3 files changed, 359 insertions(+), 49 deletions(-)
---
diff --git a/genus2reduction-compile.patch b/genus2reduction-compile.patch
index 1d02eee..bd79225 100644
--- a/genus2reduction-compile.patch
+++ b/genus2reduction-compile.patch
@@ -1,6 +1,6 @@
---- genus2reduction.c_org	1998-10-08 10:47:42.000000000 +0300
-+++ genus2reduction.c	2006-03-06 02:17:12.000000000 +0200
-@@ -1,13 +1,38 @@
+--- genus2reduction.c.orig	1998-10-08 01:47:42.000000000 -0600
++++ genus2reduction.c	2012-07-25 09:55:17.224954037 -0600
+@@ -1,13 +1,34 @@
  /* genus2reduction 
     by Qing Liu <liu at math.u-bordeaux.fr>
     and Henri Cohen <cohen at math.u-bordeaux.fr>
@@ -14,41 +14,363 @@
  
 -/* Last modified october 5th 1998 */ 
 +/* Qing Liu: Last modified october 5th 1998 */ 
-+
+ 
+-#include "genpari.h"
 +/* 
 +   William Stein: Modified 2006-03-05.
 +
 +*/
- 
--#include "genpari.h"
++
 +#include "pari.h"
 +
-+#ifdef LONG_IS_64BIT
-+#  define VERYBIGINT (9223372036854775807L) /* 2^63-1 */
++#if __WORDSIZE == 64
 +#  define EXP220 (1099511627776L)          /* 2^40   */
-+#  define BIGINT (2147483647)              /* 2^31-1 */
 +#else
-+#  define VERYBIGINT (2147483647L) /* 2^31-1 */
 +#  define EXP220 (1048576L)       /* 2^20   */
-+#  define BIGINT (32767)          /* 2^15-1 */
 +#endif
 +
 +GEN
 +mppgcd(GEN a, GEN b)
 +{
-+  if (typ(a) != t_INT || typ(b) != t_INT) err(arither1);
++  if (typ(a) != t_INT || typ(b) != t_INT) pari_err(arither1);
 +  return gcdii(a,b);
 +}
  
  GEN
  caltheta(GEN pol, GEN p, long lambda);
-@@ -1657,7 +1682,8 @@
+@@ -51,17 +72,18 @@ myvalzi(GEN b);
+ long
+ myvalzi2(GEN b);
+ 
++int
+ main()
+ {
+   char buf[1000];
+-  GEN a0,a1,a2,a3,a4,a5,a6,jpol2,jpol4,jpol6,j2,j4,j6,j8,j10,i4,i12,j12,q,p,r,n,m;
+-  GEN p1,p2,pro,s,pro1,pro2,dk,d1k,d2k,dm,rk,polh,polh1,theta,theta1,polf,list,c1,c2,c3,c4,c5,c6,prod,facti,facto,factp,e0,b,polhp,unmodp;
+-  GEN apol2,apol3,apol4,apol5,bpol2,A2,A3,A4,A5,B2,e1,e2,e3,vl,vm,vn,b0,b1,jh10,polr,Ieps,sjinv,pjinv,cond,matmin;
+-  long eps,eps2,i,val[8],deg[8],va0,va2,va3,va4,va5,vb2,vb5,vb6,v12,flc;
+-  long tt,d,d1,d2,d3,f1,f2,g,h,v1,v2,j2m,r1,r2,r3,r4,dismin,alpha,lambda;
+-  long indice,vc6,mm,nb,dism,maxc,condp,R,alpha1,comp,beta,vy,dd,pr,ip,j,temp;
++  GEN a0,a1,a2,a3,a4,a5,a6,jpol2,jpol4,jpol6,j2,j4,j6,j8,j10,i4,i12,j12,q,p,r=0,n=0,m;
++  GEN p1,s,pro1,pro2,dk=0,d1k=0,d2k=0,dm,rk,polh,polh1=0,theta,theta1,polf,list,c1,c2,c3,c4,c5,c6,prod,facti,facto,factp,e0,b,polhp,unmodp;
++  GEN apol2,apol3,apol4,apol5,bpol2,A2,A3,A4,A5,B2,e1,e2,e3,vl,vm,vn,polr,Ieps,sjinv,pjinv,cond,matmin;
++  long eps=0,eps2=0,i,val[8],deg[8],va0,va2,va3,va4,va5,vb2,vb5,vb6,v12,flc;
++  long tt=0,d,d1,d2,d3,f1,f2,g,h,v1,v2,j2m,r1=0,r2,r3,r4,dismin,alpha,lambda;
++  long indice,vc6,mm,nb,dism,maxc,condp,R,alpha1,comp,beta,dd,pr,ip,j,temp;
+   
+-  init(10000000,500000);
++  pari_init(10000000,500000);
+   jpol2=lisseq("a0;a1;a2;a3;a4;a5;a6;2^-2*(-120*a0*a6+20*a1*a5-8*a2*a4+3*a3^2)");
+   jpol4=lisseq("a0;a1;a2;a3;a4;a5;a6;2^-7*(240*(a0*a3*a4*a5+a1*a2*a3*a6)-400*(a0*a2*a5^2+a1^2*a4*a6)-64*(a0*a4^3+a2^3*a6)+16*(a1*a3*a4^2+a2^2*a3*a5)-672*a0*a3^2*a6+240*a1^2*a5^2-112*a1*a2*a4*a5-8*a1*a3^2*a5+16*a2^2*a4^2-16*a2*a3^2*a4+3*a3^4+2640*a0^2*a6^2-880*a0*a1*a5*a6+1312*a0*a2*a4*a6)");
+   jpol6=lisseq("a0;a1;a2;a3;a4;a5;a6;2^-10*(1600*(a0^2*a4^2*a5^2+a1^2*a2^2*a6^2)+1600*(a0*a1*a2*a5^3+a1^3*a4*a5*a6)+640*(a0*a1*a3*a4*a5^2+a1^2*a2*a3*a5*a6)-4000*(a0^2*a3*a5^3+a1^3*a3*a6^2)-384*(a0*a1*a4^3*a5+a1*a2^3*a5*a6)-640*(a0*a2^2*a4*a5^2+a1^2*a2*a4^2*a6)+80*(a0*a2*a3^2*a5^2+a1^2*a3^2*a4*a6)+192*(a0*a2*a3*a4^2*a5+a1*a2^2*a3*a4*a6)-48*(a0*a3^3*a4*a5+a1*a2*a3^3*a6)-224*(a1^2*a3*a4^2*a5+a1*a2^2*a3*a5^2)+64*(a1^2*a4^4+a2^4*a5^2)-64*(a1*a2*a3*a4^3+a2^3*a3*a4*a5)+16*(a1*a3^3*a4^2+a2^2*a3^3*a5)-4096*(a0^2*a4^3*a6+a0*a2^3*a6^2)+6400*(a0^2*a2*a5^2*a6+a0*a1^2*a4*a6^2)+10560*(a0^2*a3*a4*a5*a6+a0*a1*a2*a3*a6^2)+2624*(a0*a1*a3*a4^2*a6+a0*a2^2*a3*a5*a6)-4432*a0*a1*a3^2*a5*a6-8*a2*a3^4*a4+a3^6-320*a1^3*a5^3+64*a1^2*a2*a4*a5^2+176*a1^2*a3^2*a5^2+128*a1*a2^2*a4^2*a5+112*a1*a2*a3^2*a4*a5-28*a1*a3^4*a5+16*a2^2*a3^2*a4^2+5120*a0^3*a6^3-2544*a0^2*a3^2*a6^2+312*a0*a3^4*a6-14336*a0^2*a2*a4*a6^2+1024*a0*a2^2*a4^2*a6-2560*a0^2*a1*a5*a6^2-2240*a0*a1^2*a5^2*a6-6528*a0*a1*a2*a4*a5*a6-1568*a0*a2*a
 3^2*a4*a6)");
+@@ -90,7 +112,7 @@ main()
+   pr=1; if(!cmpis((GEN)factp[1],2)) pr=2;
+   matmin=cgetg(6,19);
+   for(j=1;j<=5;j++)
+-    matmin[j]=lgetg(lg(factp)-pr+1,18);
++    matmin[j]=(long)cgetg(lg(factp)-pr+1,18);
+   for(i=pr;i<lg(factp);i++)
+     { 
+       p=(GEN)factp[i];
+@@ -375,7 +397,7 @@ main()
+ 		    {
+ 		      if(myval(c3,p)>1) 
+ 			{printf("bug c3");fflush(stdout);exit(1);}
+-		      mm=min(min(3*myval(c4,p)-4,3*myval(c5,p)-5),3*vc6-6);
++		      mm=minss(minss(3*myval(c4,p)-4,3*myval(c5,p)-5),3*vc6-6);
+ 		      if(alpha) 
+ 			{
+ 			  condp=dismin-mm-16;
+@@ -448,7 +470,7 @@ main()
+ 	      else
+ 		{
+ 		  list=factorpadicnonun(polh,p,dismin-5);
+-		  nb=lg(list);prod=polun[varn(polh)];
++		  nb=lg(list);prod=pol_1(varn(polh));
+ 		  for(i=1;i<nb;i++)
+ 		    {
+ 		      facti=(GEN)list[i];
+@@ -499,7 +521,7 @@ main()
+ 	  }
+ 	if(cmpis(p,3)&&!cmpis(denom(theta),3)) goto modere;
+ 	list=factorpadicnonun(polh,p,dismin-10*alpha);
+-	nb=lg(list);prod=polun[varn(polh)];
++	nb=lg(list);prod=pol_1(varn(polh));
+ 	for(i=1;i<nb;i++)
+ 	  {
+ 	    facti=(GEN)list[i];
+@@ -572,7 +594,7 @@ main()
+   polh1=gcopy(polh);
+   theta1=gcopy(theta);
+   alpha1=alpha;
+-  polh=gmul(gsubst(polh,0,ginv(polx[0])),gpuigs(polx[0],6));
++  polh=gmul(gsubst(polh,0,ginv(pol_x(0))),gpuigs(pol_x(0),6));
+   polf=polymini(gmul(polh,gpuigs(p,alpha)),p);
+   polh=(GEN)polf[1];
+   lambda=itos((GEN)polf[2]);  
+@@ -630,7 +652,7 @@ main()
+ 	  d=val[6]-val[7]+(val[eps2]/eps);
+ 	  if(r1&&alpha1==0) 
+ 	    {
+-	      polh1=gdiv(gsubst(polh1,0,gmul(p,polx[0])),gpuigs(p,3));
++	      polh1=gdiv(gsubst(polh1,0,gmul(p,pol_x(0))),gpuigs(p,3));
+ 	    }
+ 	  polhp=gmul(unmodp,polh1);	  
+ 	  if(!gcmp0(discsr(polhp))) 
+@@ -646,10 +668,10 @@ main()
+ 	{
+           if(gcmp1(theta1)) 
+ 	    {
+-	      polh1=gdiv(gsubst(polh1,0,gmul(p,polx[0])),gpuigs(p,3));
++	      polh1=gdiv(gsubst(polh1,0,gmul(p,pol_x(0))),gpuigs(p,3));
+ 	    }
+ 	  d=val[6]-3*val[3]+(val[eps2]/eps);
+-	  d1=min(val[7]-3*val[3],d/2);
++	  d1=minss(val[7]-3*val[3],d/2);
+ 	  if(d==2*d1) indice=d1;
+ 	  else
+ 	    {
+@@ -695,7 +717,7 @@ main()
+       { 
+ 	if(r1&&alpha1==0) 
+ 	  {
+-	    polh1=gdiv(gsubst(polh1,0,gmul(p,polx[0])),gpuigs(p, 3));
++	    polh1=gdiv(gsubst(polh1,0,gmul(p,pol_x(0))),gpuigs(p, 3));
+ 	  }
+ 	polhp=gmul(unmodp,polh1);	  	
+ 	if(!gcmp0(discsr(polhp))) d=0;
+@@ -724,7 +746,7 @@ main()
+       {
+ 	if(r2&&alpha==0)
+ 	  {
+-	    polh=gdiv(gsubst(polh,0,gmul(p,polx[0])),gpuigs(p,3));
++	    polh=gdiv(gsubst(polh,0,gmul(p,pol_x(0))),gpuigs(p,3));
+ 	  }
+ 	polhp=gmul(unmodp,polh);	  
+ 	if(!gcmp0(discsr(polhp))) indice=0;
+@@ -1622,7 +1644,7 @@ polval(GEN pol, GEN p)      /* la plus g
+   else
+   {
+     v=myval((GEN)pol[2],p);
+-    for(i=3;i<lx;i++) v=min(myval((GEN)pol[i],p),v);
++    for(i=3;i<lx;i++) v=minss(myval((GEN)pol[i],p),v);
+   }
+   return v;
+ }
+@@ -1648,8 +1670,8 @@ factorpadicnonun(GEN pol, GEN p, long r)
+       if(contpol) {printf("contenu non trivial, erreur\n");fflush(stdout);exit(1);}
+       pol=gdiv(pol,gpuigs(p,contpol));
+       r=(lx-4)*ggval(td,p)+r;
+-      upol=gsubst(gmul(pol,gpuigs(td,lx-4)),vx,gdiv(polx[vx],td));
+-      fact=gsubst(factorpadic4(upol,p,r),vx,gmul(polx[vx],td));
++      upol=gsubst(gmul(pol,gpuigs(td,lx-4)),vx,gdiv(pol_x(vx),td));
++      fact=gsubst(factorpadic4(upol,p,r),vx,gmul(pol_x(vx),td));
+       list=(GEN)fact[1];ep=(GEN)fact[2];nb=lg(list)-1;
+       for(i=1;i<=nb;i++)
+ 	if(!gcmp1((GEN)ep[i])) 
+@@ -1657,7 +1679,7 @@ factorpadicnonun(GEN pol, GEN p, long r)
  	    printf("erreur, racine multiple\n");fflush(stdout);exit(1);
  	  } 
        for(i=1;i<=nb;i++)
 -	(GEN)list[i]=gdiv((GEN)list[i],gpuigs(p,polval((GEN)list[i],p)));
-+	/* (GEN)list[i] = gdiv((GEN)list[i],gpuigs(p,polval((GEN)list[i],p))); */
 +	list[i] = (long) gdiv((GEN)list[i],gpuigs(p,polval((GEN)list[i],p))); 
      }
    return list;
  }
+@@ -1666,13 +1688,13 @@ GEN
+ polymini(GEN pol, GEN p)   /* polynome minimal dans Z_p, p\ne 2 */
+ {
+   GEN polh,polhp,fac,rac,ent,pent,theta,polf,pro;
+-  long alpha,i,l,lambda,maxord,beta;
++  long alpha,i,lambda,maxord,beta;
+ 
+   polf=cgetg(7,18);
+  rec1:
+   alpha=polval(pol,p);polh=gdiv(pol,gpuigs(p,alpha));
+   if(gdivise(truecoeff(polh,6),p)&&gdivise(truecoeff(polh,5),p)&&gdivise(truecoeff(polh,4),p)&&gdivise(truecoeff(polh,3),p))
+-    {polh=gmul(gpuigs(polx[0],6),gsubst(polh,0,ginv(polx[0])));}
++    {polh=gmul(gpuigs(pol_x(0),6),gsubst(polh,0,ginv(pol_x(0))));}
+   alpha=alpha&1;      
+   beta=0;  
+   lambda=0; 
+@@ -1683,11 +1705,11 @@ polymini(GEN pol, GEN p)   /* polynome m
+    
+  labelm6:
+   theta=caltheta(polh,p,lambda);
+-  polf[5]=zero;          /* 1 si racine d'ordre 3 non dans F_p, 0 sinon */
++  polf[5]=(long)gen_0;        /* 1 si racine d'ordre 3 non dans F_p, 0 sinon */
+   if(gcmp(theta,gun)>=0)
+     { 
+       ent=gfloor(theta);pent=gpui(p,ent,0);
+-      polh=gdiv(gsubst(polh,0,gmul(pent,polx[0])),gpuigs(pent,6-lambda));
++      polh=gdiv(gsubst(polh,0,gmul(pent,pol_x(0))),gpuigs(pent,6-lambda));
+       alpha=(alpha+lambda*itos(ent))&1;
+       beta=beta+itos(ent);
+       theta=gsub(theta,ent);
+@@ -1702,11 +1724,11 @@ polymini(GEN pol, GEN p)   /* polynome m
+ 	  rac=(GEN)fac[2];
+ 	  if(lgef(rac)==5) 
+ 	    {
+-	      polf[5]=un;
++	      polf[5]=(long)gen_1;
+ 	      goto sortie;
+ 	    } 
+ 	  rac=lift(gdiv(gneg(truecoeff(rac,0)),truecoeff(rac,1)));
+-	  polh=gsubst(polh,0,gadd(polx[0],rac));
++	  polh=gsubst(polh,0,gadd(pol_x(0),rac));
+ 	  lambda=6-maxord; goto labelm6;
+ 	}
+       if(maxord<=2&&lgef(polhp)>=7) goto sortie;
+@@ -1715,7 +1737,7 @@ polymini(GEN pol, GEN p)   /* polynome m
+     { 
+       if((myval(truecoeff(polh,2),p)>1-alpha)&&(myval(truecoeff(polh,1),p)>2-alpha)&&(myval(truecoeff(polh,0),p)>3-alpha))
+ 	{
+-	  pol=gsubst(polh,0,gmul(p,polx[0]));
++	  pol=gsubst(polh,0,gmul(p,pol_x(0)));
+ 	  if(alpha) pol=gmul(p,pol); 
+ 	  goto rec1;
+ 	}
+@@ -1727,7 +1749,7 @@ polymini(GEN pol, GEN p)   /* polynome m
+ 	{
+ 	  if(myval(truecoeff(polh,6),p)>=3&&myval(truecoeff(polh,5),p)>=2)
+ 	    {
+-	      polh=gmul(gsubst(polh,0,gdiv(polx[0],p)),gpuigs(p,3));
++	      polh=gmul(gsubst(polh,0,gdiv(pol_x(0),p)),gpuigs(p,3));
+ 	      theta=gadd(theta,gun);
+ 	      alpha=0;
+ 	      beta=beta-1; 
+@@ -1736,13 +1758,13 @@ polymini(GEN pol, GEN p)   /* polynome m
+ 	}
+       if(lgef(polhp)==9&&!gcmp0(theta))
+ 	{
+-	  pro=gdiv(polhp,gpuigs(polx[0],3));
++	  pro=gdiv(polhp,gpuigs(pol_x(0),3));
+ 	  fac=factmz(pro,p);
+ 	  if(!cmpis((GEN)fac[1],3))
+ 	    {
+ 	      rac=(GEN)fac[2];
+ 	      rac=lift(gdiv(gneg(truecoeff(rac,0)),truecoeff(rac,1)));
+-	      pro=gsubst(polh,0,gadd(rac,gmul(p,polx[0])));
++	      pro=gsubst(polh,0,gadd(rac,gmul(p,pol_x(0))));
+ 	      if(polval(pro,p)>=3)
+ 		{
+ 		  polh=gdiv(pro,gpuigs(p,3));
+@@ -1789,7 +1811,7 @@ discpart(GEN polh, GEN p, long ord)
+   if(lgef(polhp)!=6) 
+     {printf("bug, on ne doit pas arriver dans discpart");fflush(stdout);exit(1);}
+   list=factorpadicnonun(polh,p,ord);
+-  prod=polun[varn(polh)];
++  prod=pol_1(varn(polh));
+   for(i=1;i<lg(list);i++)
+     {
+       facti=(GEN)list[i];
+@@ -1811,7 +1833,7 @@ discpart(GEN polh, GEN p, long ord)
+ long
+ myvalzi(GEN b) /* valuation par rapport a 3 dans Z[i] */ 
+ {
+-  return min(myval(greal(b),stoi(3)),myval(gimag(b),stoi(3)));
++  return minss(myval(greal(b),stoi(3)),myval(gimag(b),stoi(3)));
+ }
+ 
+ GEN 
+@@ -1827,15 +1849,15 @@ polyminizi(GEN pol) /* polynome minimal
+   polh=pol;
+   if(alpha) polh=gdiv(pol,p);
+   beta=0;  
+-  rac=gadd(lift(gdiv(gmul(unmodp,truecoeff(polh,3)),gmul(unmodp,truecoeff(polh,6)))),gi);
++  rac=gadd(lift(gdiv(gmul(unmodp,truecoeff(polh,3)),gmul(unmodp,truecoeff(polh,6)))),gen_I());
+   
+  labelm6:
+-  polh=gsubst(polh,0,gadd(polx[0],rac));  
++  polh=gsubst(polh,0,gadd(pol_x(0),rac));  
+   theta=calthetazi(polh);
+   if(gcmp(theta,gun)>=0)
+     { 
+       ent=gfloor(theta);pent=gpui(p,ent,0);
+-      polh=gdiv(gsubst(polh,0,gmul(pent,polx[0])),gpuigs(pent,3));
++      polh=gdiv(gsubst(polh,0,gmul(pent,pol_x(0))),gpuigs(pent,3));
+       alpha=(alpha+itos(ent))&1;
+       beta=beta+itos(ent);
+       theta=gsub(theta,ent);
+@@ -1853,7 +1875,7 @@ polyminizi(GEN pol) /* polynome minimal
+     {
+       if(myvalzi(truecoeff(polh,6))>=3&&myvalzi(truecoeff(polh,5))>=2&&myvalzi(truecoeff(polh,4))>=1)
+ 	{
+-	  polh=gmul(gsubst(polh,0,gdiv(polx[0],p)),gpuigs(p,3));
++	  polh=gmul(gsubst(polh,0,gdiv(pol_x(0),p)),gpuigs(p,3));
+ 	  theta=gadd(theta,gun);
+ 	  beta=beta-1;
+ 	  alpha=0;	
+@@ -1881,7 +1903,7 @@ myvalzi2(GEN b)
+ /* on calcule la valuation de b dans Z[i, Y]/(Y^2-3) */
+  {
+   b=lift(b);
+-  return min(2*myvalzi(truecoeff(b,0)),2*myvalzi(truecoeff(b,1))+1);
++  return minss(2*myvalzi(truecoeff(b,0)),2*myvalzi(truecoeff(b,1))+1);
+ }
+ 
+ GEN
+@@ -1910,10 +1932,10 @@ polyminizi2(GEN pol)   /* polynome minim
+     {printf("bug, le polynome n'est pas minimal\n");fflush(stdout);exit(1);}
+   polh=pol;alpha=0;
+   beta=0;  
+-  polh=gdivgs(gsubst(polh,0,gmul(polx[0],y)),27);
++  polh=gdivgs(gsubst(polh,0,gmul(pol_x(0),y)),27);
+   if(myvalzi2(truecoeff(polh,4))>0&&myvalzi2(truecoeff(polh,2))>0)  
+     {
+-      if(myvalzi2(gsub(truecoeff(polh,6),truecoeff(polh,0)))>0) rac=gi;
++      if(myvalzi2(gsub(truecoeff(polh,6),truecoeff(polh,0)))>0) rac=gen_I();
+       else rac=gun;
+     }
+   else 
+@@ -1923,12 +1945,12 @@ polyminizi2(GEN pol)   /* polynome minim
+     }
+ 
+  labelm6:
+-  polh=gsubst(polh,0,gadd(polx[0],rac));  
++  polh=gsubst(polh,0,gadd(pol_x(0),rac));  
+   theta=calthetazi2(polh);
+   if(gcmp(theta,gun)>=0)
+     { 
+       ent=gfloor(theta);pent=gpui(y,ent,0);
+-      polh=gdiv(gsubst(polh,0,gmul(pent,polx[0])),gpuigs(pent,3));
++      polh=gdiv(gsubst(polh,0,gmul(pent,pol_x(0))),gpuigs(pent,3));
+       alpha=(alpha+itos(ent))&1;
+       beta=beta+itos(ent);
+       theta=gsub(theta,ent);
+@@ -1972,7 +1994,7 @@ zi2mod(GEN u)  /* u est un element de Z[
+   u=truecoeff(lift(u),0);
+   a=gmul(unmodp,greal(u));
+   b=gmul(unmodp,gimag(u));
+-  u=gadd(a,gmul(b,gi));
++  u=gadd(a,gmul(b,gen_I()));
+   return u;
+ }
+ 
+@@ -1982,7 +2004,7 @@ factmz(GEN polhp, GEN p)
+    dans F_p de degre <7 */
+ {
+   GEN dh,z,b,fac;
+-  long m,i,vx,l;
++  long m,i,vx,l=0;
+   
+   b=cgetg(3,18);
+   m=0;
+@@ -1994,7 +2016,7 @@ factmz(GEN polhp, GEN p)
+ 	{
+ 	  fac=(GEN)factmod(polhp,p);
+ 	  for(i=1;i<lg((GEN)fac[2]);i++) 
+-	    m=max(m,itos(gcoeff(fac,i,2)));
++	    m=maxss(m,itos(gcoeff(fac,i,2)));
+ 	  for(i=1;i<lg((GEN)fac[1]);i++) 
+ 	    if(!cmpis(gcoeff(fac,i,2),m)) l=i;
+ 	  z=gcoeff(fac,l,1);
+@@ -2017,7 +2039,6 @@ factmz(GEN polhp, GEN p)
+       fac=(GEN)factmod(z,p);
+       z=gcoeff(fac,1,1);
+     }
+- sort:
+   b[1]=(long)stoi(m);
+   b[2]=(long)z;
+   return b;
diff --git a/genus2reduction.spec b/genus2reduction.spec
index 01e332e..ae944e1 100644
--- a/genus2reduction.spec
+++ b/genus2reduction.spec
@@ -1,6 +1,6 @@
 Name:           genus2reduction
 Version:        0.3
-Release:        8%{?dist}.2
+Release:        9%{?dist}
 Summary:        Computes Reductions of Genus 2 Proper Smooth Curves
 Group:          Applications/Engineering
 License:        GPLv2
@@ -10,50 +10,49 @@ Source0:        http://www.math.u-bordeaux.fr/~liu/G2R/genus2reduction-%{version
 Source1:        genus2reduction.mbox
 # More license clarification:
 Source2:        genus2reduction-licenseinfo.txt
-# http://svn.pardus.org.tr/viewcvs/devel/applications/science/mathematics/genus2reduction/files/header-path.patch?root=pardus&revision=37446&content-type=text%2Fplain
-Patch0:         genus2reduction-header-path.patch
-# http://svn.pardus.org.tr/viewcvs/devel/applications/science/mathematics/genus2reduction/files/compile.patch?root=pardus&revision=37446&content-type=text%2Fplain
-Patch1:         genus2reduction-compile.patch
-BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+# Adapt to pari 2.5
+Patch0:         genus2reduction-compile.patch
 
-BuildRequires:  gmp-devel
 BuildRequires:  pari-devel
 
-
 %description
-Determines the reduction of a proper smooth curve of genus 2 at any
-prime number p.
+Computes the conductor and reduction types for a genus 2 hyperelliptic
+curve.
+
+As an example of genus2reduction's functionality, let C be a proper
+smooth curve of genus 2 defined by a hyperelliptic equation
+y^2+Q(x)y=P(x), where P(x) and Q(x) are polynomials with rational
+coefficients such that deg(Q(x))<4, deg(P(x))<7.  Let J(C) be the
+Jacobian of C, let X be the minimal regular model of C over the ring of
+integers Z.
 
+This program determines the reduction of C at any prime number p (that
+is the special fiber X_p of X over p), and the exponent f of the
+conductor of J(C) at p.
 
 %prep
 %setup -q
 %patch0
-%patch1
-cp %{SOURCE1} .
-cp %{SOURCE2} .
-
+cp -p %{SOURCE1} .
+cp -p %{SOURCE2} .
 
 %build
-make CC="%{__cc} $RPM_OPT_FLAGS"
-
+make CC="%{__cc}" CFLAGS="$RPM_OPT_FLAGS -I/usr/include/pari"
 
 %install
-rm -rf $RPM_BUILD_ROOT
 mkdir -p $RPM_BUILD_ROOT%{_bindir}
 install -p -m 755 %{name} $RPM_BUILD_ROOT%{_bindir}/%{name}
 
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-
 %files
-%defattr(-,root,root,-)
 %doc README %{name}.mbox %{name}-licenseinfo.txt
 %{_bindir}/%{name}
 
-
 %changelog
+* Wed Jul 25 2012 Jerry James <loganjerry at gmail.com> - 0.3-9
+- Adapt to newer versions of pari
+- Minor spec file cleanups
+- New description courtesy of Debian
+
 * Thu Jul 19 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.3-8.2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
 


More information about the scm-commits mailing list