Previous Up Next

11.1.6  Transforming a polynomial in internal format into a list and back

The convert command does many conversions (see Section 10.1.10). Among other things, it can convert between a polynomial in internal sparse multivariate format and a list representing the polynomial.

Examples

p:=symb2poly(x^2-x*y+2y,[x,y])
     
%%%{1,[2,0]%%%}+%%%{−1,[1,1]%%%}+%%%{2,[0,1]%%%}           
l:=convert(p,list)

or:

l:=convert(p)
     
⎡
⎢
⎢
⎢
⎢
⎢
⎣
    1
⎡
⎣
2,0⎤
⎦
−1
⎡
⎣
1,1⎤
⎦
2
⎡
⎣
0,1⎤
⎦
⎤
⎥
⎥
⎥
⎥
⎥
⎦
          

which is a list of the coefficients followed by a list of the variable powers.

convert(l,polynom)
     
%%%{1,[2,0]%%%}+%%%{−1,[1,1]%%%}+%%%{2,[0,1]%%%}           

Previous Up Next