Package edu.jas.poly
Class TermOrder
java.lang.Object
edu.jas.poly.TermOrder
- All Implemented Interfaces:
Serializable
Term order class for ordered polynomials. Implements the most used term
orders: graded, lexicographical, weight array and block orders. For the
definitions see for example the articles
Kredel "Admissible term
orderings used in computer algebra systems" and
Sit, "Some comments on
term-ordering in Gröbner basis computations". Note: the
naming is not quite easy to understand: in case of doubt use the term orders
with "I" in the name, like IGRLEX (the default) or INVLEX. Not all algorithms
may work with all term orders since not all are well-founded, so watch your
step. This class does not implement orders by linear forms over Q[t]. Objects
of this class are immutable.
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final boolean
static final int
private final int
private final int
private final int
private final int
private final int
private final int
static final int
private final TermOrder.EVComparator
Defined descending order comparator.static final int
static final int
static final int
static final int
private static final org.apache.logging.log4j.Logger
private final TermOrder.EVComparator
Defined ascending order comparator.static final int
static final int
static final int
static final int
static final int
static final int
static final int
private final TermOrder.EVComparator
Defined sugar order comparator.final boolean
Termorders for modules: TOP or POT.private final long[][]
Defined array of weight vectors. -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for default term order.TermOrder
(int evord) Constructor for given term order.TermOrder
(int ev1, int ev2, int r, int split) Constructor for given split order.TermOrder
(int ev1, int ev2, int r, int split, boolean top) Constructor for given split order.TermOrder
(long[] w) Constructor for given exponent weights.TermOrder
(long[][] w) Constructor for given exponent weights. -
Method Summary
Modifier and TypeMethodDescriptionblockOrder
(int s) Create block term order at split index.blockOrder
(int s, int len) Create block term order at split index.blockOrder
(int s, TermOrder t) Create block term order at split index.blockOrder
(int s, TermOrder t, int len) Create block term order at split index.contract
(int k, int len) Contract variables.boolean
Comparison with any other object.extend
(int r, int k) Extend variables.extend
(int r, int k, boolean top) Extend variables.extendLower
(int r, int k) Extend lower variables.extendLower
(int r, int k, boolean top) Extend lower variables.Get the ascending order comparator.Get the descending order comparator.int
getEvord()
Get the first defined order indicator.int
Get the second defined order indicator.int
getSize()
Get the exponent vector size.int
getSplit()
Get the split index.Get the sugar order comparator.long[][]
Get the weight array.int
hashCode()
Hash code.boolean
isSplit()
Test if this term order is a split order.static long[]
longArrayPermutation
(List<Integer> P, long[] a) Permutation of a long array.permutation
(List<Integer> P) Permutation of the termorder.reverse()
Reverse variables.reverse
(boolean partial) Reverse variables.static TermOrder
reverseWeight
(long[][] w) Weight TermOrder with reversed weight vectors.static int
revert
(int evord) Revert exponent order.toScript()
String representation of TermOrder.toScriptOrder
(int ev) Script and String representation of TermOrder name.Script representation of TermOrder without prefix and weight matrix.toString()
String representation of TermOrder.String representation of TermOrder without prefix and weight matrix.Script representation of weight matrix.String representation of weight matrix.
-
Field Details
-
logger
private static final org.apache.logging.log4j.Logger logger -
debug
private static final boolean debug -
LEX
public static final int LEX- See Also:
-
MIN_EVORD
public static final int MIN_EVORD- See Also:
-
INVLEX
public static final int INVLEX- See Also:
-
GRLEX
public static final int GRLEX- See Also:
-
IGRLEX
public static final int IGRLEX- See Also:
-
REVLEX
public static final int REVLEX- See Also:
-
REVILEX
public static final int REVILEX- See Also:
-
REVTDEG
public static final int REVTDEG- See Also:
-
REVITDG
public static final int REVITDG- See Also:
-
ITDEGLEX
public static final int ITDEGLEX- See Also:
-
REVITDEG
public static final int REVITDEG- See Also:
-
MAX_EVORD
public static final int MAX_EVORD- See Also:
-
DEFAULT_EVORD
public static final int DEFAULT_EVORD- See Also:
-
evord
private final int evord -
evord2
private final int evord2 -
evbeg1
private final int evbeg1 -
evend1
private final int evend1 -
evbeg2
private final int evbeg2 -
evend2
private final int evend2 -
weight
private final long[][] weightDefined array of weight vectors. -
horder
Defined descending order comparator. Sorts the highest terms first. -
lorder
Defined ascending order comparator. Sorts the lowest terms first. -
sugar
Defined sugar order comparator. Sorts the graded lowest terms first. -
TOP
public final boolean TOPTermorders for modules: TOP or POT. POT: position over term (default) TOP: term over position (new)
-
-
Constructor Details
-
TermOrder
public TermOrder()Constructor for default term order. -
TermOrder
public TermOrder(int evord) Constructor for given term order.- Parameters:
evord
- requested term order indicator / enumerator.
-
TermOrder
public TermOrder(long[] w) Constructor for given exponent weights.- Parameters:
w
- weight vector of longs.
-
TermOrder
public TermOrder(long[][] w) Constructor for given exponent weights.- Parameters:
w
- weight array of longs.
-
TermOrder
public TermOrder(int ev1, int ev2, int r, int split) Constructor for given split order.- Parameters:
ev1
- requested term order indicator for first block.ev2
- requested term order indicator for second block.r
- max number of exponents to compare.split
- index.
-
TermOrder
public TermOrder(int ev1, int ev2, int r, int split, boolean top) Constructor for given split order.- Parameters:
ev1
- requested term order indicator for first block.ev2
- requested term order indicator for second block.r
- max number of exponents to compare.split
- index.top
- module termorder, if true, default false.
-
-
Method Details
-
isSplit
public boolean isSplit()Test if this term order is a split order.- Returns:
- true if this is a split term order, else false.
-
blockOrder
Create block term order at split index.- Parameters:
s
- split index.- Returns:
- block TermOrder with split index.
-
blockOrder
Create block term order at split index.- Parameters:
s
- split index.len
- length of ExpVectors to compare- Returns:
- block TermOrder with split index.
-
blockOrder
Create block term order at split index.- Parameters:
s
- split index.t
- second term order.- Returns:
- block TermOrder with split index.
-
blockOrder
Create block term order at split index.- Parameters:
s
- split index.t
- second term order.len
- length of ExpVectors to compare- Returns:
- block TermOrder with split index.
-
getEvord
public int getEvord()Get the first defined order indicator.- Returns:
- evord.
-
getEvord2
public int getEvord2()Get the second defined order indicator.- Returns:
- evord2.
-
getSplit
public int getSplit()Get the split index.- Returns:
- split.
-
getSize
public int getSize()Get the exponent vector size. Note: can be INTEGER.MAX_VALUE.- Returns:
- size.
-
getWeight
public long[][] getWeight()Get the weight array.- Returns:
- weight.
-
getDescendComparator
Get the descending order comparator. Sorts the highest terms first.- Returns:
- horder.
-
getAscendComparator
Get the ascending order comparator. Sorts the lowest terms first.- Returns:
- lorder.
-
getSugarComparator
Get the sugar order comparator. Sorts the graded lowest terms first.- Returns:
- sugar.
-
equals
Comparison with any other object. -
hashCode
public int hashCode()Hash code. -
weightToString
String representation of weight matrix.- Returns:
- string representation of weight matrix.
-
weightToScript
Script representation of weight matrix.- Returns:
- script representation of weight matrix.
-
toScript
String representation of TermOrder.- Returns:
- script representation of TermOrder.
-
toString
String representation of TermOrder. -
toStringPlain
String representation of TermOrder without prefix and weight matrix. -
toScriptPlain
Script representation of TermOrder without prefix and weight matrix. -
toScriptOrder
Script and String representation of TermOrder name. -
extend
Extend variables. Used e.g. in module embedding. Extend TermOrder by k elements. Note: Use POT module term order.- Parameters:
r
- current number of variables.k
- number of variables to extend.- Returns:
- extended TermOrder.
-
extend
Extend variables. Used e.g. in module embedding. Extend TermOrder by k elements. Note: Now TOP and POT orders are distinguished.- Parameters:
r
- current number of variables.k
- number of variables to extend.top
- true for TOP term order, false for POT term order.- Returns:
- extended TermOrder.
-
extendLower
Extend lower variables. Extend TermOrder by k elements. Note: Use POT module term order.- Parameters:
r
- current number of variables.k
- number of variables to extend.- Returns:
- extended TermOrder.
-
extendLower
Extend lower variables. Extend TermOrder by k elements. Note: Now TOP and POT orders are distinguished.- Parameters:
r
- current number of variables.k
- number of variables to extend.top
- true for TOP term order, false for POT term order.- Returns:
- extended TermOrder.
-
contract
Contract variables. Used e.g. in module embedding. Contract TermOrder to non split status.- Parameters:
k
- position of first element to be copied.len
- new length.- Returns:
- contracted TermOrder.
-
reverse
Reverse variables. Used e.g. in opposite rings.- Returns:
- TermOrder for reversed variables.
-
reverse
Reverse variables. Used e.g. in opposite rings.- Parameters:
partial
- true for partially reversed term orders.- Returns:
- TermOrder for reversed variables.
-
revert
public static int revert(int evord) Revert exponent order. Used e.g. in opposite rings.- Parameters:
evord
- exponent order to be reverted.- Returns:
- reverted exponent order.
-
longArrayPermutation
Permutation of a long array.- Parameters:
P
- permutation.a
- array of long.- Returns:
- P(a).
-
permutation
Permutation of the termorder.- Parameters:
P
- permutation.- Returns:
- P(a).
-
reverseWeight
Weight TermOrder with reversed weight vectors.- Parameters:
w
- weight matrix- Returns:
- TermOrder with reversed weight vectors
-