Class Functions


  • public final class Functions
    extends java.lang.Object
    Provides utility methods which deal with functions.

    • 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 value scale.
        Parameters:
        function - the function to scale
        scale - 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 integrate
        start - the lower border of the integration
        end - 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 treat
        yLimit - UPPER limit, above which original values are omitted
        Returns:
        the cut function