public class PreciseSummation extends Object
| Modifier and Type | Field and Description |
|---|---|
static boolean |
_debug
Set this to true to get some debugging messages.
|
| Constructor and Description |
|---|
PreciseSummation() |
| Modifier and Type | Method and Description |
|---|---|
static double |
preciseSum(double[] x)
Returns the precise sum of all elements of
x. |
public static double preciseSum(double[] x)
x.
The values in x are put into a priority queue (min heap).
Then, the two smallest numbers are drawn from the heap, added together and put back into the heap
until the only element left in the heap is the sum of all elements of x.x - [N] input arrayCopyright © 2019. All rights reserved.