Algosim documentation: TrailingZeroRowCount

TrailingZeroRowCount

Returns the number of trailing zero rows in a matrix.

Syntax

Description

If A is a matrix then TrailingZeroRowCount(A) returns the number of trailing rows, in A, that contain only zeros (compared with epsilon ε).

Examples

A ≔ ❨❨5, 3, 2, 1, 4, 5, 2❩, ❨0, 0, 5, 3, 0, 0, 1❩, ❨0, 0, 0, 0, 0, 0, 0❩, ❨2, 3, 1, 4, 2, 2, 0❩, ❨0, 0, 0, 0, 0, 0, 0❩, ❨0, 0, 0, 0, 0, 0, 0❩❩
⎛5  3  2  1  4  5  2⎞
⎜0  0  5  3  0  0  1⎟
⎜0  0  0  0  0  0  0⎟
⎜2  3  1  4  2  2  0⎟
⎜0  0  0  0  0  0  0⎟
⎝0  0  0  0  0  0  0⎠
TrailingZeroRowCount(A)
2

See also