Package ch.nolix.core.math.basic
Klasse GlobalBasicCalculator
java.lang.Object
ch.nolix.core.math.basic.GlobalBasicCalculator
-
Feldübersicht
Modifizierer und TypFeldBeschreibungstatic final double
The default maximum deviation is 10^-9. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic LinkedList
<FloatingPointNumberPair> createFPNPairs
(double[] xValues, double[] yValues) static boolean
equalsApproximatively
(double value1, double value2) static boolean
equalsApproximatively
(double value1, double value2, double maxDeviation) static double
getAverage
(double value, double... values) static int
getAverage
(int value, int... values) static long
getAverage
(long value, long... values) static double
getAverage
(Iterable<Double> values) static double
getMax
(double value, double... values) static int
getMax
(int value, int... values) static long
getMax
(long value, long... values) static double
getMin
(double value, double... values) static int
getMin
(int value, int... values) static long
getMin
(long value, long... values) static double
getSquare
(double value) static double
getSquare
(int value) static double
getSquare
(long value) static double
getSum
(double value, double... values) static int
getSum
(int value, int... values) static long
getSum
(long value, long... values) static double
static boolean
isApproximatelyOne
(double value) static boolean
isApproximatelyOne
(double value, double maxDeviation) static boolean
isApproximatelyZero
(double value) static boolean
isApproximatelyZero
(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
LinkedList
withFloatingPointNumberPair
s 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.
-