## "Fossies" - the Fresh Open Source Software Archive

### Source code changes of the file "src/basemath/mftrace.c" betweenpari-2.13.0.tar.gz and pari-2.13.1.tar.gz

About: PARI/GP is a computer algebra system designed for fast computations in number theory (factorizations, algebraic number theory, elliptic curves...), but also contains a large number of other mathematical functions.

mftrace.c  (pari-2.13.0):mftrace.c  (pari-2.13.1)
skipping to change at line 1249 skipping to change at line 1249
f = Rg_embed1(f, vT); f = Rg_embed1(f, vT);
else else
f = Rg_embed2(f, varn(gel(E,1)), vT, gel(E,3)); f = Rg_embed2(f, varn(gel(E,1)), vT, gel(E,3));
return f; return f;
} }
/* vector of the sigma(f), sigma in vE */ /* vector of the sigma(f), sigma in vE */
static GEN static GEN
RgX_embedall(GEN f, long vx, GEN vE) RgX_embedall(GEN f, long vx, GEN vE)
{ {
long i, l = lg(vE); long i, l = lg(vE);
GEN v = cgetg(l, t_VEC); GEN v;
if (l == 2) return RgX_embed(f, vx, gel(vE,1));
v = cgetg(l, t_VEC);
for (i = 1; i < l; i++) gel(v,i) = RgX_embed(f, vx, gel(vE,i)); for (i = 1; i < l; i++) gel(v,i) = RgX_embed(f, vx, gel(vE,i));
return v; return v;
} }
/* matrix whose colums are the sigma(v), sigma in vE */ /* matrix whose colums are the sigma(v), sigma in vE */
static GEN static GEN
RgC_embedall(GEN v, GEN vE) RgC_embedall(GEN v, GEN vE)
{ {
long j, l = lg(vE); long j, l = lg(vE);
GEN M = cgetg(l, t_MAT); GEN M = cgetg(l, t_MAT);
for (j = 1; j < l; j++) gel(M,j) = mfvecembed(gel(vE,j), v); for (j = 1; j < l; j++) gel(M,j) = mfvecembed(gel(vE,j), v);
return M; return M;
} }
skipping to change at line 8947 skipping to change at line 8949
static GEN static GEN
charLFwt1(long N, GEN CHI, long ord, long t) charLFwt1(long N, GEN CHI, long ord, long t)
{ {
GEN S; GEN S;
long r, vt; long r, vt;
if (N == 1 && t == 1) return mkfrac(gen_m1,stoi(4)); if (N == 1 && t == 1) return mkfrac(gen_m1,stoi(4));
S = gen_0; vt = varn(mfcharpol(CHI)); S = gen_0; vt = varn(mfcharpol(CHI));
for (r = 1; r < N; r++) for (r = 1; r < N; r++)
{ /* S += r*chi(r) */ { /* S += r*chi(r) */
long a; long a, c;
if (ugcd(N,r) != 1) continue; if (ugcd(N,r) != 1) continue;
a = mfcharevalord(CHI,r,ord); a = mfcharevalord(CHI,r,ord);
(t != 1 && kross(t, r) < c = (t != 1 && kross(t, r) < 0)? -r: r;
S = gadd(S, Qab_Czeta(a, ord, vt)); S = gadd(S, Qab_Czeta(a, ord, stoi(c), vt));
} }
return gdivgs(S, -2*N); return gdivgs(S, -2*N);
} }
/* L(CHI,0) / 2, mod p */ /* L(CHI,0) / 2, mod p */
static ulong static ulong
charLFwt1_Fl(GEN CHIvec, GEN vz, ulong p) charLFwt1_Fl(GEN CHIvec, GEN vz, ulong p)
{ {
long r, m = CHIvec_N(CHIvec); long r, m = CHIvec_N(CHIvec);
ulong S; ulong S;
if (m == 1) return Rg_to_Fl(mkfrac(gen_m1,stoi(4)), p); if (m == 1) return Rg_to_Fl(mkfrac(gen_m1,stoi(4)), p);
skipping to change at line 9020 skipping to change at line 9022
long a = mycharexpo(CHIvec,r); long a = mycharexpo(CHIvec,r);
if (a < 0) continue; if (a < 0) continue;
S = Fl_add(S, Qab_Czeta_Fl(a, vz, Flx_eval(P,r,p), p), p); S = Fl_add(S, Qab_Czeta_Fl(a, vz, Flx_eval(P,r,p), p), p);
} }
return Fl_div(Fl_neg(S,p), 2*k*m, p); return Fl_div(Fl_neg(S,p), 2*k*m, p);
} }
static GEN static GEN
mfeisenstein2_0(long k, GEN CHI1, GEN CHI2, long ord) mfeisenstein2_0(long k, GEN CHI1, GEN CHI2, long ord)
{ {
if (k == 1 && long N1 = mfcharmodulus(CHI1), N2 = mfcharmodulus(CHI2);
return 1, CHI2, ord, 1); if (k == 1 && N1 == 1) return charLFwtk(N2, 1, CHI2, ord, 1);
if if (N2 == 1) return charLFwtk(N1, k, CHI1, ord, 1);
return k, CHI1, ord, 1); return gen_0;
return gen_0;
} }
static ulong static ulong
mfeisenstein2_0_Fl(long k, GEN CHI1vec, GEN CHI2vec, GEN vz, ulong p) mfeisenstein2_0_Fl(long k, GEN CHI1vec, GEN CHI2vec, GEN vz, ulong p)
{ {
if (k == 1 && CHIvec_(CHI1vec) == 1) if (k == 1 && CHIvec_N(CHI1vec) == 1)
return charLFwtk_Fl(k, CHI2vec, vz, p); return charLFwtk_Fl(k, CHI2vec, vz, p);
else if (CHIvec_(CHI2vec) == 1) else if (CHIvec_N(CHI2vec) == 1)
return charLFwtk_Fl(k, CHI1vec, vz, p); return charLFwtk_Fl(k, CHI1vec, vz, p);
else return 0; else return 0;
} }
static GEN static GEN
NK_eisen2(long k, GEN CHI1, GEN CHI2, long ord) NK_eisen2(long k, GEN CHI1, GEN CHI2, long ord)
{ {
long o, N = mfcharmodulus(CHI1)*mfcharmodulus(CHI2); long o, N = mfcharmodulus(CHI1)*mfcharmodulus(CHI2);
GEN CHI = mfcharmul(CHI1, CHI2); GEN CHI = mfcharmul(CHI1, CHI2);
o = mfcharorder(CHI); o = mfcharorder(CHI);
if ((ord & 3) == 2) ord >>= 1; if ((ord & 3) == 2) ord >>= 1;
skipping to change at line 12205 skipping to change at line 12206
return gerepileupto(av, normalizeapprox(z, bitprec-20)); return gerepileupto(av, normalizeapprox(z, bitprec-20));
} }
else if (!tsc2) else if (!tsc2)
{ {
GEN z = mfsymbolevalpartial(fs, be, ga, bitprec); GEN z = mfsymbolevalpartial(fs, be, ga, bitprec);
if (c) z = gsub(mfsymboleval(fs, mkvec2(al, mkoo()), ga, bitprec), z); if (c) z = gsub(mfsymboleval(fs, mkvec2(al, mkoo()), ga, bitprec), z);
if (vabd) z = unact(z, vabd, k, prec); if (vabd) z = unact(z, vabd, k, prec);
return gerepileupto(av, normalizeapprox(z, bitprec-20)); return gerepileupto(av, normalizeapprox(z, bitprec-20));
} }
if (F) pari_err_TYPE("mfsymboleval", fs); if (F) pari_err_TYPE("mfsymboleval", fs);
D = a*d-b*c; if (!D) return D = a*d-b*c;
if (!D) { set_avma(av); return RgX_embedall(gen_0, 0, fs_get_vE(fs)); }
mfpols = fs_get_pols(fs); mfpols = fs_get_pols(fs);
cosets = fs_get_cosets(fs); cosets = fs_get_cosets(fs);
CHI = MF_get_CHI(mf); N = MF_get_N(mf); CHI = MF_get_CHI(mf); N = MF_get_N(mf);
cbezout(a, c, &u, &v); B = u*b + v*d; tau = mkmat22s(a, -v, c, u); cbezout(a, c, &u, &v); B = u*b + v*d; tau = mkmat22s(a, -v, c, u);
V = gcf(sstoQ(B, D)); V = gcf(sstoQ(B, D));
LM = shallowconcat(mkcol2(gen_1, gen_0), contfracpnqn(V, lg(V))); LM = shallowconcat(mkcol2(gen_1, gen_0), contfracpnqn(V, lg(V)));
S = gen_0; m = lg(LM) - 2; S = gen_0; m = lg(LM) - 2;
for (j = 0; j < m; j++) for (j = 0; j < m; j++)
{ {
GEN M, P; GEN M, P;
skipping to change at line 12874 skipping to change at line 12876
{ {
long f = pr_get_f(pr); long f = pr_get_f(pr);
if (Fl_powu(p % n, f, n) != 1) continue; if (Fl_powu(p % n, f, n) != 1) continue;
} }
gel(P,j) = pr; gel(P,j) = pr;
gel(E,j) = Ej; j++; gel(E,j) = Ej; j++;
} }
setlg(P,j); setlg(P,j);
setlg(E,j); setlg(E,j);
cond = mkvec2(cond, const_vec(r1, gen_1)); cond = mkvec2(cond, const_vec(r1, gen_1));
bnr = Buchraymod(Buchall(nf, , prec), cond, nf_INIT, utoipos(n)); bnr = Buchraymod(Buchall(nf, nf_FORCE, prec), cond, nf_INIT, utoipos(n));
cyc = bnr_get_cyc(bnr); cyc = bnr_get_cyc(bnr);
d = lg(cyc)-1; d = lg(cyc)-1;
H = zv_diagonal(ZV_to_Flv(cyc, n)); H = zv_diagonal(ZV_to_Flv(cyc, n));
gn = utoi(n); gn = utoi(n);
for (i = 1;;) for (i = 1;;)
{ {
for(j = 2; i < lg(*pO); i++) for(j = 2; i < lg(*pO); i++)
{ {
long o, q = (*pP)[i]; long o, q = (*pP)[i];
GEN pr = idealprimedec_galois(nf, stoi(q)); GEN pr = idealprimedec_galois(nf, stoi(q));
End of changes. 9 change blocks.
14 lines changed or deleted 16 lines changed or added