Poly
- the type of polynomial (self type)public interface IPolynomial<Poly extends IPolynomial<Poly>> extends Comparable<Poly>, Stringifiable<Poly>, Serializable
add(oth),
multiply(oth), monic()
etc.) applies to this
inplace and return this
reference ( so e.g. (poly == poly.add(other))
).
Note: modifier operations are not synchronized.
Modifier and Type | Method and Description |
---|---|
default Poly |
add(Poly... oth)
Adds
oth to this . |
Poly |
add(Poly oth)
Adds
oth to this . |
default void |
assertSameCoefficientRingWith(Poly oth)
Checks whether
oth and this have the same coefficient ring, if not exception will be thrown |
default Poly |
canonical()
Makes this poly monic if coefficient ring is field, otherwise makes this primitive
|
Poly |
ccAsPoly()
Returns the constant coefficient as a constant poly
|
Poly |
clone()
Deep copy of this
|
BigInteger |
coefficientRingCardinality()
Returns cardinality of the coefficient ring of this poly
|
BigInteger |
coefficientRingCharacteristic()
Returns characteristic of the coefficient ring of this poly
|
BigInteger |
coefficientRingPerfectPowerBase()
Returns
base so that coefficientRingCardinality() == base^exponent or null if cardinality is not
finite |
BigInteger |
coefficientRingPerfectPowerExponent()
Returns
exponent so that coefficientRingCardinality() == base^exponent or null if cardinality is
not finite |
default String |
coefficientRingToString()
String representation of the coefficient ring of this
|
String |
coefficientRingToString(IStringifier<Poly> stringifier)
String representation of the coefficient ring of this
|
Poly |
contentAsPoly()
Returns the content of this (gcd of coefficients) as a constant poly
|
default Poly |
copy()
Deep copy of this (alias for
clone() , required for scala) |
Poly[] |
createArray(int length)
overcome Java generics...
|
default Poly[] |
createArray(Poly a)
overcome Java generics...
|
default Poly[] |
createArray(Poly a,
Poly b)
overcome Java generics...
|
default Poly[] |
createArray(Poly a,
Poly b,
Poly c)
overcome Java generics...
|
Poly[][] |
createArray2d(int length)
overcome Java generics...
|
Poly[][] |
createArray2d(int length1,
int length2)
overcome Java generics...
|
default Poly |
createConstant(long value)
Creates constant polynomial with specified value
|
Poly |
createOne()
Returns the new instance of unit polynomial (with the same coefficient ring)
|
Poly |
createZero()
Returns the new instance of zero polynomial (with the same coefficient ring)
|
Poly |
decrement()
Subtracts 1 from this
|
int |
degree()
Returns the degree of this polynomial
|
Poly |
divideByLC(Poly other)
Divides this polynomial by the leading coefficient of
other or returns null (causing loss of
internal data) if some of the elements can't be exactly divided by the other.lc() . |
Poly |
increment()
Adds 1 to this
|
boolean |
isConstant()
Returns
true if this polynomial has only constant term |
boolean |
isLinearExactly()
Returns whether this polynomial is linear (i.e.
|
boolean |
isLinearOrConstant()
Returns whether this polynomial is linear (i.e.
|
boolean |
isMonic()
Returns
true if this polynomial is monic |
boolean |
isMonomial()
Returns
true if this polynomial has only one monomial term |
boolean |
isOne()
Returns
true if this is one |
boolean |
isOverField()
Returns whether the coefficient ring of this polynomial is a field
|
boolean |
isOverFiniteField()
Returns whether the coefficient ring of this polynomial is a finite field
|
boolean |
isOverPerfectPower()
Returns whether the
coefficientRingCardinality() is a perfect power |
boolean |
isOverZ()
Returns whether the coefficient ring of this polynomial is Z
|
boolean |
isUnitCC()
Returns true if constant term is equal to one
|
boolean |
isZero()
Returns
true if this is zero |
boolean |
isZeroCC()
Returns true if constant term is zero
|
Poly |
lcAsPoly()
Returns the leading coefficient as a constant poly
|
Poly |
monic()
Sets
this to its monic part (that is this divided by its leading coefficient), or returns null (causing loss of internal data) if some of the elements can't be exactly divided by the lc() . |
default Poly |
monicExact()
Sets
this to its monic part (that is this divided by its leading coefficient), or throws ArithmeticException if some of the elements can't be exactly divided by the l.c. |
Poly |
monicWithLC(Poly other)
Sets
this to its monic part multiplied by the leading coefficient of other ; |
default Poly |
multiply(Iterable<Poly> oth)
Multiplies this by
oth |
Poly |
multiply(long factor)
Multiplies this by
factor |
default Poly |
multiply(Poly... oth)
Multiplies this by
oth |
Poly |
multiply(Poly oth)
Multiplies this by
oth |
Poly |
multiplyByBigInteger(BigInteger factor)
Multiplies this by
factor |
Poly |
multiplyByLC(Poly other)
Multiply this by the leading coefficient of
other |
Poly |
negate()
Negates this and returns
|
Poly |
parsePoly(String string)
Deprecated.
use
Coder to parse polynomials |
Poly |
primitivePart()
Reduces poly to its primitive part (primitive part will always have positive l.c.)
|
Poly |
primitivePartSameSign()
Reduces poly to its primitive part, so that primitive part will have the same signum as the initial poly
|
boolean |
sameCoefficientRingWith(Poly oth)
Returns whether
oth and this have the same coefficient ring |
Poly |
set(Poly oth)
Sets the content of this to
oth |
Poly |
setCoefficientRingFrom(Poly poly)
Set the coefficient ring from specified poly
|
default Poly |
setCoefficientRingFromOptional(Poly poly) |
int |
signumOfLC()
Gives signum of the leading coefficient
|
int |
size()
Returns the size of this polynomial
|
Poly |
square()
Squares
this |
default Poly |
subtract(Poly... oth)
Subtracts
oth from this . |
Poly |
subtract(Poly oth)
Subtracts
oth from this . |
default Poly |
toPositiveLC()
If signum of leading coefficient is minus one, negate this
|
default String |
toString(String... variables)
String representation of this polynomial with specified string variables
|
Poly |
toZero()
Sets this to zero
|
compareTo
toString
boolean sameCoefficientRingWith(Poly oth)
oth
and this
have the same coefficient ringoth
- other polynomialdefault void assertSameCoefficientRingWith(Poly oth)
oth
and this
have the same coefficient ring, if not exception will be thrownoth
- other polynomialIllegalArgumentException
- if this and oth have different coefficient ringPoly setCoefficientRingFrom(Poly poly)
poly
- the polynomialpoly
int degree()
int size()
boolean isZero()
true
if this is zerothis
is zeroboolean isOne()
true
if this is onethis
is oneboolean isMonic()
true
if this polynomial is monicthis
is monicboolean isUnitCC()
boolean isZeroCC()
boolean isConstant()
true
if this polynomial has only constant termthis
is constantboolean isMonomial()
true
if this polynomial has only one monomial termthis
has only one monomial termboolean isOverField()
boolean isOverZ()
boolean isOverFiniteField()
boolean isLinearOrConstant()
a * X + b
)boolean isLinearExactly()
a * X + b
with nonzero a
)BigInteger coefficientRingCardinality()
BigInteger coefficientRingCharacteristic()
boolean isOverPerfectPower()
coefficientRingCardinality()
is a perfect powercoefficientRingCardinality()
is a perfect powerBigInteger coefficientRingPerfectPowerBase()
base
so that coefficientRingCardinality() == base^exponent
or null if cardinality is not
finitebase
so that coefficientRingCardinality() == base^exponent
or null if cardinality is not
finiteBigInteger coefficientRingPerfectPowerExponent()
exponent
so that coefficientRingCardinality() == base^exponent
or null if cardinality is
not finiteexponent
so that coefficientRingCardinality() == base^exponent
or null if cardinality is
not finitePoly monic()
this
to its monic part (that is this
divided by its leading coefficient), or returns null
(causing loss of internal data) if some of the elements can't be exactly divided by the lc()
. NOTE:
if null
is returned, the content of this
is destroyed.this
or null
default Poly monicExact()
this
to its monic part (that is this
divided by its leading coefficient), or throws ArithmeticException
if some of the elements can't be exactly divided by the l.c.this
or null
ArithmeticException
- if some of the elements can't be exactly divided by the l.c.default Poly canonical()
int signumOfLC()
default Poly toPositiveLC()
Poly toZero()
Poly set(Poly oth)
oth
oth
- the polynomialPoly primitivePart()
Poly primitivePartSameSign()
Poly increment()
this + 1
Poly decrement()
this - 1
Poly createZero()
Poly createOne()
default Poly createConstant(long value)
value
- the valuedefault Poly add(Poly... oth)
oth
to this
.oth
- the polynomialsthis + oth
Poly subtract(Poly oth)
oth
from this
.oth
- the polynomialthis - oth
default Poly subtract(Poly... oth)
oth
from this
.oth
- the polynomialthis - oth
Poly negate()
Poly multiply(Poly oth)
oth
oth
- the polynomialthis * oth
default Poly multiply(Poly... oth)
oth
oth
- the polynomialsthis * oth
default Poly multiply(Iterable<Poly> oth)
oth
oth
- the polynomialsthis * oth
Poly multiply(long factor)
factor
factor
- the factorthis * factor
Poly multiplyByBigInteger(BigInteger factor)
factor
factor
- the factorthis * factor
Poly square()
this
this * this
Poly contentAsPoly()
Poly lcAsPoly()
Poly ccAsPoly()
Poly divideByLC(Poly other)
other
or returns null
(causing loss of
internal data) if some of the elements can't be exactly divided by the other.lc()
. NOTE: if null
is returned, the content of this
is destroyed.other
- the polynomialthis
divided by the other.lc()
or null
if exact division is not possiblePoly monicWithLC(Poly other)
this
to its monic part multiplied by the leading coefficient of other
;other
- other polynomialother
or null if exact division by the
reduced leading coefficient is not possiblePoly multiplyByLC(Poly other)
other
other
- polynomialPoly clone()
default Poly copy()
clone()
, required for scala)Poly[] createArray(int length)
Poly[][] createArray2d(int length)
Poly[][] createArray2d(int length1, int length2)
String coefficientRingToString(IStringifier<Poly> stringifier)
default String coefficientRingToString()
default String toString(String... variables)
@Deprecated Poly parsePoly(String string)
Coder
to parse polynomialsCopyright © 2018. All rights reserved.