edu.uiuc.ge.illigal.gale.distance
Interface Distance

All Known Implementing Classes:
Euclidean, Mixed, Nominal

public interface Distance

Defines a simple interface for metric functions

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

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.
 

Method Detail

init

public void init(edu.uiuc.ge.illigal.gale.data.AttributeSet att)
          throws java.lang.Exception
Initializes the distance function

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)
This function computes the distance between an instance an a float array starting at the iOff position

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)
This function computes the distance between an instance an a float array starting at the iOff position, only if its required.

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()
Returns the String representation of the distance function.

Overrides:
toString in class java.lang.Object
Returns:
The string class

maximalDistance

public float maximalDistance()
Returns the maximal distance for attributes space.

Returns:
the distance