MOA 12.03
Real Time Analytics for Data Streams
moa.clusterers.clustree.util.DoubleVector Class Reference

List of all members.

Static Public Member Functions

static void addVectors (double[] a1, double[] a2)
 Adds the second array to the first array element by element.
static double[] copyVector (double[] a)
 Copies an array of doubles.
static void normalizeVector (double[] a)
 Normalizes the given vector.
static void multiplyVector (double[] a, double f)
 Scales the vector a by the factor f.
static double calculateLength (double[] a)
 Calculates the length of the given vector.
static double calculateDistance (final double[] a1, final double[] a2)
 Calculates the euclidean distance between two given points.
static boolean isZero (double[] vector)
static void addConstant (double[] vector, double c)
 Adds a constant to all entries of this vector.

Detailed Description

Definition at line 23 of file clusterers/clustree/util/DoubleVector.java.


Member Function Documentation

static void moa.clusterers.clustree.util.DoubleVector.addConstant ( double[]  vector,
double  c 
) [static]

Adds a constant to all entries of this vector.

Parameters:
vector
c

Definition at line 130 of file clusterers/clustree/util/DoubleVector.java.

static void moa.clusterers.clustree.util.DoubleVector.addVectors ( double[]  a1,
double[]  a2 
) [static]

Adds the second array to the first array element by element.

The arrays must have the same length.

Parameters:
a1Vector to which the second vector is added.
a2Vector to be addded. This vector does not change.

Definition at line 31 of file clusterers/clustree/util/DoubleVector.java.

static double moa.clusterers.clustree.util.DoubleVector.calculateDistance ( final double[]  a1,
final double[]  a2 
) [static]

Calculates the euclidean distance between two given points.

Both double arrays must have the same number of elements, otherwise an assertion fails.

Parameters:
a1The first point
a2The second point
Returns:
The distance between both points

Definition at line 100 of file clusterers/clustree/util/DoubleVector.java.

static double moa.clusterers.clustree.util.DoubleVector.calculateLength ( double[]  a) [static]

Calculates the length of the given vector.

Parameters:
aA vector (double array)

Definition at line 83 of file clusterers/clustree/util/DoubleVector.java.

Referenced by moa.clusterers.clustree.util.DoubleVector.normalizeVector().

Here is the caller graph for this function:

static double [] moa.clusterers.clustree.util.DoubleVector.copyVector ( double[]  a) [static]

Copies an array of doubles.

Parameters:
aa vector (double array)
Returns:

Definition at line 47 of file clusterers/clustree/util/DoubleVector.java.

static boolean moa.clusterers.clustree.util.DoubleVector.isZero ( double[]  vector) [static]
Parameters:
vector
Returns:
true if the vector has zero length

Definition at line 117 of file clusterers/clustree/util/DoubleVector.java.

static void moa.clusterers.clustree.util.DoubleVector.multiplyVector ( double[]  a,
double  f 
) [static]

Scales the vector a by the factor f.

Parameters:
aA vector (double array)
fthe Scale factor

Definition at line 73 of file clusterers/clustree/util/DoubleVector.java.

static void moa.clusterers.clustree.util.DoubleVector.normalizeVector ( double[]  a) [static]

Normalizes the given vector.

Parameters:
aA vector (double array)

Definition at line 61 of file clusterers/clustree/util/DoubleVector.java.

Here is the call graph for this function:


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations