public class DoubleMinMax extends Object
Modifier and Type | Field and Description |
---|---|
private double |
max
Minimum and maximum.
|
private double |
min
Minimum and maximum.
|
Constructor and Description |
---|
DoubleMinMax()
Constructor without starting values.
|
DoubleMinMax(double min,
double max)
Constructor with predefined minimum and maximum values.
|
Modifier and Type | Method and Description |
---|---|
double[] |
asDoubleArray()
Return minimum and maximum as array.
|
double |
getDiff()
Return the difference between minimum and maximum.
|
double |
getMax()
Get the current maximum.
|
double |
getMin()
Get the current minimum.
|
boolean |
isValid()
Test whether the result is defined.
|
static DoubleMinMax[] |
newArray(int size)
Generate a new array of initialized DoubleMinMax objects (with default
constructor)
|
void |
put(Collection<Double> data)
Deprecated.
Collection<Double> is expensive. Avoid. |
void |
put(double val)
Process a single double value.
|
void |
put(double[] data)
Process a whole array of double values.
|
void |
put(DoubleMinMax val)
Process a MinMax pair.
|
void |
reset()
Reset statistics.
|
String |
toString() |
private double min
private double max
public DoubleMinMax()
Double.POSITIVE_INFINITY
.
The maximum will be initialized to Double.NEGATIVE_INFINITY
.
So that the first data added will replace both.public DoubleMinMax(double min, double max)
min
- Minimum valuemax
- Maximum valuepublic void put(double val)
val
- New valuepublic void put(double[] data)
data
- Data to process@Deprecated public void put(Collection<Double> data)
Collection<Double>
is expensive. Avoid.data
- Data to processpublic void put(DoubleMinMax val)
val
- New valuepublic double getMin()
public double getMax()
public double getDiff()
public boolean isValid()
public double[] asDoubleArray()
public static DoubleMinMax[] newArray(int size)
size
- Array sizepublic void reset()
Copyright © 2015 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.