Package dev.nm.misc
Class PrecisionUtils
- java.lang.Object
-
- dev.nm.misc.PrecisionUtils
-
public final class PrecisionUtils extends Object
Precision-related utility functions.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static double
autoEpsilon(double... inputs)
Guess a reasonable precision parameter.static double
autoEpsilon(double[]... inputs)
Guess a reasonable precision parameter.static double
autoEpsilon(MatrixTable A)
Guess a reasonable precision parameter.
-
-
-
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
-double
s- 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 ofdouble[]
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
-
-