public class PredefinedOrder 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 |
---|
PredefinedOrder(int[] ordering,
int mostSignificantDimension)
It specifies the comparison of k-dimensional point comparator based on
the dimension ordering and the most significant dimension.
|
Modifier and Type | Method and Description |
---|---|
String |
checkInvariants()
It checks the invariants for this order.
|
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.
|
String |
toString() |
public PredefinedOrder(int[] ordering, int mostSignificantDimension)
ordering
- how dimensions are stored within each compared point.mostSignificantDimension
- the most significant dimensionpublic 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 d)
LexicographicalOrder
setMostSignificantDimension
in interface LexicographicalOrder
d
- 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.