org.knime.base.node.mine.cluster.hierarchical.distfunctions
Class MinkowskiDist

java.lang.Object
  extended by org.knime.base.node.mine.cluster.hierarchical.distfunctions.MinkowskiDist
All Implemented Interfaces:
Serializable, DistanceFunction
Direct Known Subclasses:
EuclideanDist, ManhattanDist

public class MinkowskiDist
extends Object
implements DistanceFunction

Calculates the distance for two data rows based on the Minkowski distance.

Author:
som-team, University of Konstanz
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.knime.base.node.mine.cluster.hierarchical.distfunctions.DistanceFunction
DistanceFunction.Names
 
Constructor Summary
MinkowskiDist(int p)
          Creates a Minkowski distance object from an Minkowski distance.
 
Method Summary
 double calcDistance(DataRow firstDataRow, DataRow secondDataRow, int[] includedCols)
          Calculates the distance between two data rows based on the Minkowski distance.
 boolean equals(Object o)
           
 int hashCode()
          
 String toString()
          Returns the String representation of this distance function.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MinkowskiDist

public MinkowskiDist(int p)
Creates a Minkowski distance object from an Minkowski distance.

Parameters:
p - the power for this Minkowski distance
Method Detail

calcDistance

public double calcDistance(DataRow firstDataRow,
                           DataRow secondDataRow,
                           int[] includedCols)
Calculates the distance between two data rows based on the Minkowski distance.

Specified by:
calcDistance in interface DistanceFunction
Parameters:
firstDataRow - the first data row used to calculate the distance
secondDataRow - the second data row used to calculate the distance
includedCols - the columns to include into the calculation
Returns:
the distance of the two rows

equals

public boolean equals(Object o)
Overrides:
equals in class Object
Parameters:
o - The object to compare with.
Returns:
true if both instances (classes) are the same.

hashCode

public int hashCode()

Overrides:
hashCode in class Object

toString

public String toString()
Returns the String representation of this distance function.

Overrides:
toString in class Object
Returns:
the String representation


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.