up previous next
FirstNonZeroPosn

the first non-zero entry in a MODULEELEM

Syntax
FirstNonZeroPosn(V: MODULEELEM): RINGELEM

Description
This function returns the index of the first non-zero entry of V. If it is handed a zero MODULEELEM then an error is signalled.

Example
/**/  use R ::= QQ[x,y,z];
/**/  R5 := NewFreeModule(R,5);
/**/  V := ModuleElem(R5, [0, 0, x^2+y*z, 0, z^2]);

/**/  FirstNonZero(V);
x^2 +y*z

/**/  FirstNonZeroPosn(V);
2

See Also