public void HaltonRationalPrimesTest() { var g = new Generator("HaltonRationalPrimesTest"); foreach (var item in Subrandom.HaltonR(3).Take(100)) { System.Diagnostics.Trace.WriteLine($"{item[0]}, {item[1]}, {item[2]}"); } }
public void HaltonDecimalTest() { var g = new Generator("HaltonDecimalTest"); foreach (var item in Subrandom.HaltonM(new[] { 2, 3 }).Take(100)) { System.Diagnostics.Trace.WriteLine($"{item[0]}, {item[1]}"); } }
public void HammersleyRationalPrimesTest() { var g = new Generator("HammersleyRationalPrimesTest"); foreach (var item in Subrandom.HammersleyR(2, 256)) { System.Diagnostics.Trace.WriteLine($"{item[0]}, {item[1]}"); } }
public void SobolRationalCodeTest() { var s = Subrandom.SobolR(13, 1, 1, 1, 3, 11); foreach (var item in s.Take(1000)) { System.Diagnostics.Trace.WriteLine(item); } }
public void SobolInitialValues(int max) { int d = 2; var g = new Generator("SobolInitialValue"); var v = new bool[max + 1][]; v[0] = new bool[max]; v[0][0] = true; foreach (var p in PolyGF2.GetAllPrimitive().Take(max - 1)) { v[d - 1] = new bool[max]; int s = p.Degree; var m = new int[s]; var V = new SquareMatrixGF2(d); while (true) { for (int i = 0; i < s; i++) { m[i] = g.Int32(2 << i) | 1; } var dv = Subrandom.SobolDirectionVectors(max, p, m); for (int i = 0; i < max; i++) { v[d - 1][i] = dv[i] > (ulong)long.MaxValue; } for (int row = 0; row < d; row++) { for (int col = 0; col < d; col++) { V[row, col] = v[row][col]; } } bool det = V.GetDeterminant(); if (det) { break; } } Trace.Write($"{d}\t{s}\t{p.GetCode() / 2 ^ (1UL << (s-1))}\t"); for (int i = 0; i < s; i++) { Trace.Write($"{m[i]} "); } Trace.WriteLine(""); d++; } }
public void SobolRationalTest() { var p = new PolyGF2(3, 1, 0); var m = new[] { 1, 3, 7 }; foreach (var item in Subrandom.SobolR(p, m).Take(1000)) { System.Diagnostics.Trace.WriteLine(item); } var g = new Generator("SobolRationalTest"); Test(g, () => Subrandom.SobolR(p, m)); }
public void AdditiveRecurrenceSZeroAlphaDecimalTest() { var g = new Generator("AdditiveRecurrenceSZeroAlphaDecimalTest"); Test(g, () => Subrandom.AdditiveRecurrence(g.Decimal(), g.Decimal())); }
public void AdditiveRecurrenceSingleTest() { var g = new Generator("AdditiveRecurrenceSingleTest"); Test(g, () => Subrandom.AdditiveRecurrenceF()); }
public void AdditiveRecurrenceGeneratorDoubleTest() { var g = new Generator("AdditiveRecurrenceGeneratorDoubleTest"); Test(g, () => Subrandom.AdditiveRecurrenceD(g)); }
public void AdditiveRecurrenceSZeroAlphaSingleTest() { var g = new Generator("AdditiveRecurrenceSZeroAlphaSingleTest"); Test(g, () => Subrandom.AdditiveRecurrence(g.Single(), g.Single())); }
public void AdditiveRecurrenceSZeroHighAlphaSingleTest() { Test(null, () => Subrandom.AdditiveRecurrence(1F, 0.5F)); }
public void VanDerCorputRationalBase3Test() { var g = new Generator("VanDerCorputRationalBase3Test"); Test(g, () => Subrandom.VanDerCorputR(3)); }
public void AdditiveRecurrenceHighSZeroDoubleTest() { Test(null, () => Subrandom.AdditiveRecurrence(0.5D, 1D)); }
public void VanDerCorputDecimalBase2Test() { var g = new Generator("VanDerCorputDecimalBase2Test"); Test(g, () => Subrandom.VanDerCorputM(2)); }
public void AdditiveRecurrenceNullGeneratorDoubleTest() { Test(null, () => Subrandom.AdditiveRecurrenceD((Generator)null)); }
public void AdditiveRecurrenceLowAlphaDoubleTest() { Test(null, () => Subrandom.AdditiveRecurrence(0D)); }
public void AdditiveRecurrenceLowAlphaDecimalTest() { Test(null, () => Subrandom.AdditiveRecurrence(0M)); }
public void AdditiveRecurrenceNullGeneratorDecimalTest() { Test(null, () => Subrandom.AdditiveRecurrenceM((Generator)null)); }
public void AdditiveRecurrenceDecimalTest() { var g = new Generator("AdditiveRecurrenceDecimalTest"); Test(g, () => Subrandom.AdditiveRecurrenceM()); }
public void VanDerCorputSingleBase3Test() { var g = new Generator("VanDerCorputSingleBase3Test"); Test(g, () => Subrandom.VanDerCorputF(3)); }
public void AdditiveRecurrenceHighSZeroSingleTest() { Test(null, () => Subrandom.AdditiveRecurrence(0.5F, 1F)); }
public void AdditiveRecurrenceAlphaDoubleTest() { var g = new Generator("AdditiveRecurrenceAlphaDoubleTest"); Test(g, () => Subrandom.AdditiveRecurrence(g.Double())); }
public void AdditiveRecurrenceSZeroHighAlphaDecimalTest() { Test(null, () => Subrandom.AdditiveRecurrence(1M, 0.5M)); }
public void AdditiveRecurrenceHighSZeroDecimalTest() { Test(null, () => Subrandom.AdditiveRecurrence(0.5M, 1M)); }
public void AdditiveRecurrenceSZeroHighAlphaDoubleTest() { Test(null, () => Subrandom.AdditiveRecurrence(1D, 0.5D)); }