edu.jas.poly
Class ExpVectorByte

java.lang.Object
  extended by edu.jas.poly.ExpVector
      extended by edu.jas.poly.ExpVectorByte
All Implemented Interfaces:
AbelianGroupElem<ExpVector>, Element<ExpVector>, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<ExpVector>

public class ExpVectorByte
extends ExpVector

ExpVectorByte implements exponent vectors for polynomials using arrays of byte as storage unit. This class is used by ExpVector internally, there is no need to use this class directly.

Author:
Heinz Kredel
See Also:
ExpVector, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class edu.jas.poly.ExpVector
ExpVector.StorUnit
 
Field Summary
static long maxByte
          Largest byte.
static long minByte
          Smallest byte.
 
Fields inherited from class edu.jas.poly.ExpVector
hash, storunit
 
Constructor Summary
protected ExpVectorByte(byte[] v)
          Internal constructor for ExpVector.
  ExpVectorByte(int n)
          Constructor for ExpVector.
  ExpVectorByte(int n, int i, byte e)
          Constructor for ExpVector.
  ExpVectorByte(int n, int i, long e)
          Constructor for ExpVector.
  ExpVectorByte(long[] v)
          Constructor for ExpVector.
  ExpVectorByte(java.lang.String s)
          Constructor for ExpVector.
 
Method Summary
 ExpVectorByte abs()
          ExpVector absolute value.
 ExpVectorByte clone()
          Clone this.
 ExpVectorByte combine(ExpVector V)
          Combine with ExpVector.
 int compareTo(ExpVector V)
          ExpVector compareTo.
 ExpVectorByte contract(int i, int len)
          Contract variables.
 int[] dependencyOnVariables()
          ExpVector dependency on variables.
 boolean equals(java.lang.Object B)
          Comparison with any other object.
 ExpVectorByte extend(int i, int j, long e)
          Extend variables.
 ExpVectorByte extendLower(int i, int j, long e)
          Extend lower variables.
 ExpVectorByte gcd(ExpVector V)
          ExpVector greatest common divisor.
 long getVal(int i)
          Get the exponent at position i.
 int invGradCompareTo(ExpVector V)
          ExpVector inverse graded lexicographical compareTo.
 int invGradCompareTo(ExpVector V, int begin, int end)
          ExpVector inverse graded lexicographical compareTo.
 int invLexCompareTo(ExpVector V)
          ExpVector inverse lexicographical compareTo.
 int invLexCompareTo(ExpVector V, int begin, int end)
          ExpVector inverse 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.
 ExpVectorByte lcm(ExpVector V)
          ExpVector least common multiple.
 int length()
          Get the length of this exponent vector.
 long maxDeg()
          ExpVector maximal degree.
 boolean multipleOf(ExpVector V)
          ExpVector multiple test.
 ExpVectorByte negate()
          ExpVector negate.
 ExpVectorByte reverse()
          Reverse variables.
 ExpVectorByte reverse(int j)
          Reverse j variables.
 int revInvGradCompareTo(ExpVector V)
          ExpVector reverse inverse graded compareTo.
 int revInvGradCompareTo(ExpVector V, int begin, int end)
          ExpVector reverse inverse graded compareTo.
 int revInvLexCompareTo(ExpVector V)
          ExpVector reverse inverse lexicographical compareTo.
 int revInvLexCompareTo(ExpVector V, int begin, int end)
          ExpVector reverse inverse lexicographical compareTo.
protected  byte setVal(int i, byte e)
          Set the exponent at position i to e.
protected  long setVal(int i, long e)
          Set the exponent at position i to e.
 int signum()
          ExpVector signum.
 ExpVectorByte subst(int i, byte d)
          ExpVector substitution.
 ExpVectorByte subst(int i, long d)
          ExpVector substitution.
 ExpVectorByte subtract(ExpVector V)
          ExpVector subtract.
 ExpVectorByte sum(ExpVector V)
          ExpVector summation.
 java.lang.String toString()
          Get the string representation.
 long totalDeg()
          ExpVector total degree.
 long weightDeg(long[][] w)
          ExpVector weighted degree.
 
Methods inherited from class edu.jas.poly.ExpVector
create, create, create, create, create, divides, EVABS, evaluate, EVDIF, EVDOV, EVGCD, EVIGLC, EVIGLC, EVILCP, EVILCP, EVIWLC, EVIWLC, EVLCM, EVMDEG, EVMT, EVNEG, EVRAND, EVRAND, EVRIGLC, EVRIGLC, EVRILCP, EVRILCP, EVSIGN, EVSU, EVSUM, EVTDEG, EVWDEG, factory, hashCode, indexVar, indexVarName, isFinite, isZERO, random, random, stdVars, STDVARS, stdVars, STDVARS, toScript, toScript, toScriptFactory, toString, varIndex
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

maxByte

public static long maxByte
Largest byte.


minByte

