On Thursday, 27 February 2020 at 14:15:26 UTC, p.shkadzko wrote:
Is there a better way without relying on mir.ndslice?
ndslice Poker Face
/+dub.sdl:
dependency "mir-algorithm" version="~>3.7.17"
dependency "mir-random" version="~>2.2.10"
+/
import mir.ndslice;
import mir.random: threadLocal;
import mir.random.variable: uniformVar;
import mir.random.algorithm: randomSlice;
import mir.random.engine.xorshift;
void main() {
Slice!(int*, 2) m1 =
threadLocal!Xorshift.randomSlice(uniformVar!int(0, 10), [2, 3]);
Slice!(int*, 2) m2 =
threadLocal!Xorshift.randomSlice(uniformVar!int(0, 10), [2, 3]);
Slice!(int*, 2) c = slice(m1 + m2);
}