Commit 859be607 authored by Peter Bruin's avatar Peter Bruin

new function multiples

parent 3293c6da
......@@ -149,6 +149,17 @@ random_torsion_point(GEN J, unsigned long l) {
return gerepileupto(av, P);
}
static GEN
multiples(GEN J, GEN P, long l) {
GEN mult = cgetg(l + 1, t_VEC);
long i;
gel(mult, 1) = jacobian_zero(J);
gel(mult, 2) = P;
for(i = 2; i < l; i++)
gel(mult, i + 1) = jacobian_add(J, gel(mult, i), P);
return mult;
}
static GEN
random_representation_space_point(GEN J, unsigned long l, GEN projector, int tries) {
GEN P;
......@@ -271,13 +282,8 @@ values_from_basis(GEN J, GEN P, GEN Q, long l, GEN multiples_O) {
GEN multiples_P, multiples_Q, D, V;
err_printf("computing multiples of P and Q\n");
multiples_P = cgetg(l + 1, t_VEC);
multiples_Q = cgetg(l + 1, t_VEC);
gel(multiples_P, 1) = gel(multiples_Q, 1) = jacobian_zero(J);
for(i = 1; i < l; i++) {
gel(multiples_P, i + 1) = jacobian_add(J, gel(multiples_P, i), P);
gel(multiples_Q, i + 1) = jacobian_add(J, gel(multiples_Q, i), Q);
}
multiples_P = multiples(J, P, l);
multiples_Q = multiples(J, Q, l);
err_printf("computing function values:");
av1 = avma;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment