public class RealSum extends Object
RealSum implements a method to reduce numerical instabilities when
summing up a very large number of double precision numbers. Numerical
problems occur when a small number is added to an already very large sum. In
such case, the reduced accuracy of the very large number may lead to the
small number being entirely ignored. The method here is Neumaier's
improvement of the Kahan summation algorithm.
See this
Wikipedia article for details.| Constructor and Description |
|---|
RealSum()
Create a new
RealSum initialized to zero. |
RealSum(int capacity)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(double value)
Add an element to the sum.
|
double |
getSum()
Get the current sum.
|
public RealSum()
RealSum initialized to zero.@Deprecated public RealSum(int capacity)
RealSum initialized to zero. This constructor
was used in a previous version of RealSum and is kept for
backwards compatibility.capacity - unusedCopyright © 2009–2024 ImgLib2. All rights reserved.