| Karim BELABAS on Thu, 4 Feb 1999 18:14:19 +0100 (MET) |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
| Re: nfgaloisapply |
[Paul van Wamelen:]
> According to the documentation nfgaloisapply is supposed to be able to
> take an ideal in idealprimedec form as an argument, but it does not
> seem to: [...]
According to source code, it looks like you're the first one to have actually
tried it... Here's a patch:
Karim.
*** src/basemath/base1.c.orig Wed Jan 20 17:09:33 1999
--- src/basemath/base1.c Thu Feb 4 18:04:42 1999
***************
*** 897,909 ****
galoisapply(GEN nf, GEN aut, GEN x)
{
long av=avma,tetpil,lx,j,N;
! GEN p1,y,pol,unmod;
nf=checknf(nf); pol=(GEN)nf[1];
if (typ(aut)==t_POL) aut = gmodulcp(aut,pol);
else
{
! if (typ(aut)!=t_POLMOD || !gegal((GEN)aut[1],pol) || gcmp0((GEN)aut[1]))
err(talker,"incorrect galois automorphism in galoisapply");
}
switch(typ(x))
--- 897,909 ----
galoisapply(GEN nf, GEN aut, GEN x)
{
long av=avma,tetpil,lx,j,N;
! GEN p,p1,y,pol;
nf=checknf(nf); pol=(GEN)nf[1];
if (typ(aut)==t_POL) aut = gmodulcp(aut,pol);
else
{
! if (typ(aut)!=t_POLMOD || !gegal((GEN)aut[1],pol))
err(talker,"incorrect galois automorphism in galoisapply");
}
switch(typ(x))
***************
*** 930,944 ****
}
if (lg(x)!=6) err(typeer,"galoisapply");
y=cgetg(6,t_VEC); y[1]=x[1]; y[3]=x[3]; y[4]=x[4];
! unmod=gmodulsg(1,(GEN)x[1]);
! p1=centerlift(gmul(unmod,algtobasis(nf,galoisapply(nf,aut,(GEN)x[2]))));
! if (gcmp1((GEN)x[3]))
! if (ggval(subres(gmul((GEN)nf[7],p1),pol),(GEN)x[1]) > itos((GEN)x[4]))
! p1[1] = (signe(p1[1]) > 0)? lsub((GEN)p1[1],(GEN)x[1])
! : ladd((GEN)p1[1],(GEN)x[1]);
y[2]=(long)p1;
! p1=centerlift(gmul(unmod,algtobasis(nf,galoisapply(nf,aut,(GEN)x[5]))));
! y[5]=(long)p1;
tetpil=avma; return gerepile(av,tetpil,gcopy(y));
case t_COL:
--- 930,943 ----
}
if (lg(x)!=6) err(typeer,"galoisapply");
y=cgetg(6,t_VEC); y[1]=x[1]; y[3]=x[3]; y[4]=x[4];
! p = (GEN)x[1];
! p1=centermod(galoisapply(nf,aut,(GEN)x[2]), p);
! if (is_pm1(x[3]))
! if (ggval(subres(gmul((GEN)nf[7],p1),pol), p) > itos((GEN)x[4]))
! p1[1] = (signe(p1[1]) > 0)? lsub((GEN)p1[1], p)
! : ladd((GEN)p1[1], p);
y[2]=(long)p1;
! y[5]=(long)centermod(galoisapply(nf,aut,(GEN)x[5]), p);
tetpil=avma; return gerepile(av,tetpil,gcopy(y));
case t_COL:
--
Karim Belabas email: Karim.Belabas@math.u-psud.fr
Dep. de Mathematiques, Bat. 425
Universite Paris-Sud Tel: (00 33) 1 69 15 57 48
F-91405 Orsay (France) Fax: (00 33) 1 69 15 60 19
--
PARI/GP Home Page: http://hasse.mathematik.tu-muenchen.de/ntsw/pari/