up previous next
NumComps

the number of components of a vector

Syntax
NumComps(X:VECTOR or MODULE):INT

Description
If X is a vector, this function returns the number of components of X; it gives the same result as Len(X). If X is a module, then this function returns the rank of the free module in which X is defined.

Example
Use R ::= Q[x,y];
NumComps(Vector(x,y,x^2+y^2,x^2-y^2));
4
-------------------------------
M := Module([x,y^2,2+x^2y],[x,0,y]);  -- a submodule of R^3 
NumComps(M);
3
-------------------------------
M.NumComps;  -- alternative syntax
3
------------------------------- 


See Also