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

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

public class ManhattanDist
extends MinkowskiDist

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

Author:
Christoph Sieb, 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
 
Field Summary
static ManhattanDist MANHATTEN_DISTANCE
          An instance of this distance function.
 
Constructor Summary
protected ManhattanDist()
          Creates a Manhatten distance object from an Minkowski distance which means the power is one.
 
Method Summary
 double calcDistance(DataRow firstDataRow, DataRow secondDataRow, int[] includedCols)
          Calculates the distance between two data rows based on the Manhatten distance.
 String toString()
          Returns the String representation of this distance function.
 
Methods inherited from class org.knime.base.node.mine.cluster.hierarchical.distfunctions.MinkowskiDist
equals, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MANHATTEN_DISTANCE

public static final ManhattanDist MANHATTEN_DISTANCE
An instance of this distance function.

Constructor Detail

ManhattanDist

protected ManhattanDist()
Creates a Manhatten distance object from an Minkowski distance which means the power is one.

Method Detail

calcDistance

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

Specified by:
calcDistance in interface DistanceFunction
Overrides:
calcDistance in class MinkowskiDist
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 distance calculation
Returns:
the distance of the two rows

toString

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

Overrides:
toString in class MinkowskiDist
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.