public static long minByte
Smallest byte.

Constructor Detail

ExpVectorByte

public ExpVectorByte(int n)
Constructor for ExpVector.

Parameters:
n - length of exponent vector.

ExpVectorByte

public ExpVectorByte(int n,
                     int i,
                     byte 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.

ExpVectorByte

public ExpVectorByte(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.

ExpVectorByte

protected ExpVectorByte(byte[] v)
Internal constructor for ExpVector. Sets val.

Parameters:
v - internal representation array.

ExpVectorByte

public ExpVectorByte(long[] v)
Constructor for ExpVector. Sets val, converts from long array.

Parameters:
v - long representation array.

ExpVectorByte

public ExpVectorByte(java.lang.String s)
              throws java.lang.NumberFormatException
Constructor for ExpVector. Converts a String representation to an ExpVector. Accepted format = (1,2,3,4,5,6,7).

Parameters:
s - String representation.
Throws:
java.lang.NumberFormatException
Method Detail

clone

public ExpVectorByte clone()
Clone this.

Specified by:
clone in class ExpVector
See Also:
Object.clone()

getVal

public long getVal(int i)
Get the exponent at position i.

Specified by:
getVal in class ExpVector
Parameters:
i - position.
Returns:
val[i].

setVal

protected long setVal(int i,
                      long e)
Set the exponent at position i to e.

Specified by:
setVal in class ExpVector
Parameters:
i -
e -
Returns:
old val[i].

setVal

protected byte setVal(int i,
                      byte 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.

Specified by:
length in class ExpVector
Returns:
val.length.

extend

public ExpVectorByte extend(int i,
                            int j,
                            long e)
Extend variables. Used e.g. in module embedding. Extend this by i elements and set val[j] to e.

Specified by:
extend in class ExpVector
Parameters:
i - number of elements to extend.
j - index of element to be set.
e - new exponent for val[j].
Returns:
extended exponent vector.

extendLower

public ExpVectorByte extendLower(int i,
                                 int j,
                                 long e)
Extend lower variables. Extend this by i lower elements and set val[j] to e.

Specified by:
extendLower in class ExpVector
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

public ExpVectorByte contract(int i,
                              int len)
Contract variables. Used e.g. in module embedding. Contract this to len elements.

Specified by:
contract in class ExpVector
Parameters:
i - position of first element to be copied.
len - new length.
Returns:
contracted exponent vector.

reverse

public ExpVectorByte reverse()
Reverse variables. Used e.g. in opposite rings.

Specified by:
reverse in class ExpVector
Returns:
reversed exponent vector.

reverse

public ExpVectorByte reverse(int j)
Reverse j variables. Used e.g. in opposite rings. Reverses the first j-1 variables, the rest is unchanged.

Specified by:
reverse in class ExpVector
Parameters:
j - index of first variable not reversed.
Returns:
reversed exponent vector.

combine

public ExpVectorByte combine(ExpVector V)
Combine with ExpVector. Combine this with the other ExpVector V.

Specified by:
combine in class ExpVector
Parameters:
V - the other exponent vector.
Returns:
combined exponent vector.

toString

public java.lang.String toString()
Get the string representation.

Overrides:
toString in class ExpVector
See Also:
Object.toString()

equals

public boolean equals(java.lang.Object B)
Comparison with any other object.

Specified by:
equals in interface Element<ExpVector>
Overrides:
equals in class ExpVector
Returns:
true if this is equal to b, else false.
See Also:
Object.equals(java.lang.Object)

abs

public ExpVectorByte abs()
ExpVector absolute value.

Specified by:
abs in interface AbelianGroupElem<ExpVector>
Specified by:
abs in class ExpVector
Returns:
abs(this).

negate

public ExpVectorByte negate()
ExpVector negate.

Specified by:
negate in interface AbelianGroupElem<ExpVector>
Specified by:
negate in class ExpVector
Returns:
-this.

sum

public ExpVectorByte sum(ExpVector V)
ExpVector summation.

Specified by:
sum in interface AbelianGroupElem<ExpVector>
Specified by:
sum in class ExpVector
Parameters:
V -
Returns:
this+V.

subtract

public ExpVectorByte subtract(ExpVector V)
ExpVector subtract. Result may have negative entries.

Specified by:
subtract in interface AbelianGroupElem<ExpVector>
Specified by:
subtract in class ExpVector
Parameters:
V -
Returns:
this-V.

subst

public ExpVectorByte subst(int i,
                           byte d)
ExpVector substitution. Clone and set exponent to d at position i.

Parameters:
i - position.
d - new exponent.
Returns:
substituted ExpVector.

subst

public ExpVectorByte subst(int i,
                           long d)
ExpVector substitution. Clone and set exponent to d at position i.

Overrides:
subst in class ExpVector
Parameters:
i - position.
d - new exponent.
Returns:
substituted ExpVector.

signum

public int signum()
ExpVector signum.

Specified by:
signum in interface AbelianGroupElem<ExpVector>
Specified by:
signum in class ExpVector
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.

Specified by:
totalDeg in class ExpVector
Returns:
sum of all exponents.

maxDeg

public long maxDeg()
ExpVector maximal degree.

Specified by:
maxDeg in class ExpVector
Returns:
maximal exponent.

weightDeg

public long weightDeg(long[][] w)
ExpVector weighted degree.

Specified by:
weightDeg in class ExpVector
Parameters:
w - weights.
Returns:
weighted sum of all exponents.

lcm

public ExpVectorByte lcm(ExpVector V)
ExpVector least common multiple.

Specified by:
lcm in class ExpVector
Parameters:
V -
Returns:
component wise maximum of this and V.

gcd

public ExpVectorByte gcd(ExpVector V)
ExpVector greatest common divisor.

Specified by:
gcd in class ExpVector
Parameters:
V -
Returns:
component wise minimum of this and V.

dependencyOnVariables

public int[] dependencyOnVariables()
ExpVector dependency on variables.

Specified by:
dependencyOnVariables in class ExpVector
Returns:
array of indices where val has positive exponents.

multipleOf

public boolean multipleOf(ExpVector V)
ExpVector multiple test. Test if this is component wise greater or equal to V.

Specified by:
multipleOf in class ExpVector
Parameters:
V -
Returns:
true if this is a multiple of V, else false.

compareTo

public int compareTo(ExpVector V)
ExpVector compareTo.

Specified by:
compareTo in interface Element<ExpVector>
Specified by:
compareTo in interface java.lang.Comparable<ExpVector>
Overrides:
compareTo in class ExpVector
Parameters:
V -
Returns:
0 if U == V, -1 if U < V, 1 if U > V.

invLexCompareTo

public int invLexCompareTo(ExpVector V)
ExpVector inverse lexicographical compareTo.

Specified by:
invLexCompareTo in class ExpVector
Parameters:
V -
Returns:
0 if U == V, -1 if U < V, 1 if U > V.

invLexCompareTo

public int invLexCompareTo(ExpVector V,
                           int begin,
                           int end)
ExpVector inverse lexicographical compareTo.

Specified by:
invLexCompareTo in class ExpVector
Parameters:
V -
begin -
end -
Returns:
0 if U == V, -1 if U < V, 1 if U > V.

invGradCompareTo

public int invGradCompareTo(ExpVector V)
ExpVector inverse graded lexicographical compareTo.

Specified by:
invGradCompareTo in class ExpVector
Parameters:
V -
Returns:
0 if U == V, -1 if U < V, 1 if U > V.

invGradCompareTo

public int invGradCompareTo(ExpVector V,
                            int begin,
                            int end)
ExpVector inverse graded lexicographical compareTo.

Specified by:
invGradCompareTo in class ExpVector
Parameters:
V -
begin -
end -
Returns:
0 if U == V, -1 if U < V, 1 if U > V.

revInvLexCompareTo

public int revInvLexCompareTo(ExpVector V)
ExpVector reverse inverse lexicographical compareTo.

Specified by:
revInvLexCompareTo in class ExpVector
Parameters:
V -
Returns:
0 if U == V, -1 if U < V, 1 if U > V.

revInvLexCompareTo

public int revInvLexCompareTo(ExpVector V,
                              int begin,
                              int end)
ExpVector reverse inverse lexicographical compareTo.

Specified by:
revInvLexCompareTo in class ExpVector
Parameters:
V -
begin -
end -
Returns:
0 if U == V, -1 if U < V, 1 if U > V.

revInvGradCompareTo

public int revInvGradCompareTo(ExpVector V)
ExpVector reverse inverse graded compareTo.

Specified by:
revInvGradCompareTo in class ExpVector
Parameters:
V -
Returns:
0 if U == V, -1 if U < V, 1 if U > V.

revInvGradCompareTo

public int revInvGradCompareTo(ExpVector V,
                               int begin,
                               int end)
ExpVector reverse inverse graded compareTo.

Specified by:
revInvGradCompareTo in class ExpVector
Parameters:
V -
begin -
end -
Returns:
0 if U == V, -1 if U < V, 1 if U > V.

invWeightCompareTo

public int invWeightCompareTo(long[][] w,
                              ExpVector V)
ExpVector inverse weighted lexicographical compareTo.

Specified by:
invWeightCompareTo in class ExpVector
Parameters:
w - weight array.
V -
Returns:
0 if U == V, -1 if U < V, 1 if U > V.

invWeightCompareTo

public int invWeightCompareTo(long[][] w,
                              ExpVector V,
                              int begin,
                              int end)
ExpVector inverse weighted lexicographical compareTo.

Specified by:
invWeightCompareTo in class ExpVector
Parameters:
w - weight array.
V -
begin -
end -
Returns:
0 if U == V, -1 if U < V, 1 if U > V.