Édouard Gilbert on Thu, 22 Mar 2007 16:22:57 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Newbie question: lifting polynomials coefficient


Hi everyone,

Here is a simple problem that can be easliy avoided in a very unelegant way. The simple question is : how to lift the t_INTMOD coefficients of a t_POLMOD?

For example
 > P = Mod(Mod(1, 2)*X + Mod(1, 2), Mod(1, 2)*X^2 + Mod(1, 2))
% (...)
> lift(P)
% Mod(1, 2)*X + Mod(1, 2)

Of course, a workaround is

> lift(P, Y)
% Mod(X + 1, X^2 + 1)

which gives the expected results. But what if I want to lift such a polynomial in a function?
I''ve written the following:

> foo(poly, var = very_unlikly_variable) =
	{
		lift(poly, var)
	}
That way, the user can the variable he wants by switching the second argument i necessary, but this solution is very unelegant and there is the risk of seeing a var = very_unlikely_variable to appear in every function.

Is there a nicer solution to this?

Thanks for your help,

Édouard