Package dev.nm.misc

Class PrecisionUtils


  • public final class PrecisionUtils
    extends Object
    Precision-related utility functions.
    • Method Detail

      • autoEpsilon

        public static double autoEpsilon​(double... inputs)
        Guess a reasonable precision parameter. In numerical computing, we often need to guess how small a number needs to be for it to be considered 0. Changing the threshold often changes the results, e.g., the numerical rank of a matrix.

        This method suggests a more 'objective' way to determine the 'correct' epsilon from the inputs. Roughly,

        auto ε = |max(inputs)| * sqrt(number of inputs) * machine ε * 10
        Parameters:
        inputs - doubles
        Returns:
        a precision parameter
      • autoEpsilon

        public static double autoEpsilon​(double[]... inputs)
        Guess a reasonable precision parameter. In numerical computing, we often need to guess how small a number needs to be for it to be considered 0. Changing the threshold often changes the results, e.g., the numerical rank of a matrix.

        This method suggests a more 'objective' way to determine the 'correct' epsilon from the inputs. Roughly,

        auto ε = |max(inputs)| * sqrt(number of inputs) * machine ε * 10
        Parameters:
        inputs - arrays of double[]s
        Returns:
        a precision parameter
      • autoEpsilon

        public static double autoEpsilon​(MatrixTable A)
        Guess a reasonable precision parameter. In numerical computing, we often need to guess how small a number needs to be for it to be considered 0. Changing the threshold often changes the results, e.g., the numerical rank of a matrix.

        This method suggests a more 'objective' way to determine the 'correct' epsilon from the inputs. Roughly,

        auto ε = |max(inputs)| * sqrt(number of inputs) * machine ε * 10
        Parameters:
        A - a matrix
        Returns:
        a precision parameter