distanceFunction
Class DistanceFunction

java.lang.Object
  extended by distanceFunction.DistanceFunction

public class DistanceFunction
extends java.lang.Object

Representation for the distance function.

Author:
Sepp Hartung

Field Summary
private  int[][] distanceFunction
           
 
Constructor Summary
DistanceFunction(DistanceFunction function)
          Copy constructor
DistanceFunction(int i)
           
DistanceFunction(int[][] distanceFunction)
          Constructs a new distance function.
DistanceFunction(int n, int maxDistValue, int variation)
          Constructs a new distance function and randomize ini the values.
 
Method Summary
 void clearValues()
           
static int[][] copyArray(int[][] arr)
           
 int distance(DistanceFunction dis)
          Computes the similarity of two distance functions under the l1-norm.
 int get(int i, int j)
          Returns d(i,j).
 int getNoOfElements()
           
 int hashCode()
           
 void increase(int i, int j, int k)
           
 boolean isConflict(int[] indices)
           
 boolean isConflict(int i, int j, int l)
          Check whether the distances between the given indices form a conflict or not.
 void printDistanceFunction()
           
 void set(int i, int j, int k)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

distanceFunction

private final int[][] distanceFunction
Constructor Detail

DistanceFunction

public DistanceFunction(DistanceFunction function)
Copy constructor

Parameters:
function -

DistanceFunction

public DistanceFunction(int n,
                        int maxDistValue,
                        int variation)
Constructs a new distance function and randomize ini the values.

Parameters:
n - number of nodes
maxDistValue - range [1,...,maxDistValue]

DistanceFunction

public DistanceFunction(int[][] distanceFunction)
Constructs a new distance function.

Parameters:
distanceFunction -

DistanceFunction

public DistanceFunction(int i)
Method Detail

copyArray

public static int[][] copyArray(int[][] arr)

clearValues

public void clearValues()

distance

public int distance(DistanceFunction dis)
Computes the similarity of two distance functions under the l1-norm.


get

public int get(int i,
               int j)
Returns d(i,j).

Parameters:
i - index
j - index
Returns:

getNoOfElements

public int getNoOfElements()

increase

public void increase(int i,
                     int j,
                     int k)
Parameters:
i -
j -
k -

isConflict

public boolean isConflict(int i,
                          int j,
                          int l)
Check whether the distances between the given indices form a conflict or not.

Parameters:
indices -
Returns:

isConflict

public boolean isConflict(int[] indices)

printDistanceFunction

public void printDistanceFunction()

set

public void set(int i,
                int j,
                int k)
Parameters:
i -
j -
k -

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object