Class DTestHelper


  • public abstract class DTestHelper
    extends java.lang.Object
    Creates double values for tests. Created: Tue Mar 20 01:05:54 2012
    Version:
    1.0
    Author:
    Ernst Reissner
    • Constructor Summary

      Constructors 
      Constructor Description
      DTestHelper()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static double createArgD​(boolean isSigned)  
      static double createArgD​(boolean isSigned, int exp0, int exp1)
      Returns a random number which is signed if demanded by isSigned and which ranges from the given exponents.
      static java.util.List<java.lang.Double> createMultArgsD​(boolean signed, boolean inRange, boolean allowsNaN)  
      static java.util.List<java.lang.Double> createMultArgsD​(int numArgs, boolean allowsSigned, boolean inRange, boolean allowsNaN)  
      static java.util.List<java.lang.Double> createMultArgsSumD​(boolean signed, boolean inRange)  
      static java.util.List<java.lang.Double> createMultArgsSumD​(int numArgs, boolean signed, boolean inRange)
      Returns a list of numArgs arguments as double values.
      private static int createNumArgs()  
      private static double createPower2()  
      (package private) static double random​(boolean signed)
      Returns a random number with absolute value in [0,1].
      • Methods inherited from class java.lang.Object

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

      • DTestHelper

        public DTestHelper()
    • Method Detail

      • random

        static double random​(boolean signed)
        Returns a random number with absolute value in [0,1].
        Parameters:
        signed - whether the number returned may be negative.
        Returns:
        a random number
        • in [-1,1] if signed.
        • in [ 0,1] if !signed.
      • createArgD

        public static double createArgD​(boolean isSigned)
      • createArgD

        public static double createArgD​(boolean isSigned,
                                        int exp0,
                                        int exp1)
        Returns a random number which is signed if demanded by isSigned and which ranges from the given exponents.
      • createMultArgsSumD

        public static java.util.List<java.lang.Double> createMultArgsSumD​(int numArgs,
                                                                          boolean signed,
                                                                          boolean inRange)
        Returns a list of numArgs arguments as double values. The sum of all numbers are restricted as specified by the parameters.
        Parameters:
        numArgs - the length of the argument list to be returned.
        signed - whether the arguments may be negative.
        inRange - whether the sum of the entries in the result List is in [0,1) or, if signed in (-1,1).
        Returns:
        a list of numArgs arguments as double values. The sum of all numbers is in [0,1) and for !signed even in [0.5,1). The entries are in [0,1) for !signed and in (-1,1) for signed.
      • createNumArgs

        private static int createNumArgs()
      • createMultArgsSumD

        public static java.util.List<java.lang.Double> createMultArgsSumD​(boolean signed,
                                                                          boolean inRange)
      • createMultArgsD

        public static java.util.List<java.lang.Double> createMultArgsD​(int numArgs,
                                                                       boolean allowsSigned,
                                                                       boolean inRange,
                                                                       boolean allowsNaN)
      • createPower2

        private static double createPower2()
      • createMultArgsD

        public static java.util.List<java.lang.Double> createMultArgsD​(boolean signed,
                                                                       boolean inRange,
                                                                       boolean allowsNaN)