up previous next
SB.TermRepr

Computes a representation of a term in other terms if it exists.
Syntax
          
SB.TermRepr(Term:POLY,TermList:LIST of POLY):LIST of INT
SB.TermRepr(Term:POLY,TermList:LIST of POLY,ReprType:INT):LIST of INT

          

Description
This functions tries to compute a term representation of the given term Term in terms of the list TermList. If it is not possible to get such a representation NULL will be returned. If a representation exists a list of integers will be returned which gives the exponents of the power product of the term in the other terms, e.g. for the term Term=x^2y and the list of terms TermList=[x,y] the function will return [2,1] as the representation.

With the optional parameter ReprType it is possible to choose between different ways of getting a possible representation. The following parameter is optional:

Example
Use R::=QQ[x,y];

SB.TermRepr(x^2y^2,[x,y]);
SB.TermRepr(x^2y^2,[xy^2,x,y]);

-------------------------------------------------------
-- output:

[2, 2]
-------------------------------
[1, 1, 0]
-------------------------------
-- Done.
-------------------------------


Example
Use R::=QQ[x,y,z];

L:=[x^2y^4z^8,xy^3,z^5];
SB.TermRepr(xy^4z,L); -- for xy^4z no representation is existing
T:=L[1]^3L[3]^2; -- T = (x^2y^4z^8)^3 * (xy^3)^0 * (z^5)^2
T;
SB.TermRepr(T,L);

-------------------------------------------------------
-- output:

NULL
-------------------------------
x^6y^12z^34
-------------------------------
[3, 0, 2]
-------------------------------
-- Done.
-------------------------------