Class Maths


  • public class Maths
    extends Object
    This class contains useful math methods.
    • Constructor Detail

      • Maths

        public Maths()
    • Method Detail

      • arrayAverage

        public static double arrayAverage​(double[] array)
        Calculates the average of an double array
        Parameters:
        array - Array of double from which to calculate the mean
        Returns:
        Array mean
      • arrayStandardDeviation

        public static double arrayStandardDeviation​(double[] array)
        Calculates the standard deviation of an double array
        Parameters:
        array - Array of double from which to calculate the standard deviation
        Returns:
        Standard deviation of the array
      • arrayAverage

        public static double arrayAverage​(int[] array)
        Calculates the average of an int array
        Parameters:
        array - Array of int from which to calculate the mean
        Returns:
        Array mean
      • arrayStandardDeviation

        public static double arrayStandardDeviation​(int[] array)
        Calculate the standard deviation of an int array
        Parameters:
        array - Array of int from which to calculate the standard deviation
        Returns:
        Standard deviation of the array
      • dotProduct

        public static double dotProduct​(double[] a,
                                        double[] b)
        Dot product between two vectors
        Parameters:
        a - Vector A
        b - Vector B
        Returns:
        dot_product(A, B)
      • log

        public static double log​(double x,
                                 double b)
        Returns the log in an specific base
        Parameters:
        x - Value
        b - Base
        Returns:
        log of x in base b
      • logistic

        public static double logistic​(double x)
        Returns the logistic function g(x)
        Parameters:
        x - The given parameter x of the function g(x)
        Returns:
        Value of the logistic function g(x)