CoCoA:FirstNonZeroPos

From ApCoCoAWiki
Revision as of 10:02, 24 October 2007 by XMLBot (talk | contribs) (pushing XML rev. 1.46, again)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

FirstNonZeroPos

the first non-zero entry in a vector

Description

This function returns the index of the first non-zero entry of V. If it

is handed a zero vector then an error is signalled.

Example

  Use R ::= Q[x,y,z];
  V := Vector(0,0,x^2+yz,0,z^2);
  FirstNonZero(V);
x^2 + yz
-------------------------------
  FirstNonZeroPos(V);
3
-------------------------------
  V[FirstNonZeroPos(V)];
x^2 + yz
-------------------------------

Syntax

FirstNonZero(V:VECTOR):POLY

NonZero

FirstNonZero

   <type>vector</type>