|
4.20.2 vector expressions
A vector expression is:
-
an identifier of type vector
-
a function returning vector
-
a polynomial expression (via the canonical embedding
p ==> p*gen(1) )
-
vector expressions combined by the arithmetic operations
+ or
-
-
a polynomial expression and a vector expression combined by the arithmetic
operation
*
-
a type cast to vector using the brackets
[ , ]
Example:
| // ordering gives priority to components:
ring rr=0,(x,y,z),(c,dp);
vector v=[x2+y3,2,0,x*y]+gen(6)*x6;
v;
==> [y3+x2,2,0,xy,0,x6]
vector w=[z3-x,3y];
v-w;
==> [y3-z3+x2+x,-3y+2,0,xy,0,x6]
v*(z+x);
==> [xy3+y3z+x3+x2z,2x+2z,0,x2y+xyz,0,x7+x6z]
// ordering gives priority to monomials:
// this results in a different output
ring r=0,(x,y,z),(dp,c);
imap(rr,v);
==> x6*gen(6)+y3*gen(1)+x2*gen(1)+xy*gen(4)+2*gen(2)
|
See
Type conversion and casting;
ring.
|