"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/basemath/bibli1.c" between
pari-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.

bibli1.c  (pari-2.13.0):bibli1.c  (pari-2.13.1)
skipping to change at line 1095 skipping to change at line 1095
static GEN static GEN
minim_lll(GEN a, GEN *u) minim_lll(GEN a, GEN *u)
{ {
*u = lllgramint(a); *u = lllgramint(a);
if (lg(*u) != lg(a)) err_minim(a); if (lg(*u) != lg(a)) err_minim(a);
return qf_apply_ZM(a,*u); return qf_apply_ZM(a,*u);
} }
static void static void
forqfvec_init_dolll(struct qfvec *qv, GEN a, long dolll) forqfvec_init_dolll(struct qfvec *qv, GEN *pa, long dolll)
{ {
GEN r, u; GEN r, u, a = *pa;
if (!dolll) u = NULL; if (!dolll) u = NULL;
else else
{ {
if (typ(a) != t_MAT || !RgM_is_ZM(a)) pari_err_TYPE("qfminim",a); if (typ(a) != t_MAT || !RgM_is_ZM(a)) pari_err_TYPE("qfminim",a);
a = minim_lll(a, &u); a = *pa = minim_lll(a, &u);
} }
qv->a = RgM_gtofp(a, DEFAULTPREC); qv->a = RgM_gtofp(a, DEFAULTPREC);
r = qfgaussred_positive(qv->a); r = qfgaussred_positive(qv->a);
if (!r) if (!r)
{ {
r = qfgaussred_positive(a); /* exact computation */ r = qfgaussred_positive(a); /* exact computation */
if (!r) err_minim(a); if (!r) err_minim(a);
r = RgM_gtofp(r, DEFAULTPREC); r = RgM_gtofp(r, DEFAULTPREC);
} }
qv->r = r; qv->r = r;
qv->u = u; qv->u = u;
} }
static void static void
forqfvec_init(struct qfvec *qv, GEN a) forqfvec_init(struct qfvec *qv, GEN a)
{ forqfvec_init_dolll(qv, a, 1); } { forqfvec_init_dolll(qv, &a, 1); }
static void static void
forqfvec_i(void *E, long (*fun)(void *, GEN, GEN, double), struct qfvec *qv, GEN BORNE) forqfvec_i(void *E, long (*fun)(void *, GEN, GEN, double), struct qfvec *qv, GEN BORNE)
{ {
GEN x, a = qv->a, r = qv->r, u = qv->u; GEN x, a = qv->a, r = qv->r, u = qv->u;
long n = lg(a), i, j, k; long n = lg(a), i, j, k;
double p,BOUND,*v,*y,*z,**q; double p,BOUND,*v,*y,*z,**q;
const double eps = 0.0001; const double eps = 0.0001;
if (!BORNE) BORNE = gen_0; if (!BORNE) BORNE = gen_0;
else else
skipping to change at line 1299 skipping to change at line 1299
case min_ALL: case min_ALL:
if (n == 1 || (!sBORNE && BORNE)) if (n == 1 || (!sBORNE && BORNE))
retmkvec3(gen_0, gen_0, cgetg(1, t_MAT)); retmkvec3(gen_0, gen_0, cgetg(1, t_MAT));
L = new_chunk(1+maxrank); L = new_chunk(1+maxrank);
break; break;
default: default:
return NULL; return NULL;
} }
minim_alloc(n, &q, &x, &y, &z, &v); minim_alloc(n, &q, &x, &y, &z, &v);
forqfvec_init_dolll(&qv, a, dolll); forqfvec_init_dolll(&qv, &a, dolll);
av1 = avma; av1 = avma;
r = qv.r; r = qv.r;
u = qv.u; u = qv.u;
n--; n--;
for (j=1; j<=n; j++) for (j=1; j<=n; j++)
{ {
v[j] = rtodbl(gcoeff(r,j,j)); v[j] = rtodbl(gcoeff(r,j,j));
for (i=1; i<j; i++) q[i][j] = rtodbl(gcoeff(r,i,j)); /* |.| <= 1/2 */ for (i=1; i<j; i++) q[i][j] = rtodbl(gcoeff(r,i,j)); /* |.| <= 1/2 */
} }
skipping to change at line 1923 skipping to change at line 1923
} }
else else
{ {
long prec = PREC; long prec = PREC;
l = lg(a); l = lg(a);
if (l == 1) if (l == 1)
{ {
if (CHECK) pari_err_TYPE("fincke_pohst [dimension 0]", a); if (CHECK) pari_err_TYPE("fincke_pohst [dimension 0]", a);
retmkvec3(gen_0, gen_0, cgetg(1,t_MAT)); retmkvec3(gen_0, gen_0, cgetg(1,t_MAT));
} }
u = lllfp(a, 0.75, LLL_GRAM); u = lllfp(a, 0.75, LLL_GRAM | LLL_IM);
if (lg(u) != lg(a)) return NULL; if (lg(u) != lg(a)) return NULL;
r = qf_apply_RgM(a,u); r = qf_apply_RgM(a,u);
i = gprecision(r); i = gprecision(r);
if (i) if (i)
prec = i; prec = i;
else { else {
prec = DEFAULTPREC + nbits2extraprec(gexpo(r)); prec = DEFAULTPREC + nbits2extraprec(gexpo(r));
if (prec < PREC) prec = PREC; if (prec < PREC) prec = PREC;
} }
if (DEBUGLEVEL>2) err_printf("first LLL: prec = %ld\n", prec); if (DEBUGLEVEL>2) err_printf("first LLL: prec = %ld\n", prec);
 End of changes. 6 change blocks. 
6 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)