public class ShiftOrder extends Object implements LexicographicalOrder
Constructor and Description |
---|
ShiftOrder(int dimensions,
int mostSignificant)
It creates a lexicographical order with the possibility
to shift the order according to the most significant dimension.
|
Modifier and Type | Method and Description |
---|---|
String |
checkInvariants()
It checks that this order has consistent data structures.
|
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 dimension)
It shifts the lexicographical order so that the most significant dimension
is set to d.
|
public ShiftOrder(int dimensions, int mostSignificant)
dimensions
- number of dimensions.mostSignificant
- the position of the most significant dimension.public String checkInvariants()
public int compare(int[] p1, int[] p2)
LexicographicalOrder
compare
in interface LexicographicalOrder
public int dimensionAt(int precedenceLevel)
LexicographicalOrder
dimensionAt
in interface LexicographicalOrder
public int precedenceOf(int dimension)
LexicographicalOrder
precedenceOf
in interface LexicographicalOrder
public void setMostSignificantDimension(int dimension)
LexicographicalOrder
setMostSignificantDimension
in interface LexicographicalOrder
dimension
- the dimension to be considered most significantpublic int getMostSignificantDimension()
LexicographicalOrder
getMostSignificantDimension
in interface LexicographicalOrder
public int[] masterOrdering()
LexicographicalOrder
masterOrdering
in interface LexicographicalOrder
Copyright © 2015. All rights reserved.