org.knime.base.node.mine.bfn
Class Distance

java.lang.Object
  extended by org.knime.base.node.mine.bfn.Distance

public final class Distance
extends Object

Computes the Euclidean distance between two vectors.

Author:
Thomas Gabriel, University of Konstanz

Method Summary
 double compute(DataRow x, DataRow y)
          Computes the Euclidean distance between two normalized rows.
 double compute(double[] x, DataRow y)
          Computes the Euclidean distance between two normalized vectors.
 double compute(double[] x, double[] y)
          Computes the Euclidean distance between two normalized vectors.
 double compute(double[] x, DoubleValue[] y)
          Computes the Euclidean distance between two normalized vectors.
 double compute(DoubleValue[] x, DataRow y)
          Computes the Euclidean distance between two normalized vectors.
 double compute(DoubleValue[] x, DoubleValue[] y)
          Computes the Euclidean distance between the two normalized arrays.
 double computeSquaredEuclidean(double[] x, double[] y)
          Computes the Euclidean distance between two normalized vectors.
static Distance getInstance()
          Returns a new Distance object.
 String toString()
          Returns string representation Euclidean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getInstance

public static final Distance getInstance()
Returns a new Distance object.

Returns:
a distance object

compute

public final double compute(DataRow x,
                            DataRow y)
Computes the Euclidean distance between two normalized rows.

Parameters:
x - a row
y - another row
Returns:
Euclidean distance between x and y.
Throws:
NullPointerException - if one of the given rows is null

compute

public final double compute(DoubleValue[] x,
                            DataRow y)
Computes the Euclidean distance between two normalized vectors.

Parameters:
x - an array of double cells
y - a row
Returns:
the Euclidean distance between x and y
Throws:
NullPointerException - if one of the given rows is null

compute

public final double compute(double[] x,
                            DataRow y)
Computes the Euclidean distance between two normalized vectors.

Parameters:
x - an array of doubles
y - a row
Returns:
the Euclidean distance between x and y
Throws:
NullPointerException - if one of the given rows is null

compute

public final double compute(double[] x,
                            double[] y)
Computes the Euclidean distance between two normalized vectors.

Parameters:
x - an array of doubles
y - an array of doubles
Returns:
the Euclidean distance between x and y.
Throws:
NullPointerException - if one of the given arrays is null

computeSquaredEuclidean

public final double computeSquaredEuclidean(double[] x,
                                            double[] y)
Computes the Euclidean distance between two normalized vectors.

Parameters:
x - an array of doubles
y - an array of doubles
Returns:
the Euclidean distance between x and y.
Throws:
NullPointerException - if one of the given arrays is null

compute

public final double compute(double[] x,
                            DoubleValue[] y)
Computes the Euclidean distance between two normalized vectors.

Parameters:
x - an array of doubles
y - an array of DoubleValues
Returns:
the Euclidean distance between x and y
Throws:
NullPointerException - if one of the given rows is null

compute

public final double compute(DoubleValue[] x,
                            DoubleValue[] y)
Computes the Euclidean distance between the two normalized arrays.

Parameters:
x - an array
y - another array
Returns:
the Euclidean distance between x and y
Throws:
NullPointerException - if one of the given arrays is null

toString

public String toString()
Returns string representation Euclidean.

Overrides:
toString in class Object
Returns:
Euclidean


Copyright, 2003 - 2010. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.