public class ShiftOrder extends Object implements LexicographicalOrder
It provides a very simple lexicographical order based on the dimension ordering, with the possibility to choose the most significant dimension
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
p1
- point 1p2
- point 2public int dimensionAt(int precedenceLevel)
LexicographicalOrder
dimensionAt
in interface LexicographicalOrder
precedenceLevel
- the given precedence levelpublic int precedenceOf(int dimension)
LexicographicalOrder
precedenceOf
in interface LexicographicalOrder
dimension
- the given dimensionpublic 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 © 2022. All rights reserved.