Commit 3da06ab8 authored by Peter Bruin's avatar Peter Bruin

new function matsmall_complement

parent 7b338f81
......@@ -175,6 +175,19 @@ matsmall_coker (GEN A, unsigned long p, GEN T) {
return gerepilecopy(av, shallowtrans(FlxqM_ker(shallowtrans(A), T, p)));
}
/* Complement of a linear subspace in another subspace. */
GEN
matsmall_complement(GEN V, GEN W, unsigned long p, GEN T) {
pari_sp av = avma;
long n = lg(V) - 1, d = lg(V) - lg(W), r;
GEN Z;
do {
Z = matsmall_random_subspace(V, d, 0, p, T);
r = matsmall_rank(shallowconcat(W, Z), p, T);
} while (r < n);
return gerepileupto(av, Z);
}
/*
Quotient of two linear subspaces W \subseteq V
of some ambient vector space.
......
......@@ -11,6 +11,7 @@ GEN matsmall_coker (GEN V, unsigned long p, GEN T);
GEN matsmall_solve (GEN A, GEN B, unsigned long p, GEN T);
GEN matsmall_solve_left (GEN A, GEN B, unsigned long p, GEN T);
GEN matsmall_inverse_image (GEN A, GEN V, unsigned long p, GEN T);
GEN matsmall_complement(GEN V, GEN W, unsigned long p, GEN T);
GEN matsmall_quotient(GEN V, GEN W, unsigned long p, GEN T);
GEN matsmall_random (unsigned long rows, unsigned long cols,
unsigned long p, GEN 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