public class RunningSumExtrema extends Object
RunningSum
but also remembers the mean and max across all the added
values.Constructor and Description |
---|
RunningSumExtrema() |
Modifier and Type | Method and Description |
---|---|
void |
add(double value)
Adds a value to the running-sum, also remembering if
value is the minimum or maximum
of calls to this method. |
double |
max()
The maximum across all
value s passed to add(double) or Double.MIN_VALUE if
the method was never called. |
double |
mean()
Calculates the mean.
|
double |
min()
The minimum across all
value s passed to add(double) or Double.MAX_VALUE if
the method was never called. |
public void add(double value)
value
is the minimum or maximum
of calls to this method.value
- the value.public double mean()
NaN
if add(double)
was never called.public double min()
value
s passed to add(double)
or Double.MAX_VALUE
if
the method was never called.public double max()
value
s passed to add(double)
or Double.MIN_VALUE
if
the method was never called.Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.