Class DiehardInputGenerator


  • public final class DiehardInputGenerator
    extends java.lang.Object
    Utility to generate an input file for the DIEHARD suite of statistical tests for random number generators.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static int INT_COUNT  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void generateOutputFile​(java.util.Random rng, java.io.File outputFile)
      Generates a file of random data in a format suitable for the DIEHARD test.
      static void main​(java.lang.String[] args)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DiehardInputGenerator

        private DiehardInputGenerator()
    • Method Detail

      • main

        public static void main​(java.lang.String[] args)
                         throws java.lang.Exception
        Parameters:
        args - The first argument is the class name of the RNG, the second is the file to use for output.
        Throws:
        java.lang.Exception - If there are problems setting up the RNG or writing to the output file.
      • generateOutputFile

        public static void generateOutputFile​(java.util.Random rng,
                                              java.io.File outputFile)
                                       throws java.io.IOException
        Generates a file of random data in a format suitable for the DIEHARD test. DIEHARD requires 3 million 32-bit integers.
        Parameters:
        rng - The random number generator to use to generate the data.
        outputFile - The file that the random data is written to.
        Throws:
        java.io.IOException - If there is a problem writing to the file.