Package ch.nolix.core.math.main
Klasse Calculator
java.lang.Object
ch.nolix.core.math.main.Calculator
The
Calculator
provides mathematical functions.- Version:
- 2016-05-01
- Autor:
- Silvan Wyss
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic 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
-
Methodendetails
-
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.
-