private static ulong Ulong(XorShift1024RandomState state) { unchecked { fixed(ulong *sp = state.S) { var s0 = sp[state.P]; state.P = (state.P + 1) & 15; var s1 = sp[state.P]; s1 ^= s1 << 31; sp[state.P] = s1 ^ s0 ^ (s1 >> 11) ^ (s0 >> 30); return(sp[state.P] * 1181783497276652981UL); } } }
public XorShift1024Random(int seed) { _state = new XorShift1024RandomState(seed); }
public XorShift1024Random() { _state = null; }