org.apache.sysds.runtime.functionobjects

## Class KahanFunction

- java.lang.Object
- - org.apache.sysds.runtime.functionobjects.FunctionObject
  - - org.apache.sysds.runtime.functionobjects.ValueFunction
    - - org.apache.sysds.runtime.functionobjects.KahanFunction

- All Implemented Interfaces:
    Serializable
  Direct Known Subclasses:
    KahanPlus, KahanPlusSq

      public abstract class KahanFunction
      extends ValueFunction
      implements Serializable

  Runtime function type to perform the summation of values using the Kahan summation algorithm.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `KahanFunction()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract void` | `execute2(KahanObject kObj, double in)` Add the given term to the existing sum with a function applied using the Kahan summation algorithm.
    `abstract void` | `execute3(KahanObject kObj, double in, int count)`
    `boolean` | `requiresCorrection()`

    - ### Methods inherited from class org.apache.sysds.runtime.functionobjects.FunctionObject

      `clone, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### KahanFunction

          public KahanFunction()

  - ### Method Detail

    - #### execute2

          public abstract void execute2(KahanObject kObj,
                                        double in)

      Add the given term to the existing sum with a function applied using the Kahan summation algorithm.
      Parameters:
        `kObj` - A KahanObject containing the current sum and correction factor for the Kahan summation algorithm.
        `in` - The current term to be added.

    - #### execute3

          public abstract void execute3(KahanObject kObj,
                                        double in,
                                        int count)

    - #### requiresCorrection

          public final boolean requiresCorrection()

      Overrides:
        `requiresCorrection` in class `ValueFunction`

Copyright © 2020 The Apache Software Foundation. All rights reserved.