|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.lmu.ifi.dbs.elki.utilities.pairs.DoubleDoublePair de.lmu.ifi.dbs.elki.math.DoubleMinMax
public class DoubleMinMax
Class to find the minimum and maximum double values in data.
Field Summary |
---|
Fields inherited from class de.lmu.ifi.dbs.elki.utilities.pairs.DoubleDoublePair |
---|
BYFIRST_COMPARATOR, BYSECOND_COMPARATOR, first, second, SWAPPED_COMPARATOR |
Constructor Summary | |
---|---|
DoubleMinMax()
Constructor without starting values. |
|
DoubleMinMax(double min,
double max)
Constructor with predefined minimum and maximum values. |
Method Summary | |
---|---|
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)
Process a whole collection of double values. |
void |
put(double data)
Process a single double value. |
void |
put(double[] data)
Process a whole array of double values. |
Methods inherited from class de.lmu.ifi.dbs.elki.utilities.pairs.DoubleDoublePair |
---|
compareSwappedTo, compareTo, equals, getFirst, getSecond, hashCode, setFirst, setSecond, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
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 valueMethod Detail |
---|
public void put(double data)
data
- New valuepublic void put(double[] data)
data
- Data to processpublic void put(Collection<Double> data)
data
- Data to processpublic double getMin()
public double getMax()
public double getDiff()
public boolean isValid()
public double[] asDoubleArray()
public static DoubleMinMax[] newArray(int size)
size
- Array size
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |