JaCoP.constraints.geost
Interface LexicographicalOrder

All Known Implementing Classes:
PredefinedOrder, ShiftOrder

public interface LexicographicalOrder

Author:
Marc-Olivier Fleury and Radoslaw Szymanek It defines the necessary functionalities needed to define a lexicographical ordering of k-dimensional points.

Method Summary
 int compare(int[] p1, int[] p2)
          It compares two k-dimensional points.
 int dimensionAt(int precedenceLevel)
          It provides the dimension corresponding to the given precedence level
 int getMostSignificantDimension()
          This is equivalent to the call precedenceOf(0).
 int[] masterOrdering()
          It returns the ordering of dimensions used when no shift is applied (i.e.
 int precedenceOf(int dimension)
          It provides the precedence level of the given dimension.
 void setMostSignificantDimension(int d)
          It shifts the lexicographical order so that the most significant dimension is set to d.
 

Method Detail

compare

int compare(int[] p1,
            int[] p2)
It compares two k-dimensional points.

Parameters:
p1 -
p2 -
Returns:
comparison result: a negative value if p1 is smaller than p2, 0 if p1 is equal to p2, and a positive value if p1 is larger than p2.

precedenceOf

int precedenceOf(int dimension)
It provides the precedence level of the given dimension. 0 is the most significant.

Parameters:
dimension -
Returns:
integer value of the precedence level.

dimensionAt

int dimensionAt(int precedenceLevel)
It provides the dimension corresponding to the given precedence level

Parameters:
precedenceLevel -
Returns:
an integer value of the dimension.

setMostSignificantDimension

void setMostSignificantDimension(int d)
It shifts the lexicographical order so that the most significant dimension is set to d.

Parameters:
d - the dimension to be considered most significant

getMostSignificantDimension

int getMostSignificantDimension()
This is equivalent to the call precedenceOf(0).

Returns:
the most significant dimension

masterOrdering

int[] masterOrdering()
It returns the ordering of dimensions used when no shift is applied (i.e. when the most significant dimension is not changed)

Returns:
the ordering of dimensions without a shift.