Commit d3747a63 authored by Peter Bruin's avatar Peter Bruin

simplify curve_divide_subspaces

parent 11324818
......@@ -418,21 +418,19 @@ curve_divide_subspaces (GEN X, GEN Z, unsigned long i_Z,
unsigned long p = curve_base_field_characteristic(X);
GEN T = curve_base_field_polynomial(X);
int h = lg(W) - 1, i, i_V = i_Z - i_W;
GEN V = curve_V(X, i_V), pivots, K, M, R, Zt;
GEN V = curve_V(X, i_V), pivots, K, M, R;
pari_sp av = avma;
/* Extract the useful rows. */
pivots = curve_pivots_V(X, i_Z);
Zt = shallowextract(matsmall_transpose(Z, p, T), pivots);
K = matsmall_ker(Zt, p, T);
M = cgetg(h + 1, t_VEC);
K = matsmall_coker(rowpermute(Z, pivots), p, T);
M = cgetg(h + 1, t_COL);
for (i = 1; i <= h; i++) {
GEN s = gel(W, i);
GEN sV = curve_multiply_section_subspace(X, s, V);
GEN sVt = shallowextract(matsmall_transpose(sV, p, T), pivots);
gel(M, i) = matsmall_mul(sVt, K, p, T);
gel(M, i) = matsmall_mul(K, rowpermute(sV, pivots), p, T);
}
R = matsmall_transpose(shallowconcat1(M), p, T);
R = shallowmatconcat(M);
return gerepileupto(av, matsmall_mul(V, matsmall_ker(R, p, T), p, T));
}
......
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