Class Complex

java.lang.Object
ca.spatial.patchworks.Complex

public final class Complex extends Object
The Complex class sums a series of numbers using using Neumaier's enhanced version of Kahan's summation algorithm.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add​(double value)
    Add a value into the series
    double
    Return the value of the summation.
    void
    Reset the counters for this summation
    void
    sub​(double value)
    Subtract a value from the series.
     

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Complex

      public Complex()
  • Method Details

    • reset

      public final void reset()
      Reset the counters for this summation
    • getSoft

      public final double getSoft()
      Return the value of the summation. Check and correct for potential inaccuracies due to loss of precision.
    • add

      public final void add(double value)
      Add a value into the series
    • sub

      public final void sub(double value)
      Subtract a value from the series.
    • toString

      public String toString()
      Overrides:
      toString in class Object