edu.uiuc.ge.illigal.gale.distance
Class Euclidean

java.lang.Object
  |
  +--edu.uiuc.ge.illigal.gale.distance.Euclidean
All Implemented Interfaces:
Distance

public class Euclidean
extends java.lang.Object
implements Distance

Implements an Euclidean distance metric

Since:
0.9alpha
Version:
0.9alpha
Author:
Xavier Llorà <xllora@illigal.ge.uiuc.edu>

Field Summary
protected  edu.uiuc.ge.illigal.gale.data.AttributeSet attCnf
          Attribute set information
protected  float fMaximalDis
          Maximal distance for attribute set
 
Constructor Summary
Euclidean()
           
 
Method Summary
 float distance(float[] fa, boolean[] ba, int iOff, edu.uiuc.ge.illigal.gale.data.Instance ins, int iLength)
          This function computes the distance between an instance an a float array starting at the iOff position, only if its required.
 float distance(float[] fa, int iOff, edu.uiuc.ge.illigal.gale.data.Instance ins, int iLength)
          This function computes the distance between an instance an a float array starting at the iOff position
 void init(edu.uiuc.ge.illigal.gale.data.AttributeSet att)
          Initializes the distance function
 float maximalDistance()
          Returns the maximal distance for attributes space.
 java.lang.String toString()
          Returns the String representation of the distance function.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

attCnf

protected edu.uiuc.ge.illigal.gale.data.AttributeSet attCnf
Attribute set information


fMaximalDis

protected float fMaximalDis
Maximal distance for attribute set

Constructor Detail

Euclidean

public Euclidean()
Method Detail

init

public void init(edu.uiuc.ge.illigal.gale.data.AttributeSet att)
          throws java.lang.Exception
Description copied from interface: Distance
Initializes the distance function

Specified by:
init in interface Distance
Parameters:
att - the set of attributes to use
Throws:
java.lang.Exception - the attributes' types were incompatible

distance

public float distance(float[] fa,
                      int iOff,
                      edu.uiuc.ge.illigal.gale.data.Instance ins,
                      int iLength)
Description copied from interface: Distance
This function computes the distance between an instance an a float array starting at the iOff position

Specified by:
distance in interface Distance
Parameters:
fa - the float array to compute
iOff - The starting array point
ins - The instance used
iLength - The number of float to be compared
Returns:
The computed distance

distance

public float distance(float[] fa,
                      boolean[] ba,
                      int iOff,
                      edu.uiuc.ge.illigal.gale.data.Instance ins,
                      int iLength)
Description copied from interface: Distance
This function computes the distance between an instance an a float array starting at the iOff position, only if its required.

Specified by:
distance in interface Distance
Parameters:
fa - the float array to compute
ba - the boolean array to compute
iOff - The starting array point
ins - The instance used
iLength - The number of float to be compared
Returns:
The computed distance

toString

public java.lang.String toString()
Description copied from interface: Distance
Returns the String representation of the distance function.

Specified by:
toString in interface Distance
Overrides:
toString in class java.lang.Object
Returns:
The string class

maximalDistance

public float maximalDistance()
Description copied from interface: Distance
Returns the maximal distance for attributes space.

Specified by:
maximalDistance in interface Distance
Returns:
the distance