Package ch.nolix.core.math.main
Klasse GlobalCalculator
java.lang.Object
ch.nolix.core.math.main.GlobalCalculator
The
GlobalCalculator
provides mathematical functions.- Version:
- 2016-05-01
- Autor:
- Silvan Wyss
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungstatic final double
The default maximum deviation is 10^-9. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic boolean
equalsApproximatively
(double value1, double value2) static boolean
equalsApproximatively
(double value1, double value2, double maxDeviation) static double
getAbsoluteDifference
(double value1, double value2) static int
getAbsoluteDifference
(int value1, int value2) static long
getAbsoluteDifference
(long value1, long value2) static double
getAbsoluteValue
(double value) The absolute value of a value x is -x if x is negative, x otherwise.static int
getAbsoluteValue
(int value) The absolute value of a value x is -x if x is negative, x otherwise.static long
getAbsoluteValue
(long value) The absolute value of a value x is -x if x is negative, x otherwise.static ARModel
getARModell
(int pOrder, double[] inputValues) 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 Polynom
getFittingPolynom
(int degree, double[] xValues, double[] yValues) 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
-
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.
-
getAbsoluteDifference
public static double getAbsoluteDifference(double value1, double value2) - Parameter:
value1
-value2
-- Gibt zurück:
- the absolute difference between the given 2 values.
-
getAbsoluteDifference
public static int getAbsoluteDifference(int value1, int value2) - Parameter:
value1
-value2
-- Gibt zurück:
- the absolute difference between the given 2 values.
-
getAbsoluteDifference
public static long getAbsoluteDifference(long value1, long value2) - Parameter:
value1
-value2
-- Gibt zurück:
- the absolute difference between the given 2 values.
-
getAbsoluteValue
public static double getAbsoluteValue(double value) The absolute value of a value x is -x if x is negative, x otherwise.- Parameter:
value
-- Gibt zurück:
- the absolute value of the given value.
-
getAbsoluteValue
public static int getAbsoluteValue(int value) The absolute value of a value x is -x if x is negative, x otherwise.- Parameter:
value
-- Gibt zurück:
- the absolute value of the given value.
-
getAbsoluteValue
public static long getAbsoluteValue(long value) The absolute value of a value x is -x if x is negative, x otherwise.- Parameter:
value
-- Gibt zurück:
- the absolute value of the given value.
-
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.
- Löst aus:
EmptyArgumentException
- if the given values is empty.
-
getARModell
- Parameter:
pOrder
-inputValues
-- Gibt zurück:
- a new
ARModel
with the given pOrder and inputValues. - Löst aus:
NegativeArgumentException
- if the given pOrder is negative.
-
getFittingPolynom
- Parameter:
degree
-xValues
-yValues
-- Gibt zurück:
- a new
Polynom
that has the given degree and fits the given values - Löst aus:
NegativeArgumentException
- if the given degree is negative.BiggerArgumentException
- if the given degree is bigger than the count of the given xValues.InvalidArgumentException
- if the count of the given yValues does not equal the count of the given xValues.
-
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.
-