Package edu.jas.application
Class CPair<C extends RingElem<C>>
java.lang.Object
edu.jas.application.CPair<C>
- Type Parameters:
C
- coefficient type
- All Implemented Interfaces:
Serializable
,Comparable<CPair<C>>
public class CPair<C extends RingElem<C>>
extends Object
implements Serializable, Comparable<CPair<C>>
Serializable subclass to hold pairs of colored polynomials.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal int
final int
protected int
final ColorPolynomial
<C> final ColorPolynomial
<C> protected boolean
protected boolean
protected boolean
-
Constructor Summary
ConstructorsConstructorDescriptionCPair
(ColorPolynomial<C> a, ColorPolynomial<C> b, int i, int j) Pair constructor. -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo used in TreeMap.boolean
equals.int
Get removed pair number.boolean
Get useCriterion3.boolean
Get useCriterion4.int
hashCode()
Hash code for this pair.boolean
isZero()
Is reduced to zero.void
pairNumber
(int n) Set removed pair number.void
setUseCriterion3
(boolean c) Set useCriterion3.void
setUseCriterion4
(boolean c) Set useCriterion4.void
setZero()
Set zero reduction.toString()
toString.
-
Field Details
-
pi
-
pj
-
i
public final int i -
j
public final int j -
n
protected int n -
toZero
protected boolean toZero -
useCriterion4
protected boolean useCriterion4 -
useCriterion3
protected boolean useCriterion3
-
-
Constructor Details
-
CPair
Pair constructor.- Parameters:
a
- polynomial i.b
- polynomial j.i
- first index.j
- second index.
-
-
Method Details
-
toString
toString. -
pairNumber
public void pairNumber(int n) Set removed pair number.- Parameters:
n
- number of this pair generated in OrderedPairlist.
-
getPairNumber
public int getPairNumber()Get removed pair number.- Returns:
- n number of this pair generated in OrderedPairlist.
-
setZero
public void setZero()Set zero reduction. The S-polynomial of this Pair was reduced to zero. -
isZero
public boolean isZero()Is reduced to zero.- Returns:
- true if the S-polynomial of this Pair was reduced to zero, else false.
-
equals
equals. -
compareTo
compareTo used in TreeMap. Comparison is based on the number of the pairs.- Specified by:
compareTo
in interfaceComparable<C extends RingElem<C>>
- Parameters:
p
- a Pair.- Returns:
- 1 if (this < p), 0 if (this == o), -1 if (this > p).
-
hashCode
public int hashCode()Hash code for this pair. -
setUseCriterion4
public void setUseCriterion4(boolean c) Set useCriterion4.- Parameters:
c
- boolean value to set.
-
getUseCriterion4
public boolean getUseCriterion4()Get useCriterion4.- Returns:
- boolean value.
-
setUseCriterion3
public void setUseCriterion3(boolean c) Set useCriterion3.- Parameters:
c
- boolean value to set.
-
getUseCriterion3
public boolean getUseCriterion3()Get useCriterion3.- Returns:
- boolean value.
-