de.lmu.ifi.dbs.elki.data
Class VectorUtil

java.lang.Object
  extended by 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.


Constructor Summary
VectorUtil()
           
 
Method Summary
static
<V extends NumberVector<?,?>>
DoubleMinMax
getRangeDouble(V vec)
          Return the range across all dimensions.
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.
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VectorUtil

public VectorUtil()
Method Detail

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

Release 0.4.0 (2011-09-20_1324)