Documentation of 'org.matheclipse.core.stat.descriptive.summary.SymbolicSum' Java class
SymbolicSum
org.matheclipse.core.stat.descriptive.summary

Class SymbolicSum

    • Constructor Summary

      Constructors 
      Constructor and Description
      SymbolicSum()
      Create a Sum instance
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void clear()
      Clears the internal state of the Statistic
      IExpr evaluate(IAST values, IAST weights)
      The weighted sum of the entries in the the input array.
      IExpr evaluate(IAST values, IAST weights, int begin, int length)
      The weighted sum of the entries in the specified portion of the input array, or 0 if the designated subarray is empty.
      IExpr evaluate(IAST values, int begin, int length)
      The sum of the entries in the specified portion of the input array, or 0 if the designated subarray is empty.
      long getN()
      Returns the number of values that have been added.
      IExpr getResult()
      Returns the current value of the Statistic.
      void increment(IExpr d)
      Updates the internal state of the statistic to reflect the addition of the new value.
      • Methods inherited from class java.lang.Object

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

      • SymbolicSum

        public SymbolicSum()
        Create a Sum instance
    • Method Detail

      • evaluate

        public IExpr evaluate(IAST values,
                              int begin,
                              int length)
        The sum of the entries in the specified portion of the input array, or 0 if the designated subarray is empty.

        Throws IllegalArgumentException if the array is null.

        Specified by:
        evaluate in interface SymbolicUnivariateStatistic
        Overrides:
        evaluate in class AbstractSymbolicStorelessUnivariateStatistic
        Parameters:
        values - the input array
        begin - index of the first array element to include
        length - the number of elements to include
        Returns:
        the sum of the values or 0 if length = 0
        Throws:
        java.lang.IllegalArgumentException - if the array is null or the array index parameters are not valid
        See Also:
        UnivariateStatistic.evaluate(double[], int, int)
      • evaluate

        public IExpr evaluate(IAST values,
                              IAST weights,
                              int begin,
                              int length)
        The weighted sum of the entries in the specified portion of the input array, or 0 if the designated subarray is empty.

        Throws IllegalArgumentException if any of the following are true:

        • the values array is null
        • the weights array is null
        • the weights array does not have the same length as the values array
        • the weights array contains one or more infinite values
        • the weights array contains one or more NaN values
        • the weights array contains negative values
        • the start and length arguments do not determine a valid array

        Uses the formula,

            weighted sum = Σ(values[i] * weights[i])
         

        Parameters:
        values - the input array
        weights - the weights array
        begin - index of the first array element to include
        length - the number of elements to include
        Returns:
        the sum of the values or 0 if length = 0
        Throws:
        java.lang.IllegalArgumentException - if the parameters are not valid
        Since:
        2.1
      • evaluate

        public IExpr evaluate(IAST values,
                              IAST weights)
        The weighted sum of the entries in the the input array.

        Throws IllegalArgumentException if any of the following are true:

        • the values array is null
        • the weights array is null
        • the weights array does not have the same length as the values array
        • the weights array contains one or more infinite values
        • the weights array contains one or more NaN values
        • the weights array contains negative values

        Uses the formula,

            weighted sum = Σ(values[i] * weights[i])
         

        Parameters:
        values - the input array
        weights - the weights array
        Returns:
        the sum of the values or Double.NaN if length = 0
        Throws:
        java.lang.IllegalArgumentException - if the parameters are not valid
        Since:
        2.1

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.