Bill Allombert on Tue, 27 Apr 2004 12:32:27 +0200


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

Re: change variables in multivariant polynomials.


On Thu, Apr 22, 2004 at 02:12:29PM +0100, Thomas Geffers wrote:
> I am writing a program with gp with multivariant polynomials. Because of
> the order of the variables I would like to change all the variables from 
> the input-polynomials. But my way is not very elegant (and by the way does 
> not work very good;-).
> 
> ie:
> g=(u^4-4*u)*z^4 + u*z^2 -1;
> 
> variable(g) is now u. I get the other variable with 
> 
> variable(Vec(g));  \\ It gives the correct z.
> 
> My problem is, that I can not change this variable with changevar.
> I "solve" this problem with a loop with the following kernel:
> 
> Pol(Vec(g)[i],w)  \\ hence for each coefficient.

Usually the proper way to rename z to w in g is to do
subst(g,z,w).

changevar should never be used, it just does not work, it might
even be removed completly in the future.

Cheers,
Bill.