gov.sandia.cognition.learning.function.distance
Class EuclideanDistanceMetric

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.learning.function.distance.EuclideanDistanceMetric
All Implemented Interfaces:
DivergenceFunction<Vectorizable,Vectorizable>, Metric<Vectorizable>, Semimetric<Vectorizable>, CloneableSerializable, Serializable, Cloneable

public class EuclideanDistanceMetric
extends AbstractCloneableSerializable
implements Metric<Vectorizable>

The EuclideanDistanceMetric implements a distance metric that computes the Euclidean distance between two points.

Since:
1.0
Author:
Justin Basilico
See Also:
Serialized Form

Field Summary
static EuclideanDistanceMetric INSTANCE
          An instance of EuclideanDistanceMetric to use since the class has no internal data.
 
Constructor Summary
EuclideanDistanceMetric()
          Creates a new instance of EuclideanDistanceMetric.
 
Method Summary
 double evaluate(Vectorizable first, Vectorizable second)
          Evaluates the Euclidean distance between the two given vectors.
 
Methods inherited from class gov.sandia.cognition.util.AbstractCloneableSerializable
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.sandia.cognition.util.CloneableSerializable
clone
 

Field Detail

INSTANCE

public static final EuclideanDistanceMetric INSTANCE
An instance of EuclideanDistanceMetric to use since the class has no internal data.

Constructor Detail

EuclideanDistanceMetric

public EuclideanDistanceMetric()
Creates a new instance of EuclideanDistanceMetric.

Method Detail

evaluate

public double evaluate(Vectorizable first,
                       Vectorizable second)
Evaluates the Euclidean distance between the two given vectors.

Specified by:
evaluate in interface DivergenceFunction<Vectorizable,Vectorizable>
Parameters:
first - The first Vector.
second - The second Vector.
Returns:
The Euclidean distance between the two given vectors.