Class Gen


  • public class Gen
    extends java.lang.Object
    Support for testing. May be generally useful
    • Constructor Summary

      Constructors 
      Constructor Description
      Gen()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int[] permute​(int[] x)
      Pull items out of the list in a random order
      static int[] rand​(int numRand, int low, int high)
      Generate a random sequence between low (inclusive) and high (exclusive): may include duplicates.
      static int[] rand​(int numRand, int low, int high, boolean allDifferent)
      Generate a random sequence between low (inclusive) and high (exclusive) - with duplicates or not
      static int[] shuffle​(int[] x, int num)
      Do a number of random pair-wise swaps
      static java.lang.String strings​(int[] keys)  
      • Methods inherited from class java.lang.Object

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

      • Gen

        public Gen()
    • Method Detail

      • rand

        public static int[] rand​(int numRand,
                                 int low,
                                 int high)
        Generate a random sequence between low (inclusive) and high (exclusive): may include duplicates.
      • rand

        public static int[] rand​(int numRand,
                                 int low,
                                 int high,
                                 boolean allDifferent)
        Generate a random sequence between low (inclusive) and high (exclusive) - with duplicates or not
      • permute

        public static int[] permute​(int[] x)
        Pull items out of the list in a random order
      • shuffle

        public static int[] shuffle​(int[] x,
                                    int num)
        Do a number of random pair-wise swaps
      • strings

        public static java.lang.String strings​(int[] keys)