示例#1
0
        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);
                }
            }
        }
示例#2
0
 public XorShift1024Random(int seed)
 {
     _state = new XorShift1024RandomState(seed);
 }
示例#3
0
 public XorShift1024Random()
 {
     _state = null;
 }