|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.jas.poly.ExpVector
public abstract class ExpVector
ExpVector implements exponent vectors for polynomials.
Exponent vectors are implemented as arrays of Java elementary types,
like long, int, short and byte.
ExpVector provides also the familiar MAS static method names.
The implementation is only tested for nonnegative exponents
but should work also for negative exponents.
Objects of this class are intended to be immutable, but
exponents can be set (during construction);
also the hash code is only computed once, when needed.
The different storage unit implementations are ExpVectorLong
ExpVectorInteger
, ExpVectorShort
and ExpVectorByte
.
The static factory methods create()
of ExpVector
select the respective storage unit.
The selection of the desired storage unit is internally done via the static variable
storunit
. This varaible should not be changed dynamically.
Nested Class Summary | |
---|---|
static class |
ExpVector.StorUnit
Storage representation of exponent arrays. |
Field Summary | |
---|---|
protected int |
hash
Stored hash code. |
static ExpVector.StorUnit |
storunit
Used storage representation of exponent arrays. |
Constructor Summary | |
---|---|
ExpVector()
Constructor for ExpVector. |
Method Summary | ||
---|---|---|
abstract ExpVector |
abs()
ExpVector absolute value. |
|
abstract ExpVector |
clone()
Clone this. |
|
abstract ExpVector |
combine(ExpVector V)
Combine with ExpVector. |
|
int |
compareTo(ExpVector V)
ExpVector compareTo. |
|
abstract ExpVector |
contract(int i,
int len)
Contract variables. |
|
static ExpVector |
create(java.util.Collection<java.lang.Long> v)
Factory constructor for ExpVector. |
|
static ExpVector |
create(int n)
Factory constructor for ExpVector. |
|
static ExpVector |
create(int n,
int i,
long e)
Factory constructor for ExpVector. |
|
static ExpVector |
create(long[] v)
Internal factory constructor for ExpVector. |
|
static ExpVector |
create(java.lang.String s)
Factory constructor for ExpVector. |
|
abstract int[] |
dependencyOnVariables()
ExpVector dependency on variables. |
|
boolean |
divides(ExpVector V)
ExpVector divides test. |
|
boolean |
equals(java.lang.Object B)
Comparison with any other object. |
|
static ExpVector |
EVABS(ExpVector U)
ExpVector absolute value. |
|
|
evaluate(RingFactory<C> cf,
java.util.List<C> a)
Evaluate. |
|
static ExpVector |
EVDIF(ExpVector U,
ExpVector V)
ExpVector difference. |
|
static int[] |
EVDOV(ExpVector U)
ExpVector dependency on variables. |
|
static ExpVector |
EVGCD(ExpVector U,
ExpVector V)
ExpVector greatest common divisor. |
|
static int |
EVIGLC(ExpVector U,
ExpVector V)
Inverse graded lexicographical compare. |
|
static int |
EVIGLC(ExpVector U,
ExpVector V,
int begin,
int end)
Inverse graded lexicographical compare part. |
|
static int |
EVILCP(ExpVector U,
ExpVector V)
Inverse lexicographical compare. |
|
static int |
EVILCP(ExpVector U,
ExpVector V,
int begin,
int end)
Inverse lexicographical compare part. |
|
static int |
EVIWLC(long[][] w,
ExpVector U,
ExpVector V)
Inverse weighted lexicographical compare. |
|
static int |
EVIWLC(long[][] w,
ExpVector U,
ExpVector V,
int begin,
int end)
Inverse weighted lexicographical compare part. |
|
static ExpVector |
EVLCM(ExpVector U,
ExpVector V)
ExpVector least common multiple. |
|
static long |
EVMDEG(ExpVector U)
ExpVector maximal degree. |
|
static boolean |
EVMT(ExpVector U,
ExpVector V)
ExpVector multiple test. |
|
static ExpVector |
EVNEG(ExpVector U)
ExpVector negate. |
|
static ExpVector |
EVRAND(int r,
long k,
float q)
Generate a random ExpVector. |
|
static ExpVector |
EVRAND(int r,
long k,
float q,
java.util.Random rnd)
Generate a random ExpVector. |
|
static int |
EVRIGLC(ExpVector U,
ExpVector V)
Reverse inverse graded lexicographical compare. |
|
static int |
EVRIGLC(ExpVector U,
ExpVector V,
int begin,
int end)
Reverse inverse graded lexicographical compare part. |
|
static int |
EVRILCP(ExpVector U,
ExpVector V)
Reverse inverse lexicographical compare. |
|
static int |
EVRILCP(ExpVector U,
ExpVector V,
int begin,
int end)
Reverse inverse lexicographical compare part. |
|
static int |
EVSIGN(ExpVector U)
ExpVector sign. |
|
static ExpVector |
EVSU(ExpVector U,
int i,
long d)
ExpVector substitution. |
|
static ExpVector |
EVSUM(ExpVector U,
ExpVector V)
ExpVector summation. |
|
static long |
EVTDEG(ExpVector U)
ExpVector total degree. |
|
static long |
EVWDEG(long[][] w,
ExpVector U)
ExpVector weighted degree. |
|
abstract ExpVector |
extend(int i,
int j,
long e)
Extend variables. |
|
abstract ExpVector |
extendLower(int i,
int j,
long e)
Extend lower variables. |
|
AbelianGroupFactory<ExpVector> |
factory()
Get the corresponding element factory. |
|
abstract ExpVector |
gcd(ExpVector V)
ExpVector greatest common divisor. |
|
abstract long |
getVal(int i)
Get the exponent at position i. |
|
int |
hashCode()
hashCode. |
|
int |
indexVar(java.lang.String x,
java.lang.String... vars)
Get the index of a variable. |
|
java.lang.String |
indexVarName(int idx,
java.lang.String... vars)
Get the variable name at index. |
|
abstract int |
invGradCompareTo(ExpVector V)
ExpVector inverse graded lexicographical compareTo. |
|
abstract int |
invGradCompareTo(ExpVector V,
int begin,
int end)
ExpVector inverse graded lexicographical compareTo. |
|
abstract int |
invLexCompareTo(ExpVector V)
ExpVector inverse lexicographical compareTo. |
|
abstract int |
invLexCompareTo(ExpVector V,
int begin,
int end)
ExpVector inverse lexicographical compareTo. |
|
abstract int |
invWeightCompareTo(long[][] w,
ExpVector V)
ExpVector inverse weighted lexicographical compareTo. |
|
abstract int |
invWeightCompareTo(long[][] w,
ExpVector V,
int begin,
int end)
ExpVector inverse weighted lexicographical compareTo. |
|
boolean |
isFinite()
Is this structure finite or infinite. |
|
boolean |
isZERO()
Is ExpVector zero. |
|
abstract ExpVector |
lcm(ExpVector V)
ExpVector least common multiple. |
|
abstract int |
length()
Get the length of this exponent vector. |
|
abstract long |
maxDeg()
ExpVector maximal degree. |
|
abstract boolean |
multipleOf(ExpVector V)
ExpVector multiple test. |
|
abstract ExpVector |
negate()
ExpVector negate. |
|
static ExpVector |
random(int r,
long k,
float q)
Generate a random ExpVector. |
|
static ExpVector |
random(int r,
long k,
float q,
java.util.Random rnd)
Generate a random ExpVector. |
|
abstract ExpVector |
reverse()
Reverse variables. |
|
abstract ExpVector |
reverse(int j)
Reverse j variables. |
|
abstract int |
revInvGradCompareTo(ExpVector V)
ExpVector reverse inverse graded compareTo. |
|
abstract int |
revInvGradCompareTo(ExpVector V,
int begin,
int end)
ExpVector reverse inverse graded compareTo. |
|
abstract int |
revInvLexCompareTo(ExpVector V)
ExpVector reverse inverse lexicographical compareTo. |
|
abstract int |
revInvLexCompareTo(ExpVector V,
int begin,
int end)
ExpVector reverse inverse lexicographical compareTo. |
|
protected abstract long |
setVal(int i,
long e)
Set the exponent at position i to e. |
|
abstract int |
signum()
ExpVector signum. |
|
java.lang.String[] |
stdVars()
Standard variable names. |
|
static java.lang.String[] |
STDVARS(int n)
Standard variable names. |
|
java.lang.String[] |
stdVars(java.lang.String prefix)
Generate variable names. |
|
static java.lang.String[] |
STDVARS(java.lang.String prefix,
int n)
Generate variable names. |
|
ExpVector |
subst(int i,
long d)
ExpVector substitution. |
|
abstract ExpVector |
subtract(ExpVector V)
ExpVector subtract. |
|
abstract ExpVector |
sum(ExpVector V)
ExpVector summation. |
|
java.lang.String |
toScript()
Get a scripting compatible string representation. |
|
java.lang.String |
toScript(java.lang.String[] vars)
Get a scripting compatible string representation. |
|
java.lang.String |
toScriptFactory()
Get a scripting compatible string representation of the factory. |
|
java.lang.String |
toString()
Get the string representation. |
|
java.lang.String |
toString(java.lang.String[] vars)
Get the string representation with variable names. |
|
abstract long |
totalDeg()
ExpVector total degree. |
|
int |
varIndex(int idx)
Get the array index of a variable at index. |
|
abstract long |
weightDeg(long[][] w)
ExpVector weighted degree. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected int hash
public static final ExpVector.StorUnit storunit
Constructor Detail |
---|
public ExpVector()
Method Detail |
---|
public static ExpVector create(int n)
n
- length of exponent vector.public static ExpVector create(int n, int i, long e)
n
- length of exponent vector.i
- index of exponent to be set.e
- exponent to be set.public static ExpVector create(long[] v)
v
- internal representation array.public static ExpVector create(java.lang.String s)
s
- String representation.public static ExpVector create(java.util.Collection<java.lang.Long> v)
v
- collection of exponents.public AbelianGroupFactory<ExpVector> factory()
factory
in interface Element<ExpVector>
Element.factory()
public boolean isFinite()
Note: returns true because of finite set of values in each index.
public abstract ExpVector clone()
clone
in class java.lang.Object
Object.clone()
public abstract long getVal(int i)
i
- position.
protected abstract long setVal(int i, long e)
i
- e
-
public abstract int length()
public abstract ExpVector extend(int i, int j, long e)
i
- number of elements to extend.j
- index of element to be set.e
- new exponent for val[j].
public abstract ExpVector extendLower(int i, int j, long e)
i
- number of elements to extend.j
- index of element to be set.e
- new exponent for val[j].
public abstract ExpVector contract(int i, int len)
i
- position of first element to be copied.len
- new length.
public abstract ExpVector reverse()
public abstract ExpVector reverse(int j)
j
- index of first variable not reversed.
public abstract ExpVector combine(ExpVector V)
V
- the other exponent vector.
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public java.lang.String toString(java.lang.String[] vars)
vars
- names of variables.Object.toString()
public java.lang.String toScript()
toScript
in interface Element<ExpVector>
Element.toScript()
public java.lang.String toScript(java.lang.String[] vars)
Element.toScript()
public java.lang.String toScriptFactory()
toScriptFactory
in interface Element<ExpVector>
Element.toScriptFactory()
public java.lang.String indexVarName(int idx, java.lang.String... vars)
idx
- index of the variablevars
- array of names of variables
public int varIndex(int idx)
idx
- index of the variable
public int indexVar(java.lang.String x, java.lang.String... vars)
x
- variable name to be searched.vars
- array of names of variables
public <C extends RingElem<C>> C evaluate(RingFactory<C> cf, java.util.List<C> a)
cf
- ring factory for elements of a.a
- list of values.
public boolean equals(java.lang.Object B)
equals
in interface Element<ExpVector>
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in interface Element<ExpVector>
hashCode
in class java.lang.Object
Object.hashCode()
public boolean isZERO()
isZERO
in interface AbelianGroupElem<ExpVector>
public java.lang.String[] stdVars()
public java.lang.String[] stdVars(java.lang.String prefix)
prefix
- name prefix.
public static java.lang.String[] STDVARS(int n)
n
- size of names array
public static java.lang.String[] STDVARS(java.lang.String prefix, int n)
n
- size of names array.prefix
- name prefix.
public static ExpVector EVABS(ExpVector U)
U
-
public abstract ExpVector abs()
abs
in interface AbelianGroupElem<ExpVector>
public static ExpVector EVNEG(ExpVector U)
U
-
public abstract ExpVector negate()
negate
in interface AbelianGroupElem<ExpVector>
public static ExpVector EVSUM(ExpVector U, ExpVector V)
U
- V
-
public abstract ExpVector sum(ExpVector V)
sum
in interface AbelianGroupElem<ExpVector>
V
-
public static ExpVector EVDIF(ExpVector U, ExpVector V)
U
- V
-
public abstract ExpVector subtract(ExpVector V)
subtract
in interface AbelianGroupElem<ExpVector>
V
-
public static ExpVector EVSU(ExpVector U, int i, long d)
U
- i
- position.d
- new exponent.
public ExpVector subst(int i, long d)
i
- position.d
- new exponent.
public static ExpVector EVRAND(int r, long k, float q)
r
- length of new ExpVector.k
- maximal degree in each exponent.q
- density of nozero exponents.
public static ExpVector EVRAND(int r, long k, float q, java.util.Random rnd)
r
- length of new ExpVector.k
- maximal degree in each exponent.q
- density of nozero exponents.rnd
- is a source for random bits.
public static ExpVector random(int r, long k, float q)
r
- length of new ExpVector.k
- maximal degree in each exponent.q
- density of nozero exponents.
public static ExpVector random(int r, long k, float q, java.util.Random rnd)
r
- length of new ExpVector.k
- maximal degree in each exponent.q
- density of nozero exponents.rnd
- is a source for random bits.
public static int EVSIGN(ExpVector U)
U
-
public abstract int signum()
signum
in interface AbelianGroupElem<ExpVector>
public static long EVTDEG(ExpVector U)
U
-
public abstract long totalDeg()
public static long EVMDEG(ExpVector U)
U
-
public abstract long maxDeg()
public static long EVWDEG(long[][] w, ExpVector U)
w
- weights.U
-
public abstract long weightDeg(long[][] w)
w
- weights.
public static ExpVector EVLCM(ExpVector U, ExpVector V)
U
- V
-
public abstract ExpVector lcm(ExpVector V)
V
-
public static ExpVector EVGCD(ExpVector U, ExpVector V)
U
- V
-
public abstract ExpVector gcd(ExpVector V)
V
-
public static int[] EVDOV(ExpVector U)
U
-
public abstract int[] dependencyOnVariables()
public static boolean EVMT(ExpVector U, ExpVector V)
U
- V
-
public abstract boolean multipleOf(ExpVector V)
V
-
public boolean divides(ExpVector V)
V
-
public int compareTo(ExpVector V)
compareTo
in interface Element<ExpVector>
compareTo
in interface java.lang.Comparable<ExpVector>
V
-
public static int EVILCP(ExpVector U, ExpVector V)
U
- V
-
public abstract int invLexCompareTo(ExpVector V)
V
-
public static int EVILCP(ExpVector U, ExpVector V, int begin, int end)
U
- V
- begin
- end
-
public abstract int invLexCompareTo(ExpVector V, int begin, int end)
V
- begin
- end
-
public static int EVIGLC(ExpVector U, ExpVector V)
U
- V
-
public abstract int invGradCompareTo(ExpVector V)
V
-
public static int EVIGLC(ExpVector U, ExpVector V, int begin, int end)
U
- V
- begin
- end
-
public abstract int invGradCompareTo(ExpVector V, int begin, int end)
V
- begin
- end
-
public static int EVRILCP(ExpVector U, ExpVector V)
U
- V
-
public abstract int revInvLexCompareTo(ExpVector V)
V
-
public static int EVRILCP(ExpVector U, ExpVector V, int begin, int end)
U
- V
- begin
- end
-
public abstract int revInvLexCompareTo(ExpVector V, int begin, int end)
V
- begin
- end
-
public static int EVRIGLC(ExpVector U, ExpVector V)
U
- V
-
public abstract int revInvGradCompareTo(ExpVector V)
V
-
public static int EVRIGLC(ExpVector U, ExpVector V, int begin, int end)
U
- V
- begin
- end
-
public abstract int revInvGradCompareTo(ExpVector V, int begin, int end)
V
- begin
- end
-
public static int EVIWLC(long[][] w, ExpVector U, ExpVector V)
w
- weight array.U
- V
-
public abstract int invWeightCompareTo(long[][] w, ExpVector V)
w
- weight array.V
-
public static int EVIWLC(long[][] w, ExpVector U, ExpVector V, int begin, int end)
w
- weight array.U
- V
- begin
- end
-
public abstract int invWeightCompareTo(long[][] w, ExpVector V, int begin, int end)
w
- weight array.V
- begin
- end
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |