| Michael Somos on Thu, 23 Jan 2003 14:59:05 -0500 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
| gp: gdeflate() on power series |
pari-dev,
I tried :
? subst(1+x^2+O(x^4),x^2,x)
*** incorrect type in gdeflate.
So I wrote :
/* subst(ex,v^n,v) */
{defl(ex,n)=local(v,po,de);
if(type(ex)==type([]),vector(length(ex),i,defl(ex[i],n)),
v=variable(ex);po=truncate(ex);de=(valuation(ex,v)+length(Vec(ex)))\n;
v*O(v^de)+subst(po,v^n,v));
} /* end defl() */
Is it possible to fix 'gdeflate()' so it work on power series?
Also, I used 'valuation(ex,v)+length(Vec(ex))' but I wonder if
there is a better way to get this information in gp. Shalom, Michael