Reading another programs syntax, it could be interesting implementing any(M,r), where M is a matrix and r a row (0 for the entire matrix), and the "inverse" function all; that's from matlab.
Actually I'm not very comfortable with the original matlab implementation.
First question could be which implementation is faster (I have my doubts, because vectorizacion is assumed to be faster that a for loop).
Second, which is symbollically evaluatable. To avoid using gthan or lthan symbols, could be using min(sign(Check))+1 (with vectorization over sign function), but this seems to not work with symbolic evaluation.
Regards. Alvaro.