Commit 35d4affa authored by Peter Bruin's avatar Peter Bruin

Merge identical functions rsolve_upper_1/lsolve_upper_1

parent 7c1e3174
......@@ -3,8 +3,8 @@
#include "Flm_solve_triangular.h"
static GEN
Flm_rsolve_upper_1(GEN U, GEN B, ulong p) {
return Flm_Fl_mul(B, Fl_inv(coeff(U, 1, 1), p), p);
Flm_solve_upper_1(GEN U, GEN B, ulong p) {
return Flm_Fl_mul(B, Fl_inv(ucoeff(U, 1, 1), p), p);
}
static GEN
......@@ -31,7 +31,7 @@ Flm_rsolve_upper(GEN U, GEN B, ulong p) {
if (n == 0)
return B;
if (n == 1)
return Flm_rsolve_upper_1(U, B, p);
return Flm_solve_upper_1(U, B, p);
if (n == 2)
return Flm_rsolve_upper_2(U, B, p);
n1 = (n + 1)/2;
......@@ -48,11 +48,6 @@ Flm_rsolve_upper(GEN U, GEN B, ulong p) {
return gerepilecopy(av, vconcat(X1, X2));
}
static GEN
Flm_lsolve_upper_1(GEN U, GEN B, ulong p) {
return Flm_Fl_mul(B, Fl_inv(coeff(U, 1, 1), p), p);
}
static GEN
Flm_lsolve_upper_2(GEN U, GEN B, ulong p) {
ulong a = ucoeff(U, 1, 1), b = ucoeff(U, 1, 2), d = ucoeff(U, 2, 2);
......@@ -77,7 +72,7 @@ Flm_lsolve_upper(GEN U, GEN B, ulong p) {
if (n == 0)
return B;
if (n == 1)
return Flm_lsolve_upper_1(U, B, p);
return Flm_solve_upper_1(U, B, p);
if (n == 2)
return Flm_lsolve_upper_2(U, B, p);
n1 = (n + 1)/2;
......
......@@ -2,7 +2,7 @@
#include "FlxqM_solve_triangular.h"
static GEN
FlxqM_rsolve_upper_1(GEN U, GEN B, GEN T, ulong p) {
FlxqM_solve_upper_1(GEN U, GEN B, GEN T, ulong p) {
return FlxqM_Flxq_mul(B, Flxq_inv(gcoeff(U, 1, 1), T, p), T, p);
}
......@@ -30,7 +30,7 @@ FlxqM_rsolve_upper(GEN U, GEN B, GEN T, ulong p) {
if (n == 0)
return B;
if (n == 1)
return FlxqM_rsolve_upper_1(U, B, T, p);
return FlxqM_solve_upper_1(U, B, T, p);
if (n == 2)
return FlxqM_rsolve_upper_2(U, B, T, p);
n1 = (n + 1)/2;
......@@ -47,11 +47,6 @@ FlxqM_rsolve_upper(GEN U, GEN B, GEN T, ulong p) {
return gerepilecopy(av, vconcat(X1, X2));
}
static GEN
FlxqM_lsolve_upper_1(GEN U, GEN B, GEN T, ulong p) {
return FlxqM_Flxq_mul(B, Flxq_inv(gcoeff(U, 1, 1), T, p), T, p);
}
static GEN
FlxqM_lsolve_upper_2(GEN U, GEN B, GEN T, ulong p) {
GEN a = gcoeff(U, 1, 1), b = gcoeff(U, 1, 2), d = gcoeff(U, 2, 2);
......@@ -76,7 +71,7 @@ FlxqM_lsolve_upper(GEN U, GEN B, GEN T, ulong p) {
if (n == 0)
return B;
if (n == 1)
return FlxqM_lsolve_upper_1(U, B, T, p);
return FlxqM_solve_upper_1(U, B, T, p);
if (n == 2)
return FlxqM_lsolve_upper_2(U, B, T, p);
n1 = (n + 1)/2;
......
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