/* Construction/Destruction */ public RandomDoubleGenerator(int megabytes) { int totalBytes = Mathematics.MegaBytesToBytes(megabytes); int structs = Mathematics.BytesToStructCount <Double>(totalBytes); Structs = new Double[structs]; for (int x = 0; x < structs; x++) { Structs[x] = (Double)NextRandom(Double.MinValue, Double.MaxValue); } Bytes = StructArray.GetBytes(Structs); }
/* Construction/Destruction */ public RandomInt32Generator(int megabytes) { int totalBytes = Mathematics.MegaBytesToBytes(megabytes); int structs = Mathematics.BytesToStructCount <Int32>(totalBytes); Structs = new Int32[structs]; for (int x = 0; x < structs; x++) { Structs[x] = (Int32)NextRandom(Int32.MinValue, Int32.MaxValue); } Bytes = StructArray.GetBytes(Structs); }
/* Construction/Destruction */ public RandomUInt64Generator(int megabytes) { int totalBytes = Mathematics.MegaBytesToBytes(megabytes); int structs = Mathematics.BytesToStructCount <UInt64>(totalBytes); Structs = new UInt64[structs]; for (int x = 0; x < structs; x++) { Structs[x] = (UInt64)NextRandom(UInt64.MinValue, UInt64.MaxValue); } Bytes = StructArray.GetBytes(Structs); }
/* Construction/Destruction */ public RandomIntStructGenerator(int megabytes) { int totalBytes = Mathematics.MegaBytesToBytes(megabytes); int structs = Mathematics.BytesToStructCount <RandomIntStruct>(totalBytes); Structs = new RandomIntStruct[structs]; for (int x = 0; x < structs; x++) { Structs[x] = RandomIntStruct.BuildRandomStruct(); } Bytes = StructArray.GetBytes(Structs); File.WriteAllBytes(TestFileName, Bytes); }
/* Construction/Destruction */ public RandomIntegerGenerator(int megabytes) { int totalBytes = Mathematics.MegaBytesToBytes(megabytes); int structs = Mathematics.BytesToStructCount <int>(totalBytes); Structs = new int[structs]; for (int x = 0; x < structs; x++) { Structs[x] = _random.Next(); } Bytes = StructArray.GetBytes(Structs); File.WriteAllBytes(TestFileName, Bytes); }