Package org.tensorics.incubate.function
Class Functions
- java.lang.Object
-
- org.tensorics.incubate.function.Functions
-
public final class Functions extends java.lang.Object
Provides utility methods which deal with functions.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DiscreteFunction<java.lang.Double,java.lang.Double>
convertToDiscreteFunctionFrom(double[] times, double[] values)
static DiscreteFunction<java.lang.Double,java.lang.Double>
convertToDiscreteFunctionFrom(double[] times, double[] values, double[] errors)
static DiscreteFunction<java.lang.Double,java.lang.Double>
convertToDiscreteFunctionFrom(java.util.Map<java.lang.Double,java.lang.Double> map, java.lang.String name)
static DiscreteFunction<java.lang.Double,java.lang.Double>
createInterpolatedFunctionFromTwoPoints(double startPoint, double endPoint, double length)
static DiscreteFunction<java.lang.Double,java.lang.Double>
cutBeginingOfExp(DiscreteFunction<java.lang.Double,java.lang.Double> function, double yLimit)
Allows to get cut first part of ig exp decay if above limit.static DiscreteFunction<java.lang.Double,java.lang.Double>
emptyDiscreteFunction()
static java.util.List<java.lang.Double>
getXsIntersection(DiscreteFunction<java.lang.Double,?> first, DiscreteFunction<java.lang.Double,?> second)
static double
integrate(DiscreteFunction<java.lang.Double,java.lang.Double> function)
Performs numerical integral of given function within full range of given function.static double
integrate(DiscreteFunction<java.lang.Double,java.lang.Double> function, double start, double end)
performs numerical integral of given function within start and end values.static DiscreteFunction<java.lang.Double,java.lang.Double>
scaleFunction(DiscreteFunction<java.lang.Double,java.lang.Double> function, double scale)
Multiplies the Y values of the given function with the valuescale
.
-
-
-
Method Detail
-
convertToDiscreteFunctionFrom
public static DiscreteFunction<java.lang.Double,java.lang.Double> convertToDiscreteFunctionFrom(double[] times, double[] values)
-
getXsIntersection
public static java.util.List<java.lang.Double> getXsIntersection(DiscreteFunction<java.lang.Double,?> first, DiscreteFunction<java.lang.Double,?> second)
-
convertToDiscreteFunctionFrom
public static DiscreteFunction<java.lang.Double,java.lang.Double> convertToDiscreteFunctionFrom(double[] times, double[] values, double[] errors)
-
convertToDiscreteFunctionFrom
public static DiscreteFunction<java.lang.Double,java.lang.Double> convertToDiscreteFunctionFrom(java.util.Map<java.lang.Double,java.lang.Double> map, java.lang.String name)
-
emptyDiscreteFunction
public static DiscreteFunction<java.lang.Double,java.lang.Double> emptyDiscreteFunction()
-
createInterpolatedFunctionFromTwoPoints
public static DiscreteFunction<java.lang.Double,java.lang.Double> createInterpolatedFunctionFromTwoPoints(double startPoint, double endPoint, double length)
-
scaleFunction
public static DiscreteFunction<java.lang.Double,java.lang.Double> scaleFunction(DiscreteFunction<java.lang.Double,java.lang.Double> function, double scale)
Multiplies the Y values of the given function with the valuescale
.- Parameters:
function
- the function to scalescale
- the factor, by which to multiply the function Y values- Returns:
- the scaled function
-
integrate
public static double integrate(DiscreteFunction<java.lang.Double,java.lang.Double> function)
Performs numerical integral of given function within full range of given function. Simplest method of sum of dt*Y.- Parameters:
function
- the function to treat- Returns:
- the value of the numerical integral
-
integrate
public static double integrate(DiscreteFunction<java.lang.Double,java.lang.Double> function, double start, double end)
performs numerical integral of given function within start and end values. Simplest method of sum of dt*Y.- Parameters:
function
- the function to integratestart
- the lower border of the integrationend
- the upper border of the integration- Returns:
- the value calculated from the integration
-
cutBeginingOfExp
public static DiscreteFunction<java.lang.Double,java.lang.Double> cutBeginingOfExp(DiscreteFunction<java.lang.Double,java.lang.Double> function, double yLimit)
Allows to get cut first part of ig exp decay if above limit.- Parameters:
function
- function to treatyLimit
- UPPER limit, above which original values are omitted- Returns:
- the cut function
-
-