use of org.apache.commons.math3.random.Well1024a in project incubator-systemml by apache.
the class MatrixBlock method randOperations.
/**
* Function to generate the random matrix with specified dimensions and block dimensions.
*
* @param rgen random matrix generator
* @param seed seed value
* @param k ?
* @return matrix block
* @throws DMLRuntimeException if DMLRuntimeException occurs
*/
public static MatrixBlock randOperations(RandomMatrixGenerator rgen, long seed, int k) throws DMLRuntimeException {
MatrixBlock out = new MatrixBlock();
Well1024a bigrand = null;
LongStream nnzInBlock = null;
//setup seeds and nnz per block
if (!LibMatrixDatagen.isShortcutRandOperation(rgen._min, rgen._max, rgen._sparsity, rgen._pdf)) {
bigrand = LibMatrixDatagen.setupSeedsForRand(seed);
nnzInBlock = LibMatrixDatagen.computeNNZperBlock(rgen._rows, rgen._cols, rgen._rowsPerBlock, rgen._colsPerBlock, rgen._sparsity);
}
//generate rand data
if (k > 1)
out.randOperationsInPlace(rgen, nnzInBlock, bigrand, -1, k);
else
out.randOperationsInPlace(rgen, nnzInBlock, bigrand, -1);
return out;
}
Aggregations