up previous next
eval

substitute numbers or polynomials for indeterminates

Syntax
eval(E: RINGELEM|MODULEELEM|LIST|MAT, L: LIST): OBJECT

Description
This function substitutes L[I] for indet(I) in the expression E which must be of type POLY, MODULEELEM, LIST, or MAT. The evaluation takes place in the ring of E . For more general substitutions use subst .

If len(L) is different from NumIndets() then only the first N substitutions are performed, where N is the minumum of the two values.

Example
/**/  Use QQ[x,y];
/**/  eval(x^2+y, [2, 3]);
7
/**/  eval(x^2+y, [2]);
y +4

/**/  F := x*(x-1)*(x-2)*y*(y-1)*(y-2)/36;
/**/  P := [1/2, -2/3];
/**/  eval(F, P);
-5/162
/**/  eval([x+y,x-y], [2,1]);
[3, 1]
/**/  eval([x+y,x-y], [x^2,y^2]);
[x^2 + y^2, x^2 - y^2]
/**/  eval([x+y,x-y], [y]);
[2*y, 0]

See Also