(rontolisp) docs
← 関数

linalg:rand

(linalg:rand shape &optional element-type)

一様 [0, 1) の乱数で埋めた配列を返します (numpy の np.random.rand 相当ですが、shapelinalg:zeros と同じ shape designator で渡します。ベクタは整数、行列はリスト (rows cols))。element-type'single-float を渡すと packed single-float (#f) の結果になります。再現可能な列にするには、先に linalg:seed を呼んでください -- シード済みの列はすべてのバックエンドで bit-identical です。