static GEN Z2x_rshift(GEN y, long x) { GEN z; long i, l; if (!x) return pol0_Flx(y[1]); z = cgetg_copy(y, &l); z[1] = y[1]; for(i=2; i<l; i++) z[i] = y[i]>>x; return Flx_renormalize(z, l); }
static GEN vtilde(GEN K, GEN x, GEN T, GEN deg, GEN ell, long prec) { GEN G, E, vG; long i, l; if (typ(x) != t_MAT) return vtilde_i(K,x,T,deg,ell,prec); G = gel(x,1); vG = cgetg_copy(G, &l); E = gel(x,2); for (i = 1; i < l; i++) gel(vG, i) = vtilde_i(K, gel(G,i),T,deg,ell,prec); return RgV_dotproduct(E, vG); }
static GEN ellsylow(GEN cyc, GEN ell) { long i, l; GEN d = cgetg_copy(cyc, &l); for (i = 1; i < l; i++) { GEN c = gel(cyc,i), a; if (!Z_pvalrem(c, ell, &a)) break; gel(d,i) = diviiexact(c, a); } setlg(d, i); return d; }
/* Given a number field K and a prime p, return * S = places of K above p [primedec] * R = corresponding p-adic factors of K.pol (mod p^k), in the same order */ static GEN padicfact(GEN K, GEN S, long k) { GEN R, p = pr_get_p(gel(S,1)); GEN T = gel(factorpadic(nf_get_pol(K), p, k), 1); long l, i; S = idealprimedec(K, p); R = cgetg_copy(S, &l); for (i = 1; i < l; i++) { long j = get_ZpX_index(K, gel(S,i), T); gel(R,i) = gel(T,j); gel(T,j) = NULL; } return R; }