Package edu.jas.poly
Class ExpVectorShort
java.lang.Object
edu.jas.poly.ExpVector
edu.jas.poly.ExpVectorShort
- All Implemented Interfaces:
AbelianGroupElem<ExpVector>
,Element<ExpVector>
,Serializable
,Comparable<ExpVector>
ExpVectorShort implements exponent vectors for polynomials using arrays of
short as storage unit. This class is used by ExpVector internally, there is
no need to use this class directly.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class edu.jas.poly.ExpVector
ExpVector.StorUnit
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final long
Largest short.static final long
Smallest short.(package private) final short[]
The data structure is an array of short. -
Constructor Summary
ConstructorsModifierConstructorDescriptionExpVectorShort
(int n) Constructor for ExpVector.ExpVectorShort
(int n, int i, long e) Constructor for ExpVector.ExpVectorShort
(int n, int i, short e) Constructor for ExpVector.ExpVectorShort
(long[] v) Constructor for ExpVector.protected
ExpVectorShort
(short[] v) Internal constructor for ExpVector.Constructor for ExpVector. -
Method Summary
Modifier and TypeMethodDescriptionabs()
ExpVector absolute value.Combine with ExpVector.int
ExpVector compareTo.contract
(int i, int len) Contract variables.copy()
Clone this.int[]
ExpVector dependency on variables.int
ExpVector dependent variables.boolean
Comparison with any other object.extend
(int i, int j, long e) Extend variables.extendLower
(int i, int j, long e) Extend lower variables.ExpVector greatest common divisor.long[]
getVal()
Get the exponent vector.long
getVal
(int i) Get the exponent at position i.int
hashCode()
hashCode for this exponent vector.int
ExpVector inverse graded lexicographical compareTo.int
invGradCompareTo
(ExpVector V, int begin, int end) ExpVector inverse graded lexicographical compareTo.int
ExpVector inverse lexicographical compareTo.int
invLexCompareTo
(ExpVector V, int begin, int end) ExpVector inverse lexicographical compareTo.int
ExpVector inverse total degree lexicographical compareTo.int
invWeightCompareTo
(long[][] w, ExpVector V) ExpVector inverse weighted lexicographical compareTo.int
invWeightCompareTo
(long[][] w, ExpVector V, int begin, int end) ExpVector inverse weighted lexicographical compareTo.ExpVector least common multiple.int
length()
Get the length of this exponent vector.long
maxDeg()
ExpVector maximal degree.long
minDeg()
ExpVector minimal degree.boolean
ExpVector multiple test.negate()
ExpVector negate.permutation
(List<Integer> P) Permutation of exponent vector.reverse()
Reverse variables.reverse
(int j) Reverse lower j variables.int
ExpVector reverse inverse graded compareTo.int
revInvGradCompareTo
(ExpVector V, int begin, int end) ExpVector reverse inverse graded compareTo.int
ExpVector reverse inverse lexicographical compareTo.int
revInvLexCompareTo
(ExpVector V, int begin, int end) ExpVector reverse inverse lexicographical compareTo.int
ExpVector reverse lexicographical inverse total degree compareTo.scalarMultiply
(long s) ExpVector multiply by scalar.protected long
setVal
(int i, long e) Set the exponent at position i to e.protected short
setVal
(int i, short e) Set the exponent at position i to e.int
signum()
ExpVector signum.subst
(int i, long d) ExpVector substitution.subst
(int i, short d) ExpVector substitution.ExpVector subtract.ExpVector summation.toString()
Get the string representation.long
totalDeg()
ExpVector total degree.static ExpVector
Value of other.long
weightDeg
(long[] w) ExpVector weighted degree.long
weightDeg
(long[][] w) ExpVector weighted degree.Methods inherited from class edu.jas.poly.ExpVector
bitLength, create, create, create, create, create, degree, divides, EVABS, evaluate, EVDIF, EVDOV, EVGCD, EVIGLC, EVIGLC, EVILCP, EVILCP, EVITDEGLC, EVIWLC, EVIWLC, EVLCM, EVMDEG, EVMINDEG, EVMT, EVNEG, EVRAND, EVRAND, EVRIGLC, EVRIGLC, EVRILCP, EVRILCP, EVRLITDEGC, EVSIGN, EVSU, EVSUM, EVTDEG, EVWDEG, factory, indexVar, indexVarName, isFinite, isZERO, random, random, stdVars, stdVars, STDVARS, STDVARS, toScript, toScript, toScriptFactory, toString, varIndex, varsToString
-
Field Details
-
val
final short[] valThe data structure is an array of short. -
maxShort
public static final long maxShortLargest short.- See Also:
-
minShort
public static final long minShortSmallest short.- See Also:
-
-
Constructor Details
-
ExpVectorShort
public ExpVectorShort(int n) Constructor for ExpVector.- Parameters:
n
- length of exponent vector.
-
ExpVectorShort
public ExpVectorShort(int n, int i, short e) Constructor for ExpVector. Sets exponent i to e.- Parameters:
n
- length of exponent vector.i
- index of exponent to be set.e
- exponent to be set.
-
ExpVectorShort
public ExpVectorShort(int n, int i, long e) Constructor for ExpVector. Sets exponent i to e.- Parameters:
n
- length of exponent vector.i
- index of exponent to be set.e
- exponent to be set.
-
ExpVectorShort
protected ExpVectorShort(short[] v) Internal constructor for ExpVector. Sets val.- Parameters:
v
- internal representation array.
-
ExpVectorShort
public ExpVectorShort(long[] v) Constructor for ExpVector. Sets val, converts from long array.- Parameters:
v
- long representation array.
-
ExpVectorShort
Constructor for ExpVector. Converts a String representation to an ExpVector. Accepted format = (1,2,3,4,5,6,7).- Parameters:
s
- String representation.- Throws:
NumberFormatException
-
-
Method Details
-
valueOf
Value of other.- Parameters:
e
- other ExpVector.- Returns:
- value in sub class of ExpVector.
-
copy
Clone this. -
getVal
public long[] getVal()Get the exponent vector. -
getVal
public long getVal(int i) Get the exponent at position i. -
setVal
protected long setVal(int i, long e) Set the exponent at position i to e. -
setVal
protected short setVal(int i, short e) Set the exponent at position i to e.- Parameters:
i
-e
-- Returns:
- old val[i].
-
length
public int length()Get the length of this exponent vector. -
extend
Extend variables. Used e.g. in module embedding. Extend this by i elements and set val[j] to e. -
extendLower
Extend lower variables. Extend this by i lower elements and set val[j] to e.- Specified by:
extendLower
in classExpVector
- Parameters:
i
- number of elements to extend.j
- index of element to be set.e
- new exponent for val[j].- Returns:
- extended exponent vector.
-
contract
Contract variables. Used e.g. in module embedding. Contract this to len elements. -
reverse
Reverse variables. Used e.g. in opposite rings. -
reverse
Reverse lower j variables. Used e.g. in opposite rings. Reverses the first j-1 variables, the rest is unchanged. -
combine
Combine with ExpVector. Combine this with the other ExpVector V. -
permutation
Permutation of exponent vector.- Specified by:
permutation
in classExpVector
- Parameters:
P
- permutation.- Returns:
- P(e).
-
toString
Get the string representation. -
equals
Comparison with any other object. -
hashCode
public int hashCode()hashCode for this exponent vector. -
abs
ExpVector absolute value.- Specified by:
abs
in interfaceAbelianGroupElem<ExpVector>
- Specified by:
abs
in classExpVector
- Returns:
- abs(this).
-
negate
ExpVector negate.- Specified by:
negate
in interfaceAbelianGroupElem<ExpVector>
- Specified by:
negate
in classExpVector
- Returns:
- -this.
-
sum
ExpVector summation.- Specified by:
sum
in interfaceAbelianGroupElem<ExpVector>
- Specified by:
sum
in classExpVector
- Parameters:
V
-- Returns:
- this+V.
-
subtract
ExpVector subtract. Result may have negative entries.- Specified by:
subtract
in interfaceAbelianGroupElem<ExpVector>
- Specified by:
subtract
in classExpVector
- Parameters:
V
-- Returns:
- this-V.
-
scalarMultiply
ExpVector multiply by scalar.- Specified by:
scalarMultiply
in classExpVector
- Parameters:
s
- scalar- Returns:
- s*this.
-
subst
ExpVector substitution. Clone and set exponent to d at position i.- Parameters:
i
- position.d
- new exponent.- Returns:
- substituted ExpVector.
-
subst
ExpVector substitution. Clone and set exponent to d at position i. -
signum
public int signum()ExpVector signum.- Specified by:
signum
in interfaceAbelianGroupElem<ExpVector>
- Specified by:
signum
in classExpVector
- Returns:
- 0 if this is zero, -1 if some entry is negative, 1 if no entry is negative and at least one entry is positive.
-
totalDeg
public long totalDeg()ExpVector total degree. -
maxDeg
public long maxDeg()ExpVector maximal degree. -
minDeg
public long minDeg()ExpVector minimal degree. -
weightDeg
public long weightDeg(long[][] w) ExpVector weighted degree. -
weightDeg
public long weightDeg(long[] w) ExpVector weighted degree. -
lcm
ExpVector least common multiple. -
gcd
ExpVector greatest common divisor. -
dependentVariables
public int dependentVariables()ExpVector dependent variables.- Specified by:
dependentVariables
in classExpVector
- Returns:
- number of indices where val has positive exponents.
-
dependencyOnVariables
public int[] dependencyOnVariables()ExpVector dependency on variables.- Specified by:
dependencyOnVariables
in classExpVector
- Returns:
- array of indices where val has positive exponents.
-
multipleOf
ExpVector multiple test. Test if this is component wise greater or equal to V.- Specified by:
multipleOf
in classExpVector
- Parameters:
V
-- Returns:
- true if this is a multiple of V, else false.
-
compareTo
ExpVector compareTo. -
invLexCompareTo
ExpVector inverse lexicographical compareTo.- Specified by:
invLexCompareTo
in classExpVector
- Parameters:
V
-- Returns:
- 0 if U == V, -1 if U < V, 1 if U > V.
-
invLexCompareTo
ExpVector inverse lexicographical compareTo.- Specified by:
invLexCompareTo
in classExpVector
- Parameters:
V
-begin
-end
-- Returns:
- 0 if U == V, -1 if U < V, 1 if U > V.
-
invGradCompareTo
ExpVector inverse graded lexicographical compareTo.- Specified by:
invGradCompareTo
in classExpVector
- Parameters:
V
-- Returns:
- 0 if U == V, -1 if U < V, 1 if U > V.
-
invGradCompareTo
ExpVector inverse graded lexicographical compareTo.- Specified by:
invGradCompareTo
in classExpVector
- Parameters:
V
-begin
-end
-- Returns:
- 0 if U == V, -1 if U < V, 1 if U > V.
-
revInvLexCompareTo
ExpVector reverse inverse lexicographical compareTo.- Specified by:
revInvLexCompareTo
in classExpVector
- Parameters:
V
-- Returns:
- 0 if U == V, -1 if U < V, 1 if U > V.
-
revInvLexCompareTo
ExpVector reverse inverse lexicographical compareTo.- Specified by:
revInvLexCompareTo
in classExpVector
- Parameters:
V
-begin
-end
-- Returns:
- 0 if U == V, -1 if U < V, 1 if U > V.
-
revInvGradCompareTo
ExpVector reverse inverse graded compareTo.- Specified by:
revInvGradCompareTo
in classExpVector
- Parameters:
V
-- Returns:
- 0 if U == V, -1 if U < V, 1 if U > V.
-
revInvGradCompareTo
ExpVector reverse inverse graded compareTo.- Specified by:
revInvGradCompareTo
in classExpVector
- Parameters:
V
-begin
-end
-- Returns:
- 0 if U == V, -1 if U < V, 1 if U > V.
-
invTdegCompareTo
ExpVector inverse total degree lexicographical compareTo.- Specified by:
invTdegCompareTo
in classExpVector
- Parameters:
V
-- Returns:
- 0 if U == V, -1 if U < V, 1 if U > V.
-
revLexInvTdegCompareTo
ExpVector reverse lexicographical inverse total degree compareTo.- Specified by:
revLexInvTdegCompareTo
in classExpVector
- Parameters:
V
-- Returns:
- 0 if U == V, -1 if U < V, 1 if U > V.
-
invWeightCompareTo
ExpVector inverse weighted lexicographical compareTo.- Specified by:
invWeightCompareTo
in classExpVector
- Parameters:
w
- weight array.V
-- Returns:
- 0 if U == V, -1 if U < V, 1 if U > V.
-
invWeightCompareTo
ExpVector inverse weighted lexicographical compareTo.- Specified by:
invWeightCompareTo
in classExpVector
- Parameters:
w
- weight array.V
-begin
-end
-- Returns:
- 0 if U == V, -1 if U < V, 1 if U > V.
-