public static void setRandomB(BMatrixRMaj mat , Random rand )
    {
        boolean d[] = mat.data;
        int size = mat.getNumElements();


        for( int i = 0; i < size; i++ ) {
            d[i] = rand.nextBoolean();
        }
    }
public static void setRandomB ( BMatrixRMaj mat , Random rand ) { boolean d [ ] = mat . data ; int size = mat . getNumElements ( ) ; for ( int i = 0 ; i < size ; i ++ ) { d [ i ] = rand . nextBoolean ( ) ; } }
<p>
Sets each element in the boolean matrix to true or false with equal probability
</p>

@param mat The matrix who is to be randomized. Modified.
@param rand Random number generator used to fill the matrix.