randomArray2d function

Array2d randomArray2d(
  1. int rows,
  2. int columns
)

Generates an Array with n elements containing non-negative random floating point value uniformly distributed in the range from 0.0, inclusive, to 1.0, exclusive.

  • rows : number of rows
  • columns : number of columns

Examples

var x = randomArray2d(20, 20);

Implementation

Array2d randomArray2d(int rows, int columns) {
  var l = List.generate(columns, (_) => randomArray(rows));
  return Array2d(l);
}