public static TimeSeries <T> Define <T>(Interval <T> domain, ulong[] seed) where T : struct { var id = NextId(ref LastSeriesId); var rng = Rng.XOrShift1024(seed); if (!States.TryAdd(id, rng)) { throw new Exception($"Key {id} already exists"); } return(new TimeSeries <T>(id, domain, Term(0, gmath.zero <T>()))); }
void TestBits() { var bits = Rng.XOrShift1024().ToPolyrand().Bits().Take(Pow2.T16); var on = 0; var off = 0; foreach (var bit in bits) { if (bit) { ++on; } else { ++off; } } var onPct = ((double)on) / ((double)on + (double)off); var offPct = ((double)off) / ((double)on + (double)off); print($"on = {onPct}, off={offPct}"); }
public TestContext(ITestConfig config = null, IPolyrand random = null) : base(random ?? Rng.XOrShift1024(Seed1024.TestSeed).ToPolyrand()) { this.Config = config ?? TestConfigDefaults.Default(); }
public AgentContext() : base(Rng.XOrShift1024(Seed1024.AppSeed).ToPolyrand()) { }
public void bench_xor1024_uniform_u64() { Benchmark(Rng.XOrShift1024().PointSource <ulong>()); }