Package ch.nolix.core.math.basic
Klasse GlobalBasicCalculator
java.lang.Object
ch.nolix.core.math.basic.GlobalBasicCalculator
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungstatic final doubleThe default maximum deviation is 10^-9. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic LinkedList<FloatingPointNumberPair> createFPNPairs(double[] xValues, double[] yValues) static booleanequalsApproximatively(double value1, double value2) static booleanequalsApproximatively(double value1, double value2, double maxDeviation) static doublegetAverage(double value, double... values) static intgetAverage(int value, int... values) static longgetAverage(long value, long... values) static doublegetAverage(Iterable<Double> values) static doublegetMax(double value, double... values) static intgetMax(int value, int... values) static longgetMax(long value, long... values) static doublegetMin(double value, double... values) static intgetMin(int value, int... values) static longgetMin(long value, long... values) static doublegetSquare(double value) static doublegetSquare(int value) static doublegetSquare(long value) static doublegetSum(double value, double... values) static intgetSum(int value, int... values) static longgetSum(long value, long... values) static doublestatic booleanisApproximatelyOne(double value) static booleanisApproximatelyOne(double value, double maxDeviation) static booleanisApproximatelyZero(double value) static booleanisApproximatelyZero(double value, double maxDeviation)
-
Felddetails
-
DEFAULT_MAX_DEVIATION
public static final double DEFAULT_MAX_DEVIATIONThe default maximum deviation is 10^-9.- Siehe auch:
-
-
Methodendetails
-
createFPNPairs
public static LinkedList<FloatingPointNumberPair> createFPNPairs(double[] xValues, double[] yValues) - Parameter:
xValues-yValues-- Gibt zurück:
- a new
LinkedListwithFloatingPointNumberPairs created from the given xValues and yValues. - Löst aus:
InvalidArgumentException- if the count of the given yValues does not equal the count of the given xValues.
-
equalsApproximatively
public static boolean equalsApproximatively(double value1, double value2) - Parameter:
value1-value2-- Gibt zurück:
- true if the given values equals approximately each other with a deviation that is not bigger than 1.0E-9.
-
equalsApproximatively
public static boolean equalsApproximatively(double value1, double value2, double maxDeviation) - Parameter:
value1-value2-maxDeviation-- Gibt zurück:
- true if the given values equals approximately each other with a deviation that is not bigger than the given maxDeviation.
- Löst aus:
NegativeArgumentException- if the given maxDeviation is negative.
-
getAverage
public static double getAverage(double value, double... values) - Parameter:
value-values-- Gibt zurück:
- the average of the given values.
-
getAverage
- Parameter:
values-- Gibt zurück:
- the average of the given values.
- Löst aus:
EmptyArgumentException- if the given values is empty.
-
getAverage
public static int getAverage(int value, int... values) - Parameter:
value-values-- Gibt zurück:
- the average of the given values.
-
getAverage
public static long getAverage(long value, long... values) - Parameter:
value-values-- Gibt zurück:
- the average of the given values.
-
getMax
public static double getMax(double value, double... values) - Parameter:
value-values-- Gibt zurück:
- the biggest value of the given values.
-
getMax
public static int getMax(int value, int... values) - Parameter:
value-values-- Gibt zurück:
- the biggest value of the given values.
-
getMax
public static long getMax(long value, long... values) - Parameter:
value-values-- Gibt zurück:
- the biggest value of the given values.
-
getMin
public static double getMin(double value, double... values) - Parameter:
value-values-- Gibt zurück:
- the smallest value of the given values.
-
getMin
public static int getMin(int value, int... values) - Parameter:
value-values-- Gibt zurück:
- the smallest value of the given values.
-
getMin
public static long getMin(long value, long... values) - Parameter:
value-values-- Gibt zurück:
- the smallest value of the given values.
-
getSquare
public static double getSquare(double value) - Parameter:
value-- Gibt zurück:
- the square of the given value.
-
getSquare
public static double getSquare(int value) - Parameter:
value-- Gibt zurück:
- the square of the given value.
-
getSquare
public static double getSquare(long value) - Parameter:
value-- Gibt zurück:
- the square of the given value.
-
getSum
public static double getSum(double value, double... values) - Parameter:
value-values-- Gibt zurück:
- the sum of the given values.
-
getSum
public static int getSum(int value, int... values) - Parameter:
value-values-- Gibt zurück:
- the sum of the given values.
-
getSum
- Parameter:
values-- Gibt zurück:
- the sum of the given values.
-
getSum
public static long getSum(long value, long... values) - Parameter:
value-values-- Gibt zurück:
- the sum of the given values.
-
isApproximatelyOne
public static boolean isApproximatelyOne(double value) - Parameter:
value-- Gibt zurück:
- true if the given value is approximately 1.0 with a deviation that is not bigger than 1.0E-9.
-
isApproximatelyOne
public static boolean isApproximatelyOne(double value, double maxDeviation) - Parameter:
value-maxDeviation-- Gibt zurück:
- true if the given value is approximately 1.0 with a deviation that is not bigger than the given maxDeviation.
- Löst aus:
NegativeArgumentException- if the given maxDeviation is negative.
-
isApproximatelyZero
public static boolean isApproximatelyZero(double value) - Parameter:
value-- Gibt zurück:
- true if the given value is approximately 0.0 with a deviation that is not bigger than 1.0E-9.
-
isApproximatelyZero
public static boolean isApproximatelyZero(double value, double maxDeviation) - Parameter:
value-maxDeviation-- Gibt zurück:
- true if the given value is approximately 0.0 with a deviation that is not bigger than the given maxDeviation.
- Löst aus:
NegativeArgumentException- if the given maxDeviation is negative.
-