Matrix.random constructor

Matrix.random(
  1. int rowCount,
  2. int columnCount, {
  3. DType dtype = DType.float32,
  4. num min = -1000,
  5. num max = 1000,
  6. int? seed,
})

Returns randomly filled matrix of rowCountxcolumnCount dimension

Implementation

factory Matrix.random(int rowCount, int columnCount,
    {DType dtype = DType.float32,
    num min = -1000,
    num max = 1000,
    int? seed}) {
  switch (dtype) {
    case DType.float32:
      return Float32Matrix.random(dtype, rowCount, columnCount,
          min: min, max: max, seed: seed);

    case DType.float64:
      return Float64Matrix.random(dtype, rowCount, columnCount,
          min: min, max: max, seed: seed);

    default:
      throw UnimplementedMatrixException(dtype);
  }
}