up previous next
IsPositiveGrading

check if a matrix defines a positive grading

Syntax
IsPositiveGrading(M:MAT):BOOL
IsPositiveGrading(M:MAT,N:INT):BOOL

Description
This function determines whether a matrix defines a positive grading, i.e. foreach column the first nonnegative entry is positive.

Example
/**/  IsPositiveGrading(LexMat(5));
true

/**/  IsPositiveGrading(LexMat(5),3); --considering only the first three rows
false

/**/  IsPositiveGrading(mat([[0,2,3], [1, -1, 0]]));
true

/**/  IsPositiveGrading(mat([[1,1], [0,-1], [-1, 0]]));
true

See Also