Class KahanPlusSq

  • All Implemented Interfaces:
    Serializable

    public class KahanPlusSq
    extends KahanFunction
    Runtime function to perform the summation of squared values using the Kahan summation algorithm.
    See Also:
    Serialized Form
    • Method Detail

      • getKahanPlusSqFnObject

        public static KahanPlusSq getKahanPlusSqFnObject()
        Get the KahanPlusSq singleton object.
        Returns:
        KahanPlusSq singleton object
      • execute

        public Data execute​(Data kObj,
                            double in)
        Square the given term, then add to the existing sum using the Kahan summation algorithm.
        Overrides:
        execute in class FunctionObject
        Parameters:
        kObj - A KahanObject supplied as a Data type containing the current sum and correction factor for the Kahan summation algorithm.
        in - The current term to be squared and added.
      • execute

        public Data execute​(Data kObj,
                            double sum,
                            double corr)
        Add the given sum and correction factor to the existing sum in the KahanObject using the Kahan summation algorithm.
        Overrides:
        execute in class FunctionObject
        Parameters:
        kObj - A KahanObject supplied as a Data type containing the current sum and correction factor for the Kahan summation algorithm.
        sum - The current sum.
        corr - The current correction factor.
      • execute2

        public void execute2​(KahanObject kObj,
                             double in)
        Description copied from class: KahanFunction
        Add the given term to the existing sum with a function applied using the Kahan summation algorithm.
        Specified by:
        execute2 in class KahanFunction
        Parameters:
        kObj - A KahanObject containing the current sum and correction factor for the Kahan summation algorithm.
        in - The current term to be added.