public final class UnivariatePolynomialZ64 extends Object
UnivariatePolynomial
over BigIntegers.
Arithmetic operations on instances of this type may cause long overflow in which case a proper ArithmeticException
will be thrown.
Modifier and Type | Method and Description |
---|---|
lPoly |
add(long val)
Add constant to this.
|
lPoly |
add(lPoly oth)
Adds
oth to this . |
lPoly |
addMonomial(long coefficient,
int exponent)
Adds
coefficient*x^exponent to this |
lPoly |
addMul(lPoly oth,
long factor)
Adds
oth * factor to this |
long |
cc()
Returns the constant coefficient of this poly
|
lPoly |
ccAsPoly()
Returns the constant coefficient as a constant poly
|
UnivariatePolynomialZ64 |
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 |
String |
coefficientRingToString()
String representation of the coefficient ring of this
|
int |
compareTo(lPoly o) |
lPoly |
composition(lPoly value)
Calculates the composition of this(oth) (new instance, so the content of this is not changed))
|
static UnivariatePolynomialZ64 |
constant(long value)
Returns constant with specified value
|
long |
content()
Returns the content of this poly (gcd of its coefficients)
|
lPoly |
contentAsPoly()
Returns the content of this (gcd of coefficients) as a constant poly
|
static UnivariatePolynomialZ64 |
create(long... data)
Creates Z[x] polynomial from the specified coefficients
|
UnivariatePolynomialZ64[] |
createArray(int length)
overcome Java generics...
|
UnivariatePolynomialZ64[][] |
createArray2d(int length)
overcome Java generics...
|
UnivariatePolynomialZ64[][] |
createArray2d(int length1,
int length2)
overcome Java generics...
|
lPoly |
createConstant(long val)
Creates constant polynomial with specified value (with the same coefficient ring)
|
UnivariatePolynomialZ64 |
createFromArray(long[] data)
Creates new poly with the specified coefficients (over the same ring)
|
lPoly |
createLinear(long cc,
long lc)
Creates linear polynomial of form
cc + x * lc (with the same coefficient ring) |
lPoly |
createMonomial(int degree)
Creates new monomial
x^degree (with the same coefficient ring) |
UnivariatePolynomialZ64 |
createMonomial(long coefficient,
int degree)
Creates monomial
coefficient * x^degree (with the same coefficient ring) |
lPoly |
createOne()
Returns the new instance of unit polynomial (with the same coefficient ring)
|
lPoly |
createZero()
Returns the new instance of zero polynomial (with the same coefficient ring)
|
lPoly |
decrement()
Subtracts 1 from this
|
int |
degree()
Returns the degree of this polynomial
|
UnivariatePolynomialZ64 |
derivative()
Returns the formal derivative of this poly (new instance, so the content of this is not changed)
|
UnivariatePolynomialZ64 |
divideByLC(UnivariatePolynomialZ64 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() . |
UnivariatePolynomialZ64 |
divideOrNull(long factor)
Divides this polynomial by a
factor or returns null (causing loss of internal data) if some of
the elements can't be exactly divided by the factor . |
void |
ensureInternalCapacity(int desiredCapacity)
ensures that internal storage has enough size to store
desiredCapacity elements |
boolean |
equals(Object obj) |
long |
evaluate(long point)
Evaluates this poly at a given
point (via Horner method). |
long |
evaluateAtRational(long num,
long den)
Evaluates this poly at a given rational point
num/den |
int |
firstNonZeroCoefficientPosition()
Returns position of the first non-zero coefficient, that is common monomial exponent (e.g.
|
long |
get(int i)
Returns the i-th coefficient of this poly (coefficient before x^i)
|
lPoly |
getAsPoly(int i)
Returns i-th coefficient of this as a constant polynomial
|
long[] |
getDataReferenceUnsafe()
internal API >>> direct unsafe access to internal storage
|
UnivariatePolynomialZ64 |
getRange(int from,
int to)
Creates polynomial formed from the coefficients of this starting from
from (inclusive) to to
(exclusive) |
int |
hashCode() |
lPoly |
increment()
Adds 1 to this
|
boolean |
isConstant()
Returns
true if this polynomial has only constant term |
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 |
isZeroAt(int i)
Returns whether i-th coefficient of this is zero
|
long |
lc()
Returns the leading coefficient of this poly
|
lPoly |
lcAsPoly()
Returns the leading coefficient as a constant poly
|
<T> UnivariatePolynomial<T> |
mapElements(Ring<T> ring,
LongFunction<T> mapper)
Applies transformation function to this and returns the result.
|
long |
maxAbsCoefficient()
Returns max coefficient (by absolute value) of this poly
|
double |
mignotteBound()
Returns Mignotte's bound (sqrt(n+1) * 2^n max |this|)
|
UnivariatePolynomialZp64 |
modulus(IntegersZp64 ring)
Reduces (copied) polynomial modulo
modulus and returns the result. |
UnivariatePolynomialZp64 |
modulus(IntegersZp64 ring,
boolean copy)
Reduces this polynomial modulo
modulus and returns the result. |
UnivariatePolynomialZp64 |
modulus(long modulus)
Reduces (copied) polynomial modulo
modulus and returns the result. |
UnivariatePolynomialZp64 |
modulus(long modulus,
boolean copy)
Reduces this polynomial modulo
modulus and returns the result. |
UnivariatePolynomialZ64 |
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() . |
UnivariatePolynomialZ64 |
monic(long factor)
Sets
this to its monic part multiplied by the factor ; |
lPoly |
monicWithLC(lPoly other)
Sets
this to its monic part multiplied by the leading coefficient of other ; |
static UnivariatePolynomialZ64 |
monomial(long coefficient,
int exponent)
Creates monomial
coefficient * x^exponent |
lPoly |
multiply(long factor)
Multiplies this by
factor |
UnivariatePolynomialZ64 |
multiply(UnivariatePolynomialZ64 oth)
Multiplies this by
oth |
UnivariatePolynomialZ64 |
multiplyByBigInteger(BigInteger factor)
Multiplies this by
factor |
lPoly |
multiplyByLC(lPoly other)
Multiply this by the leading coefficient of
other |
lPoly |
negate()
Negates this and returns
|
double |
norm1()
Returns L1 norm of this polynomial, i.e.
|
double |
norm2()
Returns L2 norm of this polynomial, i.e.
|
double |
normMax()
Returns max coefficient (by absolute value) of this poly
|
static UnivariatePolynomialZ64 |
one()
Creates unit polynomial
|
static UnivariatePolynomialZ64 |
parse(String string)
Parse string into polynomial
|
UnivariatePolynomialZ64 |
parsePoly(String string)
Parse string representation of polynomial
|
lPoly |
primitivePart()
Reduces poly to its primitive part (primitive part will always have positive l.c.)
|
lPoly |
primitivePartSameSign()
Reduces poly to its primitive part, so that primitive part will have the same signum as the initial poly
|
lPoly |
reverse()
Reverses the coefficients of this
|
boolean |
sameCoefficientRingWith(UnivariatePolynomialZ64 oth)
Returns whether
oth and this have the same coefficient ring |
lPoly |
set(int i,
long el)
Sets i-th element of this poly with the specified value
|
lPoly |
set(lPoly oth)
Sets the content of this to
oth |
lPoly |
setAndDestroy(lPoly oth)
Sets the content of this with
oth and destroys oth |
UnivariatePolynomialZ64 |
setCoefficientRingFrom(UnivariatePolynomialZ64 univariatePolynomialZ64)
Set the coefficient ring from specified poly
|
lPoly |
setFrom(int indexInThis,
lPoly poly,
int indexInPoly)
Sets i-th element of this by j-th element of other poly
|
lPoly |
setLC(long lc)
Sets hte leading coefficient of this poly with specified value
|
lPoly |
setZero(int i)
Fills i-th element with zero
|
lPoly |
shift(long value)
Shifts variable x -> x + value and returns the result (new instance)
|
lPoly |
shiftLeft(int offset)
Returns the quotient
this / x^offset , it is polynomial with coefficient list formed by shifting
coefficients of this to the left by offset . |
lPoly |
shiftRight(int offset)
Multiplies
this by the x^offset . |
int |
signumOfLC()
Gives signum of the leading coefficient
|
UnivariatePolynomialZ64 |
square()
Squares
this |
LongStream |
stream()
Returns a sequential
Stream with coefficients of this as its source. |
lPoly |
subtract(long val)
Subtract constant from this.
|
lPoly |
subtract(lPoly oth)
Subtracts
oth from this . |
lPoly |
subtract(lPoly oth,
long factor,
int exponent)
Subtracts
factor * x^exponent * oth from this |
UnivariatePolynomial<BigInteger> |
toBigPoly()
Converts this to a polynomial over BigIntegers
|
String |
toString() |
String |
toString(String... variables)
Returns string representation of this using specified string representation for variables.
|
String |
toStringForCopy() |
lPoly |
toZero()
Sets this to zero
|
lPoly |
truncate(int newDegree)
Returns the remainder
this rem x^(newDegree + 1) , it is polynomial formed by coefficients of this from
zero to newDegree (both inclusive) |
static UnivariatePolynomialZ64 |
zero()
Creates zero polynomial
|
finalize, getClass, notify, notifyAll, wait, wait, wait
exponents, parsePoly, size
add, assertSameCoefficientRingWith, copy, createArray, createArray, monicExact, multiply, multiply, subtract
defaultVars
public static UnivariatePolynomialZ64 parse(String string)
public static UnivariatePolynomialZ64 create(long... data)
data
- coefficientspublic static UnivariatePolynomialZ64 monomial(long coefficient, int exponent)
coefficient * x^exponent
coefficient
- monomial coefficientexponent
- monomial exponentcoefficient * x^exponent
public static UnivariatePolynomialZ64 zero()
public static UnivariatePolynomialZ64 one()
public static UnivariatePolynomialZ64 constant(long value)
public UnivariatePolynomialZ64 setCoefficientRingFrom(UnivariatePolynomialZ64 univariatePolynomialZ64)
IPolynomial
univariatePolynomialZ64
- the polynomialpoly
public UnivariatePolynomialZp64 modulus(long modulus, boolean copy)
modulus
and returns the result.modulus
- the moduluscopy
- whether to copy the internal data or reduce inplace (in which case the data of this will be lost)modulus
public UnivariatePolynomialZp64 modulus(long modulus)
modulus
and returns the result.modulus
- the modulusmodulus
public UnivariatePolynomialZp64 modulus(IntegersZp64 ring, boolean copy)
modulus
and returns the result.ring
- the moduluscopy
- whether to copy the internal data or reduce inplace (in which case the data of this will be lost)modulus
public UnivariatePolynomialZp64 modulus(IntegersZp64 ring)
modulus
and returns the result.ring
- the modulusmodulus
public UnivariatePolynomial<BigInteger> toBigPoly()
Rings.Z
public double mignotteBound()
public long evaluateAtRational(long num, long den)
num/den
num
- point numeratorden
- point denominatornum/den
ArithmeticException
- if the result is not integerpublic UnivariatePolynomialZ64 getRange(int from, int to)
IUnivariatePolynomial
from
(inclusive) to to
(exclusive)from
- the initial index of the range to be copied, inclusiveto
- the final index of the range to be copied, exclusive.public UnivariatePolynomialZ64[] createArray(int length)
IPolynomial
public UnivariatePolynomialZ64[][] createArray2d(int length)
IPolynomial
public UnivariatePolynomialZ64[][] createArray2d(int length1, int length2)
IPolynomial
public boolean sameCoefficientRingWith(UnivariatePolynomialZ64 oth)
IPolynomial
oth
and this
have the same coefficient ringoth
- other polynomialpublic UnivariatePolynomialZ64 createFromArray(long[] data)
data
- the datapublic UnivariatePolynomialZ64 createMonomial(long coefficient, int degree)
coefficient * x^degree
(with the same coefficient ring)coefficient
- monomial coefficientdegree
- monomial degreecoefficient * x^degree
public boolean isOverField()
IPolynomial
public boolean isOverFiniteField()
IPolynomial
public boolean isOverZ()
IPolynomial
public BigInteger coefficientRingCardinality()
IPolynomial
public BigInteger coefficientRingCharacteristic()
IPolynomial
public boolean isOverPerfectPower()
IPolynomial
coefficientRingCardinality()
is a perfect powercoefficientRingCardinality()
is a perfect powerpublic BigInteger coefficientRingPerfectPowerBase()
IPolynomial
base
so that coefficientRingCardinality() == base^exponent
or null if cardinality is not
finitebase
so that coefficientRingCardinality() == base^exponent
or null if cardinality is not
finitepublic BigInteger coefficientRingPerfectPowerExponent()
IPolynomial
exponent
so that coefficientRingCardinality() == base^exponent
or null if cardinality is
not finiteexponent
so that coefficientRingCardinality() == base^exponent
or null if cardinality is
not finitepublic UnivariatePolynomialZ64 monic()
IPolynomial
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
public UnivariatePolynomialZ64 monic(long factor)
this
to its monic part multiplied by the factor
;factor
- the factorthis
public UnivariatePolynomialZ64 divideOrNull(long factor)
factor
or returns null
(causing loss of internal data) if some of
the elements can't be exactly divided by the factor
. NOTE: is null
is returned, the content of
this
is destroyed.factor
- the factorthis
divided by the factor
or null
public UnivariatePolynomialZ64 divideByLC(UnivariatePolynomialZ64 other)
IPolynomial
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 possiblepublic UnivariatePolynomialZ64 multiplyByBigInteger(BigInteger factor)
IPolynomial
factor
factor
- the factorthis * factor
public UnivariatePolynomialZ64 multiply(UnivariatePolynomialZ64 oth)
IPolynomial
oth
oth
- the polynomialthis * oth
public UnivariatePolynomialZ64 square()
IPolynomial
this
this * this
public UnivariatePolynomialZ64 derivative()
IUnivariatePolynomial
public UnivariatePolynomialZ64 clone()
IPolynomial
clone
in interface IPolynomial<UnivariatePolynomialZ64>
clone
in interface IUnivariatePolynomial<UnivariatePolynomialZ64>
public UnivariatePolynomialZ64 parsePoly(String string)
IPolynomial
string
- stringpublic String coefficientRingToString()
IPolynomial
public final int degree()
IPolynomial
degree
in interface IPolynomial<lPoly extends cc.redberry.rings.poly.univar.AUnivariatePolynomial64<lPoly>>
public final long get(int i)
public final lPoly set(int i, long el)
public final lPoly setLC(long lc)
public final int firstNonZeroCoefficientPosition()
IUnivariatePolynomial
firstNonZeroCoefficientPosition
in interface IUnivariatePolynomial<lPoly extends cc.redberry.rings.poly.univar.AUnivariatePolynomial64<lPoly>>
public final long lc()
public final lPoly lcAsPoly()
IPolynomial
lcAsPoly
in interface IPolynomial<lPoly extends cc.redberry.rings.poly.univar.AUnivariatePolynomial64<lPoly>>
public final lPoly ccAsPoly()
IPolynomial
ccAsPoly
in interface IPolynomial<lPoly extends cc.redberry.rings.poly.univar.AUnivariatePolynomial64<lPoly>>
public lPoly getAsPoly(int i)
IUnivariatePolynomial
getAsPoly
in interface IUnivariatePolynomial<lPoly extends cc.redberry.rings.poly.univar.AUnivariatePolynomial64<lPoly>>
i
- index in thispublic final long cc()
public final void ensureInternalCapacity(int desiredCapacity)
IUnivariatePolynomial
desiredCapacity
elementsensureInternalCapacity
in interface IUnivariatePolynomial<lPoly extends cc.redberry.rings.poly.univar.AUnivariatePolynomial64<lPoly>>
public final lPoly createMonomial(int degree)
IUnivariatePolynomial
x^degree
(with the same coefficient ring)createMonomial
in interface IUnivariatePolynomial<lPoly extends cc.redberry.rings.poly.univar.AUnivariatePolynomial64<lPoly>>
degree
- monomial degreecoefficient * x^degree
public final lPoly createLinear(long cc, long lc)
cc + x * lc
(with the same coefficient ring)cc
- the constant coefficientlc
- the leading coefficientcc + x * lc
public final lPoly createConstant(long val)
createConstant
in interface IPolynomial<lPoly extends cc.redberry.rings.poly.univar.AUnivariatePolynomial64<lPoly>>
val
- the valuepublic final lPoly createZero()
IPolynomial
createZero
in interface IPolynomial<lPoly extends cc.redberry.rings.poly.univar.AUnivariatePolynomial64<lPoly>>
public final lPoly createOne()
IPolynomial
createOne
in interface IPolynomial<lPoly extends cc.redberry.rings.poly.univar.AUnivariatePolynomial64<lPoly>>
public final boolean isZeroAt(int i)
IUnivariatePolynomial
isZeroAt
in interface IUnivariatePolynomial<lPoly extends cc.redberry.rings.poly.univar.AUnivariatePolynomial64<lPoly>>
i
- the positionpublic final lPoly setZero(int i)
IUnivariatePolynomial
setZero
in interface IUnivariatePolynomial<lPoly extends cc.redberry.rings.poly.univar.AUnivariatePolynomial64<lPoly>>
i
- positionpublic final lPoly setFrom(int indexInThis, lPoly poly, int indexInPoly)
IUnivariatePolynomial
setFrom
in interface IUnivariatePolynomial<lPoly extends cc.redberry.rings.poly.univar.AUnivariatePolynomial64<lPoly>>
indexInThis
- index in selfpoly
- other polynomialindexInPoly
- index in other polynomialpublic final boolean isZero()
IPolynomial
true
if this is zeroisZero
in interface IPolynomial<lPoly extends cc.redberry.rings.poly.univar.AUnivariatePolynomial64<lPoly>>
this
is zeropublic final boolean isOne()
IPolynomial
true
if this is oneisOne
in interface IPolynomial<lPoly extends cc.redberry.rings.poly.univar.AUnivariatePolynomial64<lPoly>>
this
is onepublic final boolean isMonic()
IPolynomial
true
if this polynomial is monicisMonic
in interface IPolynomial<lPoly extends cc.redberry.rings.poly.univar.AUnivariatePolynomial64<lPoly>>
this
is monicpublic final boolean isUnitCC()
IPolynomial
isUnitCC
in interface IPolynomial<lPoly extends cc.redberry.rings.poly.univar.AUnivariatePolynomial64<lPoly>>
public final boolean isConstant()
IPolynomial
true
if this polynomial has only constant termisConstant
in interface IPolynomial<lPoly extends cc.redberry.rings.poly.univar.AUnivariatePolynomial64<lPoly>>
this
is constantpublic final boolean isMonomial()
IPolynomial
true
if this polynomial has only one monomial termisMonomial
in interface IPolynomial<lPoly extends cc.redberry.rings.poly.univar.AUnivariatePolynomial64<lPoly>>
this
has only one monomial termpublic final int signumOfLC()
IPolynomial
signumOfLC
in interface IPolynomial<lPoly extends cc.redberry.rings.poly.univar.AUnivariatePolynomial64<lPoly>>
public final double norm1()
this
public final double norm2()
this
public final double normMax()
public final long maxAbsCoefficient()
public final lPoly toZero()
IPolynomial
toZero
in interface IPolynomial<lPoly extends cc.redberry.rings.poly.univar.AUnivariatePolynomial64<lPoly>>
public final lPoly set(lPoly oth)
IPolynomial
oth
set
in interface IPolynomial<lPoly extends cc.redberry.rings.poly.univar.AUnivariatePolynomial64<lPoly>>
oth
- the polynomialpublic final lPoly setAndDestroy(lPoly oth)
IUnivariatePolynomial
oth
and destroys othsetAndDestroy
in interface IUnivariatePolynomial<lPoly extends cc.redberry.rings.poly.univar.AUnivariatePolynomial64<lPoly>>
oth
- the polynomial (will be destroyed)public final lPoly shiftLeft(int offset)
IUnivariatePolynomial
this / x^offset
, it is polynomial with coefficient list formed by shifting
coefficients of this
to the left by offset
.shiftLeft
in interface IUnivariatePolynomial<lPoly extends cc.redberry.rings.poly.univar.AUnivariatePolynomial64<lPoly>>
offset
- shift amountthis / x^offset
public final lPoly shiftRight(int offset)
IUnivariatePolynomial
this
by the x^offset
.shiftRight
in interface IUnivariatePolynomial<lPoly extends cc.redberry.rings.poly.univar.AUnivariatePolynomial64<lPoly>>
offset
- monomial exponentthis * x^offset
public final lPoly truncate(int newDegree)
IUnivariatePolynomial
this rem x^(newDegree + 1)
, it is polynomial formed by coefficients of this from
zero to newDegree
(both inclusive)truncate
in interface IUnivariatePolynomial<lPoly extends cc.redberry.rings.poly.univar.AUnivariatePolynomial64<lPoly>>
newDegree
- new degreethis rem x^(newDegree + 1)
public final lPoly reverse()
IUnivariatePolynomial
reverse
in interface IUnivariatePolynomial<lPoly extends cc.redberry.rings.poly.univar.AUnivariatePolynomial64<lPoly>>
public final long content()
public final lPoly contentAsPoly()
IPolynomial
contentAsPoly
in interface IPolynomial<lPoly extends cc.redberry.rings.poly.univar.AUnivariatePolynomial64<lPoly>>
public final lPoly primitivePart()
IPolynomial
primitivePart
in interface IPolynomial<lPoly extends cc.redberry.rings.poly.univar.AUnivariatePolynomial64<lPoly>>
public final lPoly primitivePartSameSign()
IPolynomial
primitivePartSameSign
in interface IPolynomial<lPoly extends cc.redberry.rings.poly.univar.AUnivariatePolynomial64<lPoly>>
public final long evaluate(long point)
point
(via Horner method).point
- point
point
public final lPoly composition(lPoly value)
IUnivariatePolynomial
composition
in interface IUnivariatePolynomial<lPoly extends cc.redberry.rings.poly.univar.AUnivariatePolynomial64<lPoly>>
value
- polynomialthis(oth)
public final lPoly shift(long value)
value
- shift amountpublic lPoly monicWithLC(lPoly other)
IPolynomial
this
to its monic part multiplied by the leading coefficient of other
;monicWithLC
in interface IPolynomial<lPoly extends cc.redberry.rings.poly.univar.AUnivariatePolynomial64<lPoly>>
other
- other polynomialother
or null if exact division by the
reduced leading coefficient is not possiblepublic final lPoly add(long val)
val
- some numberpublic final lPoly subtract(long val)
val
- some numberpublic final lPoly decrement()
IPolynomial
decrement
in interface IPolynomial<lPoly extends cc.redberry.rings.poly.univar.AUnivariatePolynomial64<lPoly>>
this - 1
public final lPoly increment()
IPolynomial
increment
in interface IPolynomial<lPoly extends cc.redberry.rings.poly.univar.AUnivariatePolynomial64<lPoly>>
this + 1
public final lPoly add(lPoly oth)
IPolynomial
oth
to this
.add
in interface IPolynomial<lPoly extends cc.redberry.rings.poly.univar.AUnivariatePolynomial64<lPoly>>
oth
- the polynomialthis + oth
public final lPoly addMonomial(long coefficient, int exponent)
coefficient*x^exponent
to this
coefficient
- monomial coefficientexponent
- monomial exponentthis + coefficient*x^exponent
public final lPoly addMul(lPoly oth, long factor)
oth * factor
to this
oth
- the polynomialfactor
- the factorthis + oth * factor
modulo modulus
public final lPoly subtract(lPoly oth)
IPolynomial
oth
from this
.subtract
in interface IPolynomial<lPoly extends cc.redberry.rings.poly.univar.AUnivariatePolynomial64<lPoly>>
oth
- the polynomialthis - oth
public final lPoly subtract(lPoly oth, long factor, int exponent)
factor * x^exponent * oth
from this
oth
- the polynomialfactor
- the factorexponent
- the exponentthis - factor * x^exponent * oth
public final lPoly negate()
IPolynomial
negate
in interface IPolynomial<lPoly extends cc.redberry.rings.poly.univar.AUnivariatePolynomial64<lPoly>>
public lPoly multiplyByLC(lPoly other)
IPolynomial
other
multiplyByLC
in interface IPolynomial<lPoly extends cc.redberry.rings.poly.univar.AUnivariatePolynomial64<lPoly>>
other
- polynomialpublic final lPoly multiply(long factor)
IPolynomial
factor
multiply
in interface IPolynomial<lPoly extends cc.redberry.rings.poly.univar.AUnivariatePolynomial64<lPoly>>
factor
- the factorthis * factor
public final long[] getDataReferenceUnsafe()
public final int compareTo(lPoly o)
compareTo
in interface Comparable<lPoly extends cc.redberry.rings.poly.univar.AUnivariatePolynomial64<lPoly>>
public String toString(String... variables)
WithVariables
toString
in interface IPolynomial<lPoly extends cc.redberry.rings.poly.univar.AUnivariatePolynomial64<lPoly>>
toString
in interface WithVariables
variables
- string values of variablespublic String toStringForCopy()
public final LongStream stream()
Stream
with coefficients of this as its source.Stream
over the coefficients in this polynomialpublic final <T> UnivariatePolynomial<T> mapElements(Ring<T> ring, LongFunction<T> mapper)
stream().mapToObj(mapper).collect(new PolynomialCollector<>(ring))
.T
- result elements typering
- ring of the new polynomialmapper
- function that maps coefficients of this to coefficients of the resultmapper
Copyright © 2017. All rights reserved.