CoCoA:NumComps

From ApCoCoAWiki

NumComps

the number of components of a vector

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
-------------------------------

Syntax

NumComps(X:VECTOR or MODULE):INT

Len

   <type>vector</type>