de.lmu.ifi.dbs.elki.data
Class VectorUtil
java.lang.Object
de.lmu.ifi.dbs.elki.data.VectorUtil
public final class VectorUtil
- extends Object
Utility functions for use with vectors.
Note: obviously, many functions are class methods or database related.
Method Summary |
static
|
getRangeDouble(V vec)
Return the range across all dimensions. |
static
|
randomVector(V template)
Produce a new vector based on random numbers in [0:1] of the same type and
dimensionality as the given vector. |
static
|
randomVector(V template,
Random r)
Produce a new vector based on random numbers in [0:1] of the same type and
dimensionality as the given vector. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
VectorUtil
public VectorUtil()
getRangeDouble
public static <V extends NumberVector<?,?>> DoubleMinMax getRangeDouble(V vec)
- Return the range across all dimensions. Useful in particular for time series.
- Type Parameters:
V
- Vector type- Parameters:
vec
- Vector to process.
- Returns:
- [min, max]
randomVector
public static <V extends NumberVector<V,?>> V randomVector(V template,
Random r)
- Produce a new vector based on random numbers in [0:1] of the same type and
dimensionality as the given vector.
- Parameters:
template
- existing instance of wanted dimensionality.r
- Random generator
- Returns:
- new instance
randomVector
public static <V extends NumberVector<V,?>> V randomVector(V template)
- Produce a new vector based on random numbers in [0:1] of the same type and
dimensionality as the given vector.
- Parameters:
template
- existing instance of wanted dimensionality.
- Returns:
- new instance