public static BMatrixRMaj elementLessThan ( DMatrixRMaj A , double value , BMatrixRMaj output ) { if ( output == null ) { output = new BMatrixRMaj ( A . numRows , A . numCols ) ; } output . reshape ( A . numRows , A . numCols ) ; int N = A . getNumElements ( ) ; for ( int i = 0 ; i < N ; i ++ ) { output . data [ i ] = A . data [ i ] < value ; } return output ; }
Applies the &gt ; operator to each element in A . Results are stored in a boolean matrix .