Package de.gsi.math

Class TMath

    • Constructor Summary

      Constructors 
      Constructor Description
      TMath()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static double BesselI​(int n, double x)  
      static double BesselI0​(double x)  
      static double BesselI1​(double x)  
      static double BesselJ0​(double x)  
      static double BesselJ1​(double x)  
      static double BesselK​(int n, double x)  
      static double BesselK0​(double x)  
      static double BesselK1​(double x)  
      static double BesselY0​(double x)  
      static double BesselY1​(double x)  
      static double Beta​(double p, double q)  
      static double BetaCf​(double x, double a, double b)  
      static double BetaDist​(double x, double p, double q)
      Computes the probability density function of the Beta distribution (the distribution function is computed in BetaDistI).
      static double BetaDistI​(double x, double p, double q)  
      static double BetaIncomplete​(double x, double a, double b)  
      static long BinarySearch​(double[] array, int length, double value)
      Binary search in an array of n values to locate value.
      static long BinarySearch​(float[] array, int length, float value)
      Binary search in an array of n values to locate value.
      static long BinarySearch​(int[] array, int length, int value)
      Binary search in an array of n values to locate value.
      static long BinarySearch​(long[] array, int length, long value)
      Binary search in an array of n values to locate value.
      static long BinarySearch​(short[] array, int length, short value)
      Binary search in an array of n values to locate value.
      static double Binomial​(int n, int k)  
      static double BinomialI​(double p, int n, int k)  
      static double BreitWigner​(double x, double mean, double gamma)
      Calculate a Breit Wigner function with mean and gamma.
      static double CauchyDist​(double x, double t, double s)
      Computes the density of Cauchy distribution at point x The Cauchy distribution, also called Lorentzian distribution, is a continuous distribution describing resonance behavior The mean and standard deviation of the Cauchy distribution are undefined.
      static double ChisquareQuantile​(double p, double ndf)
      Evaluate the quantiles of the chi-squared probability distribution function.
      static double CorrelationCoefficient​(double[] x, double[] y, double[] w)
      Calculate weighted correlation coefficient x y data and weights w as double
      static double Covariance​(double[] xx, double[] yy, double[] ww)
      calculated weighted covariance xx and yy with weights ww
      static double[] Cross​(double[] v1, double[] v2, double[] out)
      Calculate the Cross Product of two vectors:
      static float[] Cross​(float[] v1, float[] v2, float[] out)
      Calculate the Cross Product of two vectors:
      static double[] Difference​(double[] a, double[] b)  
      static double[] Difference​(double[] a, double[] b, int length)
      computes the difference between vectors
      static float[] Difference​(float[] a, float[] b)  
      static float[] Difference​(float[] a, float[] b, int length)
      computes the difference between vectors
      static int[] Difference​(int[] a, int[] b)  
      static int[] Difference​(int[] a, int[] b, int length)
      computes the difference between vectors
      static long[] Difference​(long[] a, long[] b)  
      static long[] Difference​(long[] a, long[] b, int length)
      computes the difference between vectors
      static short[] Difference​(short[] a, short[] b)  
      static short[] Difference​(short[] a, short[] b, int length)
      computes the difference between vectors
      static double DiLog​(double x)
      The DiLogarithm function Code translated by from CERNLIB DILOG function C332
      static double effectiveSampleNumber​(double[] ww)  
      static double Erf​(double x)
      Computation of the error function erf(x).
      static double Erfc​(double x)
      Compute the complementary error function erfc(x).
      static double ErfInverse​(double x)
      returns the inverse error function
      static double Factorial​(int n)
      Compute factorial(n).
      static double FDist​(double F, double N, double M)  
      static double FDistI​(double F, double N, double M)  
      static double Freq​(double x)
      Computation of the normal frequency function freq(x).
      static double GamCf​(double a, double x)
      Computation of the incomplete gamma function P(a,x) via its continued fraction representation.
      static double Gamma​(double z)
      Computation of gamma(z) for all z>0.
      static double Gamma​(double a, double x)
      Computation of the normalized lower incomplete gamma function P(a,x) as defined in the Handbook of Mathematical Functions by Abramowitz and Stegun, formula 6.5.1 on page 260 .
      static double GammaDist​(double x, double gamma, double mu, double beta)  
      static double GamSer​(double a, double x)
      Computation of the incomplete gamma function P(a,x) via its series representation.
      static double Gauss​(double x, double mean, double sigma, boolean norm)
      Calculate a Gaussian function with mean and sigma.
      static double GeometricMean​(double[] data)  
      static double GeometricMean​(double[] a, int length)
      geometric_mean = (\Prod_{i=0}^{n-1} \abs{a[i]})^{1/n}
      static float GeometricMean​(float[] data)  
      static float GeometricMean​(float[] a, int length)
      geometric_mean = (\Prod_{i=0}^{n-1} \abs{a[i]})^{1/n}
      static int GeometricMean​(int[] data)  
      static int GeometricMean​(int[] a, int length)
      geometric_mean = (\Prod_{i=0}^{n-1} \abs{a[i]})^{1/n}
      static long GeometricMean​(long[] data)  
      static long GeometricMean​(long[] a, int length)
      geometric_mean = (\Prod_{i=0}^{n-1} \abs{a[i]})^{1/n}
      static short GeometricMean​(short[] data)  
      static short GeometricMean​(short[] a, int length)
      geometric_mean = (\Prod_{i=0}^{n-1} \abs{a[i]})^{1/n}
      static boolean IsInside​(double xp, double yp, int np, double[] x, double[] y)
      Function which returns true if point xp,yp lies inside the polygon defined by the np points in arrays x and y, false otherwise NOTE that the polygon must be a closed polygon (1st and last point must be identical).
      static boolean IsInside​(float xp, float yp, int np, float[] x, float[] y)
      Function which returns true if point xp,yp lies inside the polygon defined by the np points in arrays x and y, false otherwise NOTE that the polygon must be a closed polygon (1st and last point must be identical).
      static boolean IsInside​(int xp, int yp, int np, int[] x, int[] y)
      Function which returns true if point xp,yp lies inside the polygon defined by the np points in arrays x and y, false otherwise NOTE that the polygon must be a closed polygon (1st and last point must be identical).
      double KolmogorovProb​(double z)
      Calculates the Kolmogorov distribution function, which gives the probability that Kolmogorov's test statistic will exceed the value z assuming the null hypothesis.
      double KolmogorovTest​(int na, double[] a, int nb, double[] b, java.lang.String option)  
      static double Landau​(double x, double mpv, double sigma, boolean norm)
      The LANDAU function with mpv(most probable value) and sigma.
      static double LandauI​(double x)  
      static double LaplaceDist​(double x, double alpha, double beta)  
      static double LaplaceDistI​(double x, double alpha, double beta)  
      static double LnGamma​(double z)
      Computation of ln[gamma(z)] for all z>0.
      static long LocationMaximum​(double[] a, int length)  
      static long LocationMaximum​(float[] a, int length)  
      static long LocationMaximum​(int[] a, int length)  
      static long LocationMaximum​(long[] a, int length)  
      static long LocationMinimum​(double[] a, int length)  
      static long LocationMinimum​(float[] a, int length)  
      static long LocationMinimum​(int[] a, int length)  
      static long LocationMinimum​(long[] a, int length)  
      static long LocationMinimum​(short[] a, int length)  
      static double LogNormal​(double x, double sigma, double theta, double m)
      Computes the density of LogNormal distribution at point x.
      static void main​(java.lang.String[] argv)  
      static double Maximum​(double[] data)  
      static double Maximum​(double[] data, int length)  
      static float Maximum​(float[] data)  
      static float Maximum​(float[] data, int length)  
      static int Maximum​(int[] data)  
      static int Maximum​(int[] data, int length)  
      static long Maximum​(long[] data)  
      static long Maximum​(long[] data, int length)  
      static short Maximum​(short[] data)  
      static short Maximum​(short[] data, int length)  
      static double Mean​(double[] data)  
      static double Mean​(double[] data, int length)  
      static float Mean​(float[] data)  
      static float Mean​(float[] data, int length)  
      static int Mean​(int[] data)  
      static int Mean​(int[] data, int length)  
      static long Mean​(long[] data)  
      static long Mean​(long[] data, int length)  
      static short Mean​(short[] data)  
      static short Mean​(short[] data, int length)  
      static double Median​(double[] data)  
      static double Median​(double[] data, int length)  
      static float Median​(float[] data)  
      static float Median​(float[] data, int length)  
      static int Median​(int[] data)  
      static int Median​(int[] data, int length)  
      static long Median​(long[] data)  
      static long Median​(long[] data, int length)  
      static short Median​(short[] data)  
      static short Median​(short[] data, int length)  
      static double Minimum​(double[] data)  
      static double Minimum​(double[] data, int length)  
      static float Minimum​(float[] data)  
      static float Minimum​(float[] data, int length)  
      static int Minimum​(int[] data)  
      static int Minimum​(int[] data, int length)  
      static long Minimum​(long[] data)  
      static long Minimum​(long[] data, int length)  
      static short Minimum​(short[] data)  
      static short Minimum​(short[] data, int length)  
      static double[] Normal2Plane​(double[] p1, double[] p2, double[] p3, double[] normal)
      Calculate a normal vector of a plane.
      static float[] Normal2Plane​(float[] p1, float[] p2, float[] p3, float[] normal)
      Calculate a normal vector of a plane.
      static double Normalize​(double[] v)
      Normalise a vector v in place.
      static float Normalize​(float[] v)
      Normalise a vector 'v' in place.
      static double NormCross​(double[] v1, double[] v2, double[] out)
      Calculate the Normalized Cross Product of two vectors
      static float NormCross​(float[] v1, float[] v2, float[] out)
      Calculate the Normalized Cross Product of two vectors
      static double NormQuantile​(double p)
      Computes quantiles for standard normal distribution N(0, 1) at probability p ALGORITHM AS241 APPL.
      static double PeakToPeak​(double[] data)  
      static double PeakToPeak​(double[] data, int length)  
      static float PeakToPeak​(float[] data)  
      static float PeakToPeak​(float[] data, int length)  
      static int PeakToPeak​(int[] data)  
      static int PeakToPeak​(int[] data, int length)  
      static long PeakToPeak​(long[] data)  
      static long PeakToPeak​(long[] data, int length)  
      static short PeakToPeak​(short[] data)  
      static short PeakToPeak​(short[] data, int length)  
      static boolean Permute​(int n, int[] a)
      Simple recursive algorithm to find the permutations of n natural numbers, not necessarily all distinct adapted from CERNLIB routine PERMU.
      static double Poisson​(double x, double par)
      compute the Poisson distribution function for (x,par) The Poisson PDF is implemented by means of Euler's Gamma-function (for the factorial), so for all integer arguments it is correct.
      static double PoissonI​(double x, double par)
      compute the Poisson distribution function for (x,par) This is a non-smooth function
      static double Prob​(double chi2, int ndf)
      Computation of the probability for a certain Chi-squared (chi2) and number of degrees of freedom (ndf).
      static double RMS​(double[] data)  
      static double RMS​(double[] data, int length)  
      static float RMS​(float[] data)  
      static float RMS​(float[] data, int length)  
      static int RMS​(int[] data)  
      static int RMS​(int[] data, int length)  
      static long RMS​(long[] data)  
      static long RMS​(long[] data, int length)  
      static short RMS​(short[] data)  
      static short RMS​(short[] data, int length)  
      boolean RootsCubic​(double[] coef, double[] roots)  
      static double Sinc​(double x, boolean norm)
      Calculate the sinc = sin(x)/x function if norm ==true then sinc = sinc(pi*x)/(pi*x) is used
      static double[] Sort​(double[] a, int length, boolean down)
      Sorts the input a array
      static float[] Sort​(float[] a, int length, boolean down)
      Sorts the input a array
      static int[] Sort​(int[] a, int length, boolean down)
      Sorts the input a array
      static long[] Sort​(long[] a, int length, boolean down)
      Sorts the input a array
      static short[] Sort​(short[] a, int length, boolean down)
      Sorts the input a array
      static double StruveH0​(double x)  
      static double StruveH1​(double x)  
      static double StruveL0​(double x)  
      static double StruveL1​(double x)  
      static double Student​(double T, double ndf)
      Computes density function for Student's t- distribution (the probability function (integral of density) is computed in StudentI).
      static double StudentI​(double T, double ndf)
      Calculates the cumulative distribution function of Student's t-distribution second parameter stands for number of degrees of freedom, not for the number of samples if x has Student's t-distribution, the function returns the probability of x being less than T.
      static double StudentQuantile​(double p, double ndf, boolean lower_tail)  
      static double[] Sum​(double[] a, double[] b)  
      static double[] Sum​(double[] a, double[] b, int length)
      computes the sum of vectors
      static float[] Sum​(float[] a, float[] b)  
      static float[] Sum​(float[] a, float[] b, int length)
      computes the sum of vectors
      static int[] Sum​(int[] a, int[] b)  
      static int[] Sum​(int[] a, int[] b, int length)
      computes the sum of vectors
      static long[] Sum​(long[] a, long[] b)  
      static long[] Sum​(long[] a, long[] b, int length)
      computes the sum of vectors
      static short[] Sum​(short[] a, short[] b)  
      static short[] Sum​(short[] a, short[] b, int length)
      computes the sum of vectors
      static double Variance​(double[] aa, double[] ww)  
      static double Vavilov​(double x, double kappa, double beta2)  
      protected static double VavilovDenEval​(double rlam, double[] AC, double[] HC, int itype)
      Internal function, called by Vavilov and VavilovSet
      static double VavilovI​(double x, double kappa, double beta2)  
      static void VavilovSet​(double rkappa, double beta2, boolean mode, double[] WCM, double[] AC, double[] HC, int[] itype, int[] npt)
      Internal function, called by Vavilov and VavilovI
      double Voigt​(double xx, double sigma, double lg, int r)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TMath

        public TMath()
    • Method Detail

      • KolmogorovProb

        public double KolmogorovProb​(double z)
        Calculates the Kolmogorov distribution function, which gives the probability that Kolmogorov's test statistic will exceed the value z assuming the null hypothesis. This gives a very powerful test for comparing two one-dimensional distributions. see, for example, Eadie et al, "statistocal Methods in Experimental Physics', pp 269-270). This function returns the confidence level for the null hypothesis, where: z = dn*sqrt(n), and dn is the maximum deviation between a hypothetical distribution function and an experimental distribution with n events NOTE: To compare two experimental distributions with m and n events, use z = sqrt(m*n/(m+n))*dn Accuracy: The function is far too accurate for any imaginable application. Probabilities less than 10^-15 are returned as zero. However, remember that the formula is only valid for "large" n. Theta function inversion formula is used for z <= 1 This function was translated by Rene Brun from PROBKL in CERNLIB.
        Parameters:
        z - input value
        Returns:
        the computed result
      • KolmogorovTest

        public double KolmogorovTest​(int na,
                                     double[] a,
                                     int nb,
                                     double[] b,
                                     java.lang.String option)
      • RootsCubic

        public boolean RootsCubic​(double[] coef,
                                  double[] roots)
      • Voigt

        public double Voigt​(double xx,
                            double sigma,
                            double lg,
                            int r)
      • BesselI

        public static double BesselI​(int n,
                                     double x)
      • BesselI0

        public static double BesselI0​(double x)
      • BesselI1

        public static double BesselI1​(double x)
      • BesselJ0

        public static double BesselJ0​(double x)
      • BesselJ1

        public static double BesselJ1​(double x)
      • BesselK

        public static double BesselK​(int n,
                                     double x)
      • BesselK0

        public static double BesselK0​(double x)
      • BesselK1

        public static double BesselK1​(double x)
      • BesselY0

        public static double BesselY0​(double x)
      • BesselY1

        public static double BesselY1​(double x)
      • Beta

        public static double Beta​(double p,
                                  double q)
      • BetaCf

        public static double BetaCf​(double x,
                                    double a,
                                    double b)
      • BetaDist

        public static double BetaDist​(double x,
                                      double p,
                                      double q)
        Computes the probability density function of the Beta distribution (the distribution function is computed in BetaDistI). The first argument is the point, where the function will be computed, second and third are the function parameters. Since the Beta distribution is bounded on both sides, it's often used to represent processes with natural lower and upper limits.
        Parameters:
        x - input value
        p - p parameter of beta function
        q - q parameter of beta function
        Returns:
        probability density function of the Beta distribution
      • BetaDistI

        public static double BetaDistI​(double x,
                                       double p,
                                       double q)
      • BetaIncomplete

        public static double BetaIncomplete​(double x,
                                            double a,
                                            double b)
      • BinarySearch

        public static long BinarySearch​(double[] array,
                                        int length,
                                        double value)
        Binary search in an array of n values to locate value. Array is supposed to be sorted prior to this call. If match is found, function returns position of element. If no match found, function gives nearest element smaller than value.
        Parameters:
        array - input vector
        length - <= data.length elements to be used
        value - to be searched
        Returns:
        index of found value, -1 otherwise
      • BinarySearch

        public static long BinarySearch​(float[] array,
                                        int length,
                                        float value)
        Binary search in an array of n values to locate value. Array is supposed to be sorted prior to this call. If match is found, function returns position of element. If no match found, function gives nearest element smaller than value.
        Parameters:
        array - input vector
        length - <= data.length elements to be used
        value - to be searched
        Returns:
        index of found value, -1 otherwise
      • BinarySearch

        public static long BinarySearch​(int[] array,
                                        int length,
                                        int value)
        Binary search in an array of n values to locate value. Array is supposed to be sorted prior to this call. If match is found, function returns position of element. If no match found, function gives nearest element smaller than value.
        Parameters:
        array - input vector
        length - <= data.length elements to be used
        value - to be searched
        Returns:
        index of found value, -1 otherwise
      • BinarySearch

        public static long BinarySearch​(long[] array,
                                        int length,
                                        long value)
        Binary search in an array of n values to locate value. Array is supposed to be sorted prior to this call. If match is found, function returns position of element. If no match found, function gives nearest element smaller than value.
        Parameters:
        array - input vector
        length - <= data.length elements to be used
        value - to be searched
        Returns:
        index of found value, -1 otherwise
      • BinarySearch

        public static long BinarySearch​(short[] array,
                                        int length,
                                        short value)
        Binary search in an array of n values to locate value. Array is supposed to be sorted prior to this call. If match is found, function returns position of element. If no match found, function gives nearest element smaller than value.
        Parameters:
        array - input vector
        length - <= data.length elements to be used
        value - to be searched
        Returns:
        index of found value, -1 otherwise
      • Binomial

        public static double Binomial​(int n,
                                      int k)
      • BinomialI

        public static double BinomialI​(double p,
                                       int n,
                                       int k)
      • BreitWigner

        public static double BreitWigner​(double x,
                                         double mean,
                                         double gamma)
        Calculate a Breit Wigner function with mean and gamma.
        Parameters:
        x - input parameter
        mean - centre of distribution
        gamma - width of distribution
        Returns:
        the computed result
      • CauchyDist

        public static double CauchyDist​(double x,
                                        double t,
                                        double s)
        Computes the density of Cauchy distribution at point x The Cauchy distribution, also called Lorentzian distribution, is a continuous distribution describing resonance behavior The mean and standard deviation of the Cauchy distribution are undefined. The practical meaning of this is that collecting 1,000 data points gives no more accurate an estimate of the mean and standard deviation than does a single point. The formula was taken from "Engineering Statistics Handbook" on site http://www.itl.nist.gov/div898/handbook/eda/section3/eda3663.htm Implementation by Anna Kreshuk.
        Parameters:
        x - input value
        t - the location parameter
        s - the scale parameter
        Returns:
        Cauchy distribution at point x
      • ChisquareQuantile

        public static double ChisquareQuantile​(double p,
                                               double ndf)
        Evaluate the quantiles of the chi-squared probability distribution function. Algorithm AS 91 Appl. Statist. (1975) Vol.24, P.35 implemented by Anna Kreshuk. Incorporates the suggested changes in AS R85 (vol.40(1), pp.233-5, 1991)
        Parameters:
        p - the probability value, at which the quantile is computed
        ndf - number of degrees of freedom
        Returns:
        quantiles of the chi-squared probability distribution
      • CorrelationCoefficient

        public static double CorrelationCoefficient​(double[] x,
                                                    double[] y,
                                                    double[] w)
        Calculate weighted correlation coefficient x y data and weights w as double
        Parameters:
        x - input vector 1
        y - input vector 2
        w - wheights weight vector
        Returns:
        weighted correlation coefficient
      • Covariance

        public static double Covariance​(double[] xx,
                                        double[] yy,
                                        double[] ww)
        calculated weighted covariance xx and yy with weights ww
        Parameters:
        xx - input vector 1
        yy - input vector 2
        ww - weights
        Returns:
        weighted covariance
      • Cross

        public static double[] Cross​(double[] v1,
                                     double[] v2,
                                     double[] out)
        Calculate the Cross Product of two vectors:
        Parameters:
        v1 - input vector1
        v2 - input vector2
        out - output vector
        Returns:
        out = [v1 x v2]
      • Cross

        public static float[] Cross​(float[] v1,
                                    float[] v2,
                                    float[] out)
        Calculate the Cross Product of two vectors:
        Parameters:
        v1 - input vector1
        v2 - input vector2
        out - output vector
        Returns:
        out = [v1 x v2]
      • Difference

        public static double[] Difference​(double[] a,
                                          double[] b)
      • Difference

        public static double[] Difference​(double[] a,
                                          double[] b,
                                          int length)
        computes the difference between vectors
        Parameters:
        a - input vector a
        b - input vector b
        length - minimum length to be taken into account
        Returns:
        ret[] = a[] - b[]
      • Difference

        public static float[] Difference​(float[] a,
                                         float[] b)
      • Difference

        public static float[] Difference​(float[] a,
                                         float[] b,
                                         int length)
        computes the difference between vectors
        Parameters:
        a - input vector a
        b - input vector b
        length - minimum length to be taken into account
        Returns:
        ret[] = a[] - b[]
      • Difference

        public static int[] Difference​(int[] a,
                                       int[] b)
      • Difference

        public static int[] Difference​(int[] a,
                                       int[] b,
                                       int length)
        computes the difference between vectors
        Parameters:
        a - input vector a
        b - input vector b
        length - minimum length to be taken into account
        Returns:
        ret[] = a[] - b[]
      • Difference

        public static long[] Difference​(long[] a,
                                        long[] b)
      • Difference

        public static long[] Difference​(long[] a,
                                        long[] b,
                                        int length)
        computes the difference between vectors
        Parameters:
        a - input vector a
        b - input vector b
        length - minimum length to be taken into account
        Returns:
        ret[] = a[] - b[]
      • Difference

        public static short[] Difference​(short[] a,
                                         short[] b)
      • Difference

        public static short[] Difference​(short[] a,
                                         short[] b,
                                         int length)
        computes the difference between vectors
        Parameters:
        a - input vector a
        b - input vector b
        length - minimum length to be taken into account
        Returns:
        ret[] = a[] - b[]
      • DiLog

        public static double DiLog​(double x)
        The DiLogarithm function Code translated by from CERNLIB DILOG function C332
        Parameters:
        x - input
        Returns:
        the computed result
      • effectiveSampleNumber

        public static double effectiveSampleNumber​(double[] ww)
      • Erf

        public static double Erf​(double x)
        Computation of the error function erf(x). Erf(x) = (2/sqrt(pi)) Integral(exp(-t^2))dt between 0 and x --- NvE 14-nov-1998 UU-SAP Utrecht
        Parameters:
        x - input
        Returns:
        the computed result
      • Erfc

        public static double Erfc​(double x)
        Compute the complementary error function erfc(x). Erfc(x) = (2/sqrt(pi)) Integral(exp(-t^2))dt between x and infinity Nve 14-nov-1998 UU-SAP Utrecht
        Parameters:
        x - input parameter
        Returns:
        the computed result
      • ErfInverse

        public static double ErfInverse​(double x)
        returns the inverse error function
        Parameters:
        x - must be <-1<x<1
        Returns:
        the computed result
      • Factorial

        public static double Factorial​(int n)
        Compute factorial(n).
        Parameters:
        n - input parameter
        Returns:
        the computed result
      • FDist

        public static double FDist​(double F,
                                   double N,
                                   double M)
      • FDistI

        public static double FDistI​(double F,
                                    double N,
                                    double M)
      • Freq

        public static double Freq​(double x)
        Computation of the normal frequency function freq(x). Freq(x) = (1/sqrt(2pi)) Integral(exp(-t^2/2))dt between -infinity and x. Translated from CERNLIB C300 by Rene Brun.
        Parameters:
        x - input parameter
        Returns:
        the computed result
      • GamCf

        public static double GamCf​(double a,
                                   double x)
        Computation of the incomplete gamma function P(a,x) via its continued fraction representation. --- Nve 14-nov-1998 UU-SAP Utrecht
        Parameters:
        a - input parameter
        x - input parameter
        Returns:
        the computed result
      • Gamma

        public static double Gamma​(double z)
        Computation of gamma(z) for all z>0. C.Lanczos, SIAM Journal of Numerical Analysis B1 (1964), 86. --- Nve 14-nov-1998 UU-SAP Utrecht
        Parameters:
        z - input parameter
        Returns:
        gamma(z)
      • Gamma

        public static double Gamma​(double a,
                                   double x)
        Computation of the normalized lower incomplete gamma function P(a,x) as defined in the Handbook of Mathematical Functions by Abramowitz and Stegun, formula 6.5.1 on page 260 . Its normalization is such that Gamma(a,+infinity) = 1 . Begin_Latex P(a, x) = #frac{1}{#Gamma(a) } #int_{0}^{x} t^{a-1} e^{-t} dt End_Latex --- Nve 14-nov-1998 UU-SAP Utrecht
        Parameters:
        a - input parameter
        x - input parameter
        Returns:
        the computed result
      • GammaDist

        public static double GammaDist​(double x,
                                       double gamma,
                                       double mu,
                                       double beta)
      • GamSer

        public static double GamSer​(double a,
                                    double x)
        Computation of the incomplete gamma function P(a,x) via its series representation. --- Nve 14-nov-1998 UU-SAP Utrecht
        Parameters:
        a - input parameter
        x - input parameter
        Returns:
        the computed result
      • Gauss

        public static double Gauss​(double x,
                                   double mean,
                                   double sigma,
                                   boolean norm)
        Calculate a Gaussian function with mean and sigma. If norm=true (default is false) the result is divided by sqrt(2*Pi)*sigma.
        Parameters:
        x - input parameter
        mean - centre of distribution
        sigma - width of distribution
        norm - normalisation factor
        Returns:
        the computed result
      • GeometricMean

        public static double GeometricMean​(double[] a,
                                           int length)
        geometric_mean = (\Prod_{i=0}^{n-1} \abs{a[i]})^{1/n}
        Parameters:
        a - input vector
        length - <= data.length elements to be used
        Returns:
        geometric mean of an array a with length n.
      • GeometricMean

        public static double GeometricMean​(double[] data)
      • GeometricMean

        public static float GeometricMean​(float[] a,
                                          int length)
        geometric_mean = (\Prod_{i=0}^{n-1} \abs{a[i]})^{1/n}
        Parameters:
        a - input vector
        length - <= data.length elements to be used
        Returns:
        geometric mean of an array a with length n.
      • GeometricMean

        public static float GeometricMean​(float[] data)
      • GeometricMean

        public static int GeometricMean​(int[] a,
                                        int length)
        geometric_mean = (\Prod_{i=0}^{n-1} \abs{a[i]})^{1/n}
        Parameters:
        a - input vector
        length - <= data.length elements to be used
        Returns:
        geometric mean of an array a with length n.
      • GeometricMean

        public static int GeometricMean​(int[] data)
      • GeometricMean

        public static long GeometricMean​(long[] a,
                                         int length)
        geometric_mean = (\Prod_{i=0}^{n-1} \abs{a[i]})^{1/n}
        Parameters:
        a - input vector
        length - <= data.length elements to be used
        Returns:
        geometric mean of an array a with length n.
      • GeometricMean

        public static long GeometricMean​(long[] data)
      • GeometricMean

        public static short GeometricMean​(short[] a,
                                          int length)
        geometric_mean = (\Prod_{i=0}^{n-1} \abs{a[i]})^{1/n}
        Parameters:
        a - input vector
        length - <= data.length elements to be used
        Returns:
        geometric mean of an array a with length n.
      • GeometricMean

        public static short GeometricMean​(short[] data)
      • IsInside

        public static boolean IsInside​(double xp,
                                       double yp,
                                       int np,
                                       double[] x,
                                       double[] y)
        Function which returns true if point xp,yp lies inside the polygon defined by the np points in arrays x and y, false otherwise NOTE that the polygon must be a closed polygon (1st and last point must be identical).
        Parameters:
        xp - test point coordinate x
        yp - test point coordinate y
        np - number of polygon edges
        x - x coordinates of polygon
        y - y coordinates of polygon
        Returns:
        true if point xp,yp lies inside
      • IsInside

        public static boolean IsInside​(float xp,
                                       float yp,
                                       int np,
                                       float[] x,
                                       float[] y)
        Function which returns true if point xp,yp lies inside the polygon defined by the np points in arrays x and y, false otherwise NOTE that the polygon must be a closed polygon (1st and last point must be identical).
        Parameters:
        xp - test point coordinate x
        yp - test point coordinate y
        np - number of polygon edges
        x - x coordinates of polygon
        y - y coordinates of polygon
        Returns:
        true if point xp, yp lies inside the polygon defined
      • IsInside

        public static boolean IsInside​(int xp,
                                       int yp,
                                       int np,
                                       int[] x,
                                       int[] y)
        Function which returns true if point xp,yp lies inside the polygon defined by the np points in arrays x and y, false otherwise NOTE that the polygon must be a closed polygon (1st and last point must be identical).
        Parameters:
        xp - test point coordinate x
        yp - test point coordinate y
        np - number of polygon edges
        x - x coordinates of polygon
        y - y coordinates of polygon
        Returns:
        true if point xp, yp lies inside the polygon defined
      • Landau

        public static double Landau​(double x,
                                    double mpv,
                                    double sigma,
                                    boolean norm)
        The LANDAU function with mpv(most probable value) and sigma. This function has been adapted from the CERNLIB routine G110 denlan. If norm=true (default is false) the result is divided by sigma
        Parameters:
        x - input variable
        mpv - most probable value
        sigma - width of distribution
        norm - normalisation of distribution
        Returns:
        the computed result
      • LandauI

        public static double LandauI​(double x)
      • LaplaceDist

        public static double LaplaceDist​(double x,
                                         double alpha,
                                         double beta)
      • LaplaceDistI

        public static double LaplaceDistI​(double x,
                                          double alpha,
                                          double beta)
      • LnGamma

        public static double LnGamma​(double z)
        Computation of ln[gamma(z)] for all z>0. C.Lanczos, SIAM Journal of Numerical Analysis B1 (1964), 86 The accuracy of the result is better than 2e-10. --- Nve 14-nov-1998 UU-SAP Utrecht
        Parameters:
        z - input paramater
        Returns:
        ln[gamma(z)]
      • LocationMaximum

        public static long LocationMaximum​(double[] a,
                                           int length)
        Parameters:
        a - input vector
        length - <= data.length elements to be used
        Returns:
        index of array with the minimum element. If more than one element is minimum returns first found.
      • LocationMaximum

        public static long LocationMaximum​(float[] a,
                                           int length)
        Parameters:
        a - input vector
        length - <= data.length elements to be used
        Returns:
        index of array with the minimum element. If more than one element is minimum returns first found.
      • LocationMaximum

        public static long LocationMaximum​(int[] a,
                                           int length)
        Parameters:
        a - input vector
        length - <= data.length elements to be used
        Returns:
        index of array with the minimum element. If more than one element is minimum returns first found.
      • LocationMaximum

        public static long LocationMaximum​(long[] a,
                                           int length)
        Parameters:
        a - input vector
        length - <= data.length elements to be used
        Returns:
        index of array with the minimum element. If more than one element is minimum returns first found.
      • LocationMinimum

        public static long LocationMinimum​(double[] a,
                                           int length)
        Parameters:
        a - input vector
        length - <= data.length elements to be used
        Returns:
        index of array with the minimum element. If more than one element is minimum returns first found.
      • LocationMinimum

        public static long LocationMinimum​(float[] a,
                                           int length)
        Parameters:
        a - input vector
        length - <= data.length elements to be used
        Returns:
        index of array with the minimum element. If more than one element is minimum returns first found.
      • LocationMinimum

        public static long LocationMinimum​(int[] a,
                                           int length)
        Parameters:
        a - input vector
        length - <= data.length elements to be used
        Returns:
        index of array with the minimum element. If more than one element is minimum returns first found.
      • LocationMinimum

        public static long LocationMinimum​(long[] a,
                                           int length)
        Parameters:
        a - input vector
        length - <= data.length elements to be used
        Returns:
        index of array with the minimum element. If more than one element is minimum returns first found.
      • LocationMinimum

        public static long LocationMinimum​(short[] a,
                                           int length)
        Parameters:
        a - input vector
        length - <= data.length elements to be used
        Returns:
        index of array with the minimum element. If more than one element is minimum returns first found.
      • LogNormal

        public static double LogNormal​(double x,
                                       double sigma,
                                       double theta,
                                       double m)
        Computes the density of LogNormal distribution at point x. Variable X has lognormal distribution if Y=Ln(X) has normal distribution. The formula was taken from "Engineering Statistics Handbook" on site http://www.itl.nist.gov/div898/handbook/eda/section3/eda3669.htm Implementation by Anna Kreshuk.
        Parameters:
        x - input value
        sigma - the shape parameter
        theta - the location parameter
        m - the scale parameter
        Returns:
        density of LogNormal distribution at point x
      • main

        public static void main​(java.lang.String[] argv)
      • Maximum

        public static double Maximum​(double[] data)
      • Maximum

        public static double Maximum​(double[] data,
                                     int length)
        Parameters:
        data - the input vector
        length - <= data.length elements to be used
        Returns:
        value of largest vector element
      • Maximum

        public static float Maximum​(float[] data)
      • Maximum

        public static float Maximum​(float[] data,
                                    int length)
        Parameters:
        data - the input vector
        length - <= data.length elements to be used
        Returns:
        value of largest vector element
      • Maximum

        public static int Maximum​(int[] data)
      • Maximum

        public static int Maximum​(int[] data,
                                  int length)
        Parameters:
        data - the input vector
        length - <= data.length elements to be used
        Returns:
        value of largest vector element
      • Maximum

        public static long Maximum​(long[] data)
      • Maximum

        public static long Maximum​(long[] data,
                                   int length)
        Parameters:
        data - the input vector
        length - <= data.length elements to be used
        Returns:
        value of largest vector element
      • Maximum

        public static short Maximum​(short[] data)
      • Maximum

        public static short Maximum​(short[] data,
                                    int length)
        Parameters:
        data - the input vector
        length - <= data.length elements to be used
        Returns:
        value of largest vector element
      • Mean

        public static double Mean​(double[] data)
      • Mean

        public static double Mean​(double[] data,
                                  int length)
        Parameters:
        data - the input vector
        length - <= data.length elements to be used
        Returns:
        average of vector elements
      • Mean

        public static float Mean​(float[] data)
      • Mean

        public static float Mean​(float[] data,
                                 int length)
        Parameters:
        data - the input vector
        length - of the input vector
        Returns:
        average of vector elements
      • Mean

        public static int Mean​(int[] data)
      • Mean

        public static int Mean​(int[] data,
                               int length)
        Parameters:
        data - the input vector
        length - of the input vector
        Returns:
        average of vector elements
      • Mean

        public static long Mean​(long[] data)
      • Mean

        public static long Mean​(long[] data,
                                int length)
        Parameters:
        data - the input vector
        length - <= data.length elements to be used
        Returns:
        average of vector elements
      • Mean

        public static short Mean​(short[] data)
      • Mean

        public static short Mean​(short[] data,
                                 int length)
        Parameters:
        data - the input vector
        length - of the input vector
        Returns:
        average of vector elements
      • Median

        public static double Median​(double[] data)
      • Median

        public static double Median​(double[] data,
                                    int length)
        Parameters:
        data - the input vector
        length - <= data.length elements to be used
        Returns:
        median value of vector element
      • Median

        public static float Median​(float[] data)
      • Median

        public static float Median​(float[] data,
                                   int length)
        Parameters:
        data - the input vector
        length - <= data.length elements to be used
        Returns:
        median value of vector element
      • Median

        public static int Median​(int[] data)
      • Median

        public static int Median​(int[] data,
                                 int length)
        Parameters:
        data - the input vector
        length - <= data.length elements to be used
        Returns:
        median value of vector element
      • Median

        public static long Median​(long[] data)
      • Median

        public static long Median​(long[] data,
                                  int length)
        Parameters:
        data - the input vector
        length - <= data.length elements to be used
        Returns:
        median value of vector element
      • Median

        public static short Median​(short[] data)
      • Median

        public static short Median​(short[] data,
                                   int length)
        Parameters:
        data - the input vector
        length - <= data.length elements to be used
        Returns:
        median value of vector element
      • Minimum

        public static double Minimum​(double[] data)
      • Minimum

        public static double Minimum​(double[] data,
                                     int length)
        Parameters:
        data - the input vector
        length - <= data.length elements to be used
        Returns:
        value of smallest vector element
      • Minimum

        public static float Minimum​(float[] data)
      • Minimum

        public static float Minimum​(float[] data,
                                    int length)
        Parameters:
        data - the input vector
        length - <= data.length elements to be used
        Returns:
        value of smallest vector element
      • Minimum

        public static int Minimum​(int[] data)
      • Minimum

        public static int Minimum​(int[] data,
                                  int length)
        Parameters:
        data - the input vector
        length - <= data.length elements to be used
        Returns:
        value of smallest vector element
      • Minimum

        public static long Minimum​(long[] data)
      • Minimum

        public static long Minimum​(long[] data,
                                   int length)
        Parameters:
        data - the input vector
        length - <= data.length elements to be used
        Returns:
        value of smallest vector element
      • Minimum

        public static short Minimum​(short[] data)
      • Minimum

        public static short Minimum​(short[] data,
                                    int length)
        Parameters:
        data - the input vector
        length - <= data.length elements to be used
        Returns:
        value of smallest vector element
      • Normal2Plane

        public static double[] Normal2Plane​(double[] p1,
                                            double[] p2,
                                            double[] p3,
                                            double[] normal)
        Calculate a normal vector of a plane.
        Parameters:
        p1 - first 3D points belonged the plane to define it.
        p2 - second 3D points belonged the plane to define it.
        p3 - third 3D points belonged the plane to define it.
        normal - Pointer to 3D normal vector (normalised)
        Returns:
        the computed result
      • Normal2Plane

        public static float[] Normal2Plane​(float[] p1,
                                           float[] p2,
                                           float[] p3,
                                           float[] normal)
        Calculate a normal vector of a plane.
        Parameters:
        p1 - first 3D points belonged the plane to define it.
        p2 - second 3D points belonged the plane to define it.
        p3 - third 3D points belonged the plane to define it.
        normal - Pointer to 3D normal vector (normalised)
        Returns:
        the computed result
      • Normalize

        public static double Normalize​(double[] v)
        Normalise a vector v in place. Returns the norm of the original vector. This implementation (thanks Kevin Lynch <krlynch@bu.edu>) is protected against possible overflows. Find the largest element, and divide that one out.
        Parameters:
        v - input parameter vector
        Returns:
        the computed result
      • Normalize

        public static float Normalize​(float[] v)
        Normalise a vector 'v' in place.
        Parameters:
        v - input parameter vector
        Returns:
        the computed result the norm of the original vector.
      • NormCross

        public static double NormCross​(double[] v1,
                                       double[] v2,
                                       double[] out)
        Calculate the Normalized Cross Product of two vectors
        Parameters:
        v1 - input vector1
        v2 - input vector2
        out - output vector
        Returns:
        the computed result
      • NormCross

        public static float NormCross​(float[] v1,
                                      float[] v2,
                                      float[] out)
        Calculate the Normalized Cross Product of two vectors
        Parameters:
        v1 - input vector1
        v2 - input vector2
        out - output vector
        Returns:
        the computed result
      • NormQuantile

        public static double NormQuantile​(double p)
        Computes quantiles for standard normal distribution N(0, 1) at probability p ALGORITHM AS241 APPL. STATIST. (1988) VOL. 37, NO. 3, 477-484.
        Parameters:
        p - input value
        Returns:
        quantiles for standard normal distribution N(0, 1) at probability p
      • PeakToPeak

        public static double PeakToPeak​(double[] data)
      • PeakToPeak

        public static double PeakToPeak​(double[] data,
                                        int length)
        Parameters:
        data - the input vector
        length - <= data.length elements to be used
        Returns:
        peak-to-peak value of vector element
      • PeakToPeak

        public static float PeakToPeak​(float[] data)
      • PeakToPeak

        public static float PeakToPeak​(float[] data,
                                       int length)
        Parameters:
        data - the input vector
        length - <= data.length elements to be used
        Returns:
        peak-to-peak value of vector element
      • PeakToPeak

        public static int PeakToPeak​(int[] data)
      • PeakToPeak

        public static int PeakToPeak​(int[] data,
                                     int length)
        Parameters:
        data - the input vector
        length - <= data.length elements to be used
        Returns:
        peak-to-peak value of vector element
      • PeakToPeak

        public static long PeakToPeak​(long[] data)
      • PeakToPeak

        public static long PeakToPeak​(long[] data,
                                      int length)
        Parameters:
        data - the input vector
        length - <= data.length elements to be used
        Returns:
        peak-to-peak value of vector element
      • PeakToPeak

        public static short PeakToPeak​(short[] data)
      • PeakToPeak

        public static short PeakToPeak​(short[] data,
                                       int length)
        Parameters:
        data - the input vector
        length - <= data.length elements to be used
        Returns:
        peak-to-peak value of vector element
      • Permute

        public static boolean Permute​(int n,
                                      int[] a)
        Simple recursive algorithm to find the permutations of n natural numbers, not necessarily all distinct adapted from CERNLIB routine PERMU. The input array has to be initialised with a non descending sequence. The method returns false when all combinations are exhausted.
        Parameters:
        n - size of input vector
        a - input vector
        Returns:
        false when all combinations are exhausted
      • Poisson

        public static double Poisson​(double x,
                                     double par)
        compute the Poisson distribution function for (x,par) The Poisson PDF is implemented by means of Euler's Gamma-function (for the factorial), so for all integer arguments it is correct. BUT for non-integer values it IS NOT equal to the Poisson distribution. see PoissonI to get a non-smooth function. Note that for large values of par, it is better to call Gaus(x,par,sqrt(par),true) Begin_Html
        Parameters:
        x - input value
        par - input parameter
        Returns:
        the computed result
      • PoissonI

        public static double PoissonI​(double x,
                                      double par)
        compute the Poisson distribution function for (x,par) This is a non-smooth function
        Parameters:
        x - input value
        par - input parameter
        Returns:
        the computed result
      • Prob

        public static double Prob​(double chi2,
                                  int ndf)
        Computation of the probability for a certain Chi-squared (chi2) and number of degrees of freedom (ndf). Calculations are based on the incomplete gamma function P(a,x), where a=ndf/2 and x=chi2/2. P(a,x) represents the probability that the observed Chi-squared for a correct model should be less than the value chi2. The returned probability corresponds to 1-P(a,x), which denotes the probability that an observed Chi-squared exceeds the value chi2 by chance, even for a correct model. --- NvE 14-nov-1998 UU-SAP Utrecht
        Parameters:
        chi2 - input
        ndf - number of degrees of freedom
        Returns:
        the computed result
      • RMS

        public static double RMS​(double[] data)
      • RMS

        public static double RMS​(double[] data,
                                 int length)
        Parameters:
        data - the input vector
        length - <= data.length elements to be used
        Returns:
        un-biased r.m.s. of vector elements
      • RMS

        public static float RMS​(float[] data)
      • RMS

        public static float RMS​(float[] data,
                                int length)
        Parameters:
        data - the input vector
        length - <= data.length elements to be used
        Returns:
        un-biased r.m.s. of vector elements
      • RMS

        public static int RMS​(int[] data)
      • RMS

        public static int RMS​(int[] data,
                              int length)
        Parameters:
        data - the input vector
        length - <= data.length elements to be used
        Returns:
        un-biased r.m.s. of vector elements
      • RMS

        public static long RMS​(long[] data)
      • RMS

        public static long RMS​(long[] data,
                               int length)
        Parameters:
        data - the input vector
        length - <= d data.length elements to be used
        Returns:
        un-biased r.m.s. of vector elements
      • RMS

        public static short RMS​(short[] data)
      • RMS

        public static short RMS​(short[] data,
                                int length)
        Parameters:
        data - the input vector
        length - <= data.length elements to be used
        Returns:
        un-biased r.m.s. of vector elements
      • Sinc

        public static double Sinc​(double x,
                                  boolean norm)
        Calculate the sinc = sin(x)/x function if norm ==true then sinc = sinc(pi*x)/(pi*x) is used
        Parameters:
        x - input parameter
        norm - normalisation factor
        Returns:
        the computed result
      • Sort

        public static double[] Sort​(double[] a,
                                    int length,
                                    boolean down)
        Sorts the input a array
        Parameters:
        a - the input array
        length - <= data.length elements to be used
        down - true: ascending , false: descending order
        Returns:
        the sorted array
      • Sort

        public static float[] Sort​(float[] a,
                                   int length,
                                   boolean down)
        Sorts the input a array
        Parameters:
        a - the input array
        length - <= data.length elements to be used
        down - true: ascending , false: descending order
        Returns:
        the sorted array
      • Sort

        public static int[] Sort​(int[] a,
                                 int length,
                                 boolean down)
        Sorts the input a array
        Parameters:
        a - the input array
        length - <= data.length elements to be used
        down - true: ascending , false: descending order
        Returns:
        the sorted array
      • Sort

        public static long[] Sort​(long[] a,
                                  int length,
                                  boolean down)
        Sorts the input a array
        Parameters:
        a - the input array
        length - <= data.length elements to be used
        down - true: ascending , false: descending order
        Returns:
        the sorted array
      • Sort

        public static short[] Sort​(short[] a,
                                   int length,
                                   boolean down)
        Sorts the input a array
        Parameters:
        a - the input array
        length - <= data.length elements to be used
        down - true: ascending , false: descending order
        Returns:
        the sorted array
      • StruveH0

        public static double StruveH0​(double x)
      • StruveH1

        public static double StruveH1​(double x)
      • StruveL0

        public static double StruveL0​(double x)
      • StruveL1

        public static double StruveL1​(double x)
      • Student

        public static double Student​(double T,
                                     double ndf)
        Computes density function for Student's t- distribution (the probability function (integral of density) is computed in StudentI). First parameter stands for x - the actual variable of the density function p(x) and the point at which the density is calculated. Second parameter stands for number of degrees of freedom. About Student distribution: Student's t-distribution is used for many significance tests, for example, for the Student's t-tests for the statistical significance of difference between two sample means and for confidence intervals for the difference between two population means. Example: suppose we have a random sample of size n drawn from normal distribution with mean Mu and st.deviation Sigma. Then the variable t = (sample_mean - Mu)/(sample_deviation / sqrt(n)) has Student's t-distribution with n-1 degrees of freedom. NOTE that this function's second argument is number of degrees of freedom, not the sample size. As the number of degrees of freedom grows, t-distribution approaches Normal(0,1) distribution. Implementation by Anna Kreshuk.
        Parameters:
        T - input value
        ndf - number of degrees of freedom
        Returns:
        value of the density function for Student's t- distribution
      • StudentI

        public static double StudentI​(double T,
                                      double ndf)
        Calculates the cumulative distribution function of Student's t-distribution second parameter stands for number of degrees of freedom, not for the number of samples if x has Student's t-distribution, the function returns the probability of x being less than T. Implementation by Anna Kreshuk.
        Parameters:
        T - input value
        ndf - number of degrees of freedom
        Returns:
        cumulative distribution function of Student's t-distribution
      • StudentQuantile

        public static double StudentQuantile​(double p,
                                             double ndf,
                                             boolean lower_tail)
      • Sum

        public static double[] Sum​(double[] a,
                                   double[] b)
      • Sum

        public static double[] Sum​(double[] a,
                                   double[] b,
                                   int length)
        computes the sum of vectors
        Parameters:
        a - input vector a
        b - input vector b
        length - minimum length to be taken into account
        Returns:
        ret[] =[] a + b[]
      • Sum

        public static float[] Sum​(float[] a,
                                  float[] b)
      • Sum

        public static float[] Sum​(float[] a,
                                  float[] b,
                                  int length)
        computes the sum of vectors
        Parameters:
        a - input vector a
        b - input vector b
        length - minimum length to be taken into account
        Returns:
        ret[] = a[] + b[]
      • Sum

        public static int[] Sum​(int[] a,
                                int[] b)
      • Sum

        public static int[] Sum​(int[] a,
                                int[] b,
                                int length)
        computes the sum of vectors
        Parameters:
        a - input vector a
        b - input vector b
        length - minimum length to be taken into account
        Returns:
        ret[] = a[] + b[]
      • Sum

        public static long[] Sum​(long[] a,
                                 long[] b)
      • Sum

        public static long[] Sum​(long[] a,
                                 long[] b,
                                 int length)
        computes the sum of vectors
        Parameters:
        a - input vector a
        b - input vector b
        length - minimum length to be taken into account
        Returns:
        ret[] = a[] + b[]
      • Sum

        public static short[] Sum​(short[] a,
                                  short[] b)
      • Sum

        public static short[] Sum​(short[] a,
                                  short[] b,
                                  int length)
        computes the sum of vectors
        Parameters:
        a - input vector a
        b - input vector b
        length - minimum length to be taken into account
        Returns:
        ret[] = a[] + b[]
      • Variance

        public static double Variance​(double[] aa,
                                      double[] ww)
      • Vavilov

        public static double Vavilov​(double x,
                                     double kappa,
                                     double beta2)
      • VavilovDenEval

        protected static double VavilovDenEval​(double rlam,
                                               double[] AC,
                                               double[] HC,
                                               int itype)
        Internal function, called by Vavilov and VavilovSet
        Parameters:
        rlam - ???
        AC - ???
        HC - ???
        itype - ???
        Returns:
        internal value
      • VavilovI

        public static double VavilovI​(double x,
                                      double kappa,
                                      double beta2)
      • VavilovSet

        public static void VavilovSet​(double rkappa,
                                      double beta2,
                                      boolean mode,
                                      double[] WCM,
                                      double[] AC,
                                      double[] HC,
                                      int[] itype,
                                      int[] npt)
        Internal function, called by Vavilov and VavilovI
        Parameters:
        rkappa - ???
        beta2 - ???
        mode - ???
        WCM - ???
        AC - ???
        HC - ???
        itype - ???
        npt - ???