Class DTestHelper


  • public abstract class DTestHelper
    extends Object
    To create double values for tests Created: Tue Mar 20 01:05:54 2012
    Version:
    1.0
    Author:
    Ernst Reissner
    • 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 List<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.
      • createMultArgsSumD

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

        public static List<Double> createMultArgsD​(int numArgs,
                                                   boolean allowsSigned,
                                                   boolean inRange,
                                                   boolean allowsNaN)
      • createMultArgsD

        public static List<Double> createMultArgsD​(boolean signed,
                                                   boolean inRange,
                                                   boolean allowsNaN)