de.aitools.aq.algebra.vector.functions
Class DotProduct

java.lang.Object
  extended by de.aitools.aq.algebra.vector.functions.DotProduct
All Implemented Interfaces:
Proximity<Vector>

public final class DotProduct
extends java.lang.Object
implements Proximity<Vector>

The Dot Product of two vectors is defined as the sum of the pairwise products of the coordinate values of the vectors.
This is not a real proximity measure. A higher value of a dot product does not necessarily signal more proximate vectors. However, if vectors are prepared specially, the dot product can be used as a measure of relevance. That is why there is no computeNormalizedProximity(Vector, Vector) implemented: The normalization depends on the special case. So only use this if you know what you are doing.

Version:
$Id: DotProduct.java,v 1.1 2011/06/22 14:22:49 dogu3912 Exp $
Author:
johannes.kiesel(/\t)uni-weimar.de

Constructor Summary
DotProduct()
          Construct a new DotProduct.
 
Method Summary
 double computeNormalizedProximity(Vector v1, Vector v2)
          Compute a kind of proximity between two objects.
The value returned by this method has to be between 0 (meaning they are as far away (according to the proximity measure) from each other as possible) and 1 (identical objects according to the proximity measure).
 double computeProximity(Vector v1, Vector v2)
          Compute a kind of proximity between two objects.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DotProduct

public DotProduct()
Construct a new DotProduct.

Method Detail

computeProximity

public double computeProximity(Vector v1,
                               Vector v2)
Description copied from interface: Proximity
Compute a kind of proximity between two objects. A higher value signals higher proximity.

Specified by:
computeProximity in interface Proximity<Vector>
Parameters:
v1 - One object, to be compared to the...
v2 - ...second object
Returns:
Computed proximity

computeNormalizedProximity

public double computeNormalizedProximity(Vector v1,
                                         Vector v2)
Description copied from interface: Proximity
Compute a kind of proximity between two objects.
The value returned by this method has to be between 0 (meaning they are as far away (according to the proximity measure) from each other as possible) and 1 (identical objects according to the proximity measure).

Specified by:
computeNormalizedProximity in interface Proximity<Vector>
Parameters:
v1 - One object, to be compared to the...
v2 - ...second object
Returns:
Computed normalized proximity