Documentation of 'com.jstatcom.parser.CalcFunctions' Java class
CalcFunctions
com.jstatcom.parser

Class CalcFunctions



  • public abstract class CalcFunctions
    extends java.lang.Object
    Enumeration of all functions that are used by CalcEngine. The defined functions objects override execute(int argNum, Stack argStack) to provide the respective functionality. All functions get their arguments from a stack and put the results back on the stack after successful computation.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static CalcFunctions COS
      cos(a), computes cosinus function for all elements of an array.
      static CalcFunctions FRACDIFF
      fracdiff(a, d), fractional differences of a.
      static CalcFunctions LAGN
      lagn(a,b), lags the array by b elements and fills the resulting free slots with Double.NaN.
      static CalcFunctions LOG
      log(a), computes natural logarithm for all elements of an array.
      static CalcFunctions MAX
      max(a,b), returns an array with the maximum elements of a and b for each row.
      static CalcFunctions MEANC
      meanc(a), computes the mean of all elements in an array.
      static CalcFunctions MIN
      min(a,b), returns an array with the minimum elements of a and b for each row.
      static CalcFunctions ONES
      ones(a), creates an array of ones with dimension (a x 1).
      static CalcFunctions REVERSE
      reverse(a), reverses the order of an array, starting from observation T to 1.
      static CalcFunctions RNDN
      rndn(a), creates an array of a random numbers between 0 and 1.
      static CalcFunctions ROWS
      rows(a), gets the rows of an array.
      static CalcFunctions SIN
      sin(a), computes sinus function for all elements of an array.
      static CalcFunctions SQRT
      sqrt(a), computes square root for all elements of an array.
      static CalcFunctions STAND
      stand(a), creates a normalized version if the array by subtracting the mean and dividing by the standard deviation.
      static CalcFunctions STDC
      stdc(a), computes the standard deviation of all elements in an array.
      static CalcFunctions SUMC
      sumc(a), computes the sum of all elements in an array.
      static CalcFunctions TAN
      tan(a), computes tangens function for all elements of an array.
      static CalcFunctions TREND
      trend(a), creates an array of numbers incremented by 1 with dimension (a x 1), starting from 1.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method and Description
      static void callFunctionForName(java.lang.String functionName, int argNum, java.util.Stack<double[]> argStack)
      Executes a function specified with a name.
      boolean equals(java.lang.Object o)
      Override prevention method to enforce a.equals(b) if and only if a==b.
      abstract void execute(int argNum, java.util.Stack<double[]> argStack)
      This defines the operation that is actually carried out by the function.
      static int getLength(double[] aa, double[] bb)
      Computes the correct length when 2 array are combined.
      int hashCode()
      Override prevention method invokes super method.
      java.lang.String toString()
      Returns the name of the runtype, do not use for comparisons.
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • FRACDIFF

        public static final CalcFunctions FRACDIFF
        fracdiff(a, d), fractional differences of a.
      • SIN

        public static final CalcFunctions SIN
        sin(a), computes sinus function for all elements of an array.
      • COS

        public static final CalcFunctions COS
        cos(a), computes cosinus function for all elements of an array.
      • TAN

        public static final CalcFunctions TAN
        tan(a), computes tangens function for all elements of an array.
      • SQRT

        public static final CalcFunctions SQRT
        sqrt(a), computes square root for all elements of an array.
      • LOG

        public static final CalcFunctions LOG
        log(a), computes natural logarithm for all elements of an array. Fails, if the array contains values smaller or equal to zero.
      • LAGN

        public static final CalcFunctions LAGN
        lagn(a,b), lags the array by b elements and fills the resulting free slots with Double.NaN. Lagging means, that every element i is replaced by the element in i-b. The argument b can also be negative, which would result in a forward shift.
      • ROWS

        public static final CalcFunctions ROWS
        rows(a), gets the rows of an array.
      • ONES

        public static final CalcFunctions ONES
        ones(a), creates an array of ones with dimension (a x 1).
      • TREND

        public static final CalcFunctions TREND
        trend(a), creates an array of numbers incremented by 1 with dimension (a x 1), starting from 1.
      • RNDN

        public static final CalcFunctions RNDN
        rndn(a), creates an array of a random numbers between 0 and 1.
      • SUMC

        public static final CalcFunctions SUMC
        sumc(a), computes the sum of all elements in an array.
      • MEANC

        public static final CalcFunctions MEANC
        meanc(a), computes the mean of all elements in an array.
      • STDC

        public static final CalcFunctions STDC
        stdc(a), computes the standard deviation of all elements in an array.
      • STAND

        public static final CalcFunctions STAND
        stand(a), creates a normalized version if the array by subtracting the mean and dividing by the standard deviation.
      • REVERSE

        public static final CalcFunctions REVERSE
        reverse(a), reverses the order of an array, starting from observation T to 1.
      • MIN

        public static final CalcFunctions MIN
        min(a,b), returns an array with the minimum elements of a and b for each row.
      • MAX

        public static final CalcFunctions MAX
        max(a,b), returns an array with the maximum elements of a and b for each row.
    • Method Detail

      • callFunctionForName

        public static void callFunctionForName(java.lang.String functionName,
                                               int argNum,
                                               java.util.Stack<double[]> argStack)
                                        throws java.lang.IllegalArgumentException
        Executes a function specified with a name.
        Parameters:
        functionName - a case insensitive String with the name of the function to call
        argNum - the number of arguments to the function
        argStack - the current Stack to store the input as well as the result
        Throws:
        java.lang.IllegalArgumentException - in case the function does not exist or the arguments are wrong
      • equals

        public final boolean equals(java.lang.Object o)
        Override prevention method to enforce a.equals(b) if and only if a==b.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        o - object to compare with
        Returns:
        true if equal, false otherwise
      • execute

        public abstract void execute(int argNum,
                                     java.util.Stack<double[]> argStack)
        This defines the operation that is actually carried out by the function. The method must be overridden if you define a new function. Input parameters as well as results are contained in the argStack.
        Parameters:
        argNum - the number of arguments to the function
        argStack - the current Stack to store the input as well as the result
      • getLength

        public static int getLength(double[] aa,
                                    double[] bb)
                             throws java.lang.IllegalArgumentException
        Computes the correct length when 2 array are combined.
        Parameters:
        aa - double array
        bb - double array
        Returns:
        the length for the result array
        Throws:
        ParseException - if (aa.length != bb.length) && (aa.length != 1) && (bb.length != 1)
        java.lang.IllegalArgumentException
      • hashCode

        public final int hashCode()
        Override prevention method invokes super method.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        hash code
      • toString

        public final java.lang.String toString()
        Returns the name of the runtype, do not use for comparisons.
        Overrides:
        toString in class java.lang.Object

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.