api / koma / rand

rand

fun rand(rows:Int, cols:Int):Matrix<Double>

Creates an matrix filled with unit uniform random numbers

fun <T> rand(rows:Int, cols:Int, dtype:MatrixType<T>):Matrix<T> fun <T> ~~rand~~(rows:Int, cols:Int, seed:Long, dtype:MatrixType<T>):Matrix<T> Deprecated: Call setSeed and randn separately

fun ~~rand~~(rows:Int, cols:Int, seed:Long):Matrix<Double> Deprecated: Call setSeed and randn separately

Creates an matrix filled with unit normal random numbers, using the given seed for the RNG. Subsequent calls with the same seed will produce identical numbers.