public final class UnivariateDivision extends Object
Modifier and Type | Class and Description |
---|---|
static class |
UnivariateDivision.InverseModMonomial<Poly extends IUnivariatePolynomial<Poly>>
Holds
poly^(-1) mod x^i |
Modifier and Type | Method and Description |
---|---|
static <Poly extends IUnivariatePolynomial<Poly>> |
divideAndRemainder(Poly dividend,
Poly divider,
boolean copy)
Returns
{quotient, remainder} of dividend and divider or null if the division is
not possible. |
static <E> UnivariatePolynomial<E>[] |
divideAndRemainder(UnivariatePolynomial<E> dividend,
UnivariatePolynomial<E> divider,
boolean copy)
Returns quotient and remainder.
|
static UnivariatePolynomialZ64[] |
divideAndRemainder(UnivariatePolynomialZ64 dividend,
UnivariatePolynomialZ64 divider,
boolean copy)
Returns
{quotient, remainder} or null if the division is not possible. |
static UnivariatePolynomialZp64[] |
divideAndRemainder(UnivariatePolynomialZp64 dividend,
UnivariatePolynomialZp64 divider,
boolean copy)
Returns quotient and remainder.
|
static <E> UnivariatePolynomial<E>[] |
divideAndRemainderClassic(UnivariatePolynomial<E> dividend,
UnivariatePolynomial<E> divider,
boolean copy)
Classical algorithm for division with remainder.
|
static UnivariatePolynomialZp64[] |
divideAndRemainderClassic(UnivariatePolynomialZp64 dividend,
UnivariatePolynomialZp64 divider,
boolean copy)
Classical algorithm for division with remainder.
|
static <Poly extends IUnivariatePolynomial<Poly>> |
divideAndRemainderFast(Poly dividend,
Poly divider,
UnivariateDivision.InverseModMonomial<Poly> invMod,
boolean copy)
Returns
{quotient, remainder} of dividend and divider |
static <E> UnivariatePolynomial<E>[] |
divideAndRemainderFast(UnivariatePolynomial<E> dividend,
UnivariatePolynomial<E> divider,
boolean copy)
Fast algorithm for division with remainder using Newton's iteration.
|
static <E> UnivariatePolynomial<E>[] |
divideAndRemainderFast(UnivariatePolynomial<E> dividend,
UnivariatePolynomial<E> divider,
UnivariateDivision.InverseModMonomial<UnivariatePolynomial<E>> invMod,
boolean copy)
Fast algorithm for division with remainder using Newton's iteration.
|
static UnivariatePolynomialZp64[] |
divideAndRemainderFast(UnivariatePolynomialZp64 dividend,
UnivariatePolynomialZp64 divider,
boolean copy)
Fast algorithm for division with remainder using Newton's iteration.
|
static UnivariatePolynomialZp64[] |
divideAndRemainderFast(UnivariatePolynomialZp64 dividend,
UnivariatePolynomialZp64 divider,
UnivariateDivision.InverseModMonomial<UnivariatePolynomialZp64> invMod,
boolean copy)
Fast algorithm for division with remainder using Newton's iteration.
|
static <Poly extends IUnivariatePolynomial<Poly>> |
divideAndRemainderFast0(Poly dividend,
Poly divider,
UnivariateDivision.InverseModMonomial<Poly> invRevMod,
boolean copy)
fast division implementation
|
static <Poly extends IUnivariatePolynomial<Poly>> |
divideExact(Poly dividend,
Poly divider,
boolean copy)
Divides
dividend by divider or throws ArithmeticException if exact division is not
possible |
static <Poly extends IUnivariatePolynomial<Poly>> |
divideOrNull(Poly dividend,
Poly divider,
boolean copy)
Divides
dividend by divider or returns null if exact division is not possible |
static <Poly extends IUnivariatePolynomial<Poly>> |
fastDivisionPreConditioning(Poly divider)
Prepares
rev(divider)^(-1) mod x^i for fast division. |
static <Poly extends IUnivariatePolynomial<Poly>> |
fastDivisionPreConditioningWithLCCorrection(Poly divider)
Prepares
rev(divider)^(-1) mod x^i for fast division. |
static <Poly extends IUnivariatePolynomial<Poly>> |
pseudoDivideAndRemainder(Poly dividend,
Poly divider,
boolean copy)
Returns quotient and remainder of
dividend and divider using pseudo division. |
static <E> UnivariatePolynomial<E>[] |
pseudoDivideAndRemainder(UnivariatePolynomial<E> dividend,
UnivariatePolynomial<E> divider,
boolean copy)
Returns quotient and remainder using pseudo division.
|
static UnivariatePolynomialZ64[] |
pseudoDivideAndRemainder(UnivariatePolynomialZ64 dividend,
UnivariatePolynomialZ64 divider,
boolean copy)
Returns quotient and remainder using pseudo division.
|
static <Poly extends IUnivariatePolynomial<Poly>> |
quotient(Poly dividend,
Poly divider,
boolean copy)
Returns quotient
dividend/ divider or null if exact division o |
static <E> UnivariatePolynomial<E> |
quotient(UnivariatePolynomial<E> dividend,
UnivariatePolynomial<E> divider,
boolean copy)
Returns quotient of
dividend and divider . |
static UnivariatePolynomialZ64 |
quotient(UnivariatePolynomialZ64 dividend,
UnivariatePolynomialZ64 divider,
boolean copy)
Returns quotient
dividend/ divider |
static UnivariatePolynomialZp64 |
quotient(UnivariatePolynomialZp64 dividend,
UnivariatePolynomialZp64 divider,
boolean copy)
Returns quotient of dividing
dividend by divider . |
static <E> UnivariatePolynomial<E> |
quotientFast(UnivariatePolynomial<E> dividend,
UnivariatePolynomial<E> divider,
UnivariateDivision.InverseModMonomial<UnivariatePolynomial<E>> invMod,
boolean copy)
Fast quotient using Newton's iteration.
|
static UnivariatePolynomialZp64 |
quotientFast(UnivariatePolynomialZp64 dividend,
UnivariatePolynomialZp64 divider,
UnivariateDivision.InverseModMonomial<UnivariatePolynomialZp64> invMod,
boolean copy)
Fast quotient using Newton's iteration.
|
static <Poly extends IUnivariatePolynomial<Poly>> |
remainder(Poly dividend,
Poly divider,
boolean copy)
Returns remainder of
dividend and divider . |
static <E> UnivariatePolynomial<E> |
remainder(UnivariatePolynomial<E> dividend,
UnivariatePolynomial<E> divider,
boolean copy)
Returns remainder of
dividend and divider . |
static UnivariatePolynomialZ64 |
remainder(UnivariatePolynomialZ64 dividend,
UnivariatePolynomialZ64 divider,
boolean copy)
Returns remainder of
dividend and divider or null if division is not possible. |
static UnivariatePolynomialZp64 |
remainder(UnivariatePolynomialZp64 dividend,
UnivariatePolynomialZp64 divider,
boolean copy)
Returns remainder of dividing
dividend by divider . |
static <E> E |
remainderCoefficientBound(UnivariatePolynomial<E> dividend,
UnivariatePolynomial<E> divider)
Gives an upper bound on the coefficients of remainder of division of
dividend by divider |
static <Poly extends IUnivariatePolynomial<Poly>> |
remainderFast(Poly dividend,
Poly divider,
UnivariateDivision.InverseModMonomial<Poly> invMod,
boolean copy)
Fast remainder using Newton's iteration with switch to classical remainder for small polynomials.
|
static <E> UnivariatePolynomial<E> |
remainderFast(UnivariatePolynomial<E> dividend,
UnivariatePolynomial<E> divider,
UnivariateDivision.InverseModMonomial<UnivariatePolynomial<E>> invMod,
boolean copy)
Fast remainder using Newton's iteration with switch to classical remainder for small polynomials.
|
static UnivariatePolynomialZp64 |
remainderFast(UnivariatePolynomialZp64 dividend,
UnivariatePolynomialZp64 divider,
UnivariateDivision.InverseModMonomial<UnivariatePolynomialZp64> invMod,
boolean copy)
Fast remainder using Newton's iteration with switch to classical remainder for small polynomials.
|
static <T extends IUnivariatePolynomial<T>> |
remainderMonomial(T dividend,
int xDegree,
boolean copy)
Returns the remainder of
dividend and monomial x^xDegree |
public static <T extends IUnivariatePolynomial<T>> T remainderMonomial(T dividend, int xDegree, boolean copy)
dividend
and monomial x^xDegree
dividend
- the dividendxDegree
- monomial degreecopy
- whether to clone dividend
; if not, the remainder will be placed directly to dividend
and dividend
data will be lostpublic static UnivariatePolynomialZ64[] divideAndRemainder(UnivariatePolynomialZ64 dividend, UnivariatePolynomialZ64 divider, boolean copy)
{quotient, remainder}
or null
if the division is not possible.dividend
- the dividenddivider
- the dividercopy
- whether to clone dividend
; if not, the remainder will be placed directly to dividend
and dividend
data will be lostnull
if the division is not possiblepublic static UnivariatePolynomialZ64[] pseudoDivideAndRemainder(UnivariatePolynomialZ64 dividend, UnivariatePolynomialZ64 divider, boolean copy)
dividend
- the dividenddivider
- the dividercopy
- whether to clone dividend
; if not, the remainder will be placed directly to dividend
and dividend
data will be lostpublic static UnivariatePolynomialZ64 remainder(UnivariatePolynomialZ64 dividend, UnivariatePolynomialZ64 divider, boolean copy)
dividend
and divider
or null
if division is not possible.dividend
- the dividenddivider
- the dividercopy
- whether to clone dividend
; if not, the remainder will be placed directly to dividend
and dividend
data will be lostnull
if division is not possiblepublic static UnivariatePolynomialZ64 quotient(UnivariatePolynomialZ64 dividend, UnivariatePolynomialZ64 divider, boolean copy)
dividend/ divider
dividend
- the dividenddivider
- the dividercopy
- whether to clone dividend
; if not, the remainder will be placed directly to dividend
and dividend
data will be lostpublic static UnivariatePolynomialZp64[] divideAndRemainder(UnivariatePolynomialZp64 dividend, UnivariatePolynomialZp64 divider, boolean copy)
dividend
- the dividenddivider
- the dividercopy
- whether to clone dividend
; if not, the remainder will be placed directly to dividend
and dividend
data will be lostpublic static UnivariatePolynomialZp64[] divideAndRemainderClassic(UnivariatePolynomialZp64 dividend, UnivariatePolynomialZp64 divider, boolean copy)
dividend
- the dividenddivider
- the dividercopy
- whether to clone dividend
; if not, the remainder will be placed directly to dividend
and dividend
data will be lostpublic static <E> UnivariatePolynomial<E>[] divideAndRemainder(UnivariatePolynomial<E> dividend, UnivariatePolynomial<E> divider, boolean copy)
dividend
- the dividenddivider
- the dividercopy
- whether to clone dividend
; if not, the remainder will be placed directly to dividend
and dividend
data will be lostpublic static <E> UnivariatePolynomial<E>[] pseudoDivideAndRemainder(UnivariatePolynomial<E> dividend, UnivariatePolynomial<E> divider, boolean copy)
dividend
- the dividenddivider
- the dividercopy
- whether to clone dividend
; if not, the remainder will be placed directly to dividend
and dividend
data will be lostpublic static <E> UnivariatePolynomial<E>[] divideAndRemainderClassic(UnivariatePolynomial<E> dividend, UnivariatePolynomial<E> divider, boolean copy)
dividend
- the dividenddivider
- the dividercopy
- whether to clone dividend
; if not, the remainder will be placed directly to dividend
and dividend
data will be lostpublic static <Poly extends IUnivariatePolynomial<Poly>> UnivariateDivision.InverseModMonomial<Poly> fastDivisionPreConditioning(Poly divider)
rev(divider)^(-1) mod x^i
for fast division.divider
- the dividerpublic static <Poly extends IUnivariatePolynomial<Poly>> UnivariateDivision.InverseModMonomial<Poly> fastDivisionPreConditioningWithLCCorrection(Poly divider)
rev(divider)^(-1) mod x^i
for fast division.divider
- the dividerpublic static <Poly extends IUnivariatePolynomial<Poly>> Poly[] divideAndRemainderFast0(Poly dividend, Poly divider, UnivariateDivision.InverseModMonomial<Poly> invRevMod, boolean copy)
public static UnivariatePolynomialZp64[] divideAndRemainderFast(UnivariatePolynomialZp64 dividend, UnivariatePolynomialZp64 divider, boolean copy)
dividend
- the dividenddivider
- the dividercopy
- whether to clone dividend
; if not, the remainder will be placed directly to dividend
and dividend
data will be lostpublic static UnivariatePolynomialZp64[] divideAndRemainderFast(UnivariatePolynomialZp64 dividend, UnivariatePolynomialZp64 divider, UnivariateDivision.InverseModMonomial<UnivariatePolynomialZp64> invMod, boolean copy)
dividend
- the dividenddivider
- the dividerinvMod
- pre-conditioned divider (fastDivisionPreConditioning(divider)
)copy
- whether to clone dividend
; if not, the remainder will be placed directly to dividend
and dividend
data will be lostpublic static <E> UnivariatePolynomial<E>[] divideAndRemainderFast(UnivariatePolynomial<E> dividend, UnivariatePolynomial<E> divider, boolean copy)
dividend
- the dividenddivider
- the dividercopy
- whether to clone dividend
; if not, the remainder will be placed directly to dividend
and dividend
data will be lostpublic static <E> UnivariatePolynomial<E>[] divideAndRemainderFast(UnivariatePolynomial<E> dividend, UnivariatePolynomial<E> divider, UnivariateDivision.InverseModMonomial<UnivariatePolynomial<E>> invMod, boolean copy)
dividend
- the dividenddivider
- the dividerinvMod
- pre-conditioned divider (fastDivisionPreConditioning(divider)
)copy
- whether to clone dividend
; if not, the remainder will be placed directly to dividend
and dividend
data will be lostpublic static UnivariatePolynomialZp64 remainder(UnivariatePolynomialZp64 dividend, UnivariatePolynomialZp64 divider, boolean copy)
dividend
by divider
.dividend
- the dividenddivider
- the dividercopy
- whether to clone dividend
; if not, the remainder will be placed directly to dividend
and dividend
data will be lostpublic static UnivariatePolynomialZp64 remainderFast(UnivariatePolynomialZp64 dividend, UnivariatePolynomialZp64 divider, UnivariateDivision.InverseModMonomial<UnivariatePolynomialZp64> invMod, boolean copy)
dividend
- the dividenddivider
- the dividerinvMod
- pre-conditioned divider (fastDivisionPreConditioning(divider)
)copy
- whether to clone dividend
; if not, the remainder will be placed directly to dividend
and dividend
data will be lostpublic static UnivariatePolynomialZp64 quotient(UnivariatePolynomialZp64 dividend, UnivariatePolynomialZp64 divider, boolean copy)
dividend
by divider
.dividend
- the dividenddivider
- the dividercopy
- whether to clone dividend
; if not, the remainder will be placed directly to dividend
and dividend
data will be lostpublic static UnivariatePolynomialZp64 quotientFast(UnivariatePolynomialZp64 dividend, UnivariatePolynomialZp64 divider, UnivariateDivision.InverseModMonomial<UnivariatePolynomialZp64> invMod, boolean copy)
dividend
- the dividenddivider
- the dividerinvMod
- pre-conditioned divider (fastDivisionPreConditioning(divider)
)copy
- whether to clone dividend
; if not, the remainder will be placed directly to dividend
and dividend
data will be lostpublic static <E> UnivariatePolynomial<E> remainder(UnivariatePolynomial<E> dividend, UnivariatePolynomial<E> divider, boolean copy)
dividend
and divider
.dividend
- the dividenddivider
- the dividercopy
- whether to clone dividend
; if not, the remainder will be placed directly to dividend
and dividend
data will be lostpublic static <E> UnivariatePolynomial<E> remainderFast(UnivariatePolynomial<E> dividend, UnivariatePolynomial<E> divider, UnivariateDivision.InverseModMonomial<UnivariatePolynomial<E>> invMod, boolean copy)
dividend
- the dividenddivider
- the dividerinvMod
- pre-conditioned divider (fastDivisionPreConditioning(divider)
)copy
- whether to clone dividend
; if not, the remainder will be placed directly to dividend
and dividend
data will be lostpublic static <E> UnivariatePolynomial<E> quotient(UnivariatePolynomial<E> dividend, UnivariatePolynomial<E> divider, boolean copy)
dividend
and divider
.dividend
- the dividenddivider
- the dividercopy
- whether to clone dividend
; if not, the remainder will be placed directly to dividend
and dividend
data will be lostpublic static <E> UnivariatePolynomial<E> quotientFast(UnivariatePolynomial<E> dividend, UnivariatePolynomial<E> divider, UnivariateDivision.InverseModMonomial<UnivariatePolynomial<E>> invMod, boolean copy)
dividend
- the dividenddivider
- the dividerinvMod
- pre-conditioned divider (fastDivisionPreConditioning(divider)
)copy
- whether to clone dividend
; if not, the remainder will be placed directly to dividend
and dividend
data will be lostpublic static <Poly extends IUnivariatePolynomial<Poly>> Poly[] pseudoDivideAndRemainder(Poly dividend, Poly divider, boolean copy)
dividend
and divider
using pseudo division.dividend
- the dividenddivider
- the dividercopy
- whether to clone dividend
; if not, the remainder will be placed directly to dividend
and dividend
data will be lostpublic static <Poly extends IUnivariatePolynomial<Poly>> Poly[] divideAndRemainder(Poly dividend, Poly divider, boolean copy)
{quotient, remainder}
of dividend
and divider
or null
if the division is
not possible.dividend
- the dividenddivider
- the dividercopy
- whether to clone dividend
; if not, the remainder will be placed directly to dividend
and dividend
data will be lostnull
if the division is not possiblepublic static <Poly extends IUnivariatePolynomial<Poly>> Poly[] divideAndRemainderFast(Poly dividend, Poly divider, UnivariateDivision.InverseModMonomial<Poly> invMod, boolean copy)
{quotient, remainder}
of dividend
and divider
dividend
- the dividenddivider
- the dividercopy
- whether to clone dividend
; if not, the remainder will be placed directly to dividend
and dividend
data will be lostinvMod
- precomputed Newton inversesnull
if the division is not possiblepublic static <Poly extends IUnivariatePolynomial<Poly>> Poly divideExact(Poly dividend, Poly divider, boolean copy)
dividend
by divider
or throws ArithmeticException
if exact division is not
possibledividend
- the dividenddivider
- the dividerdividend / divider
ArithmeticException
- if exact division is not possiblepublic static <Poly extends IUnivariatePolynomial<Poly>> Poly divideOrNull(Poly dividend, Poly divider, boolean copy)
dividend
by divider
or returns null
if exact division is not possibledividend
- the dividenddivider
- the dividerdividend / divider
or null
if exact division is not possiblepublic static <Poly extends IUnivariatePolynomial<Poly>> Poly remainder(Poly dividend, Poly divider, boolean copy)
dividend
and divider
.dividend
- the dividenddivider
- the dividercopy
- whether to clone dividend
; if not, the remainder will be placed directly to dividend
and dividend
data will be lostpublic static <Poly extends IUnivariatePolynomial<Poly>> Poly quotient(Poly dividend, Poly divider, boolean copy)
dividend/ divider
or null if exact division odividend
- the dividenddivider
- the dividercopy
- whether to clone dividend
; if not, the remainder will be placed directly to dividend
and dividend
data will be lostpublic static <Poly extends IUnivariatePolynomial<Poly>> Poly remainderFast(Poly dividend, Poly divider, UnivariateDivision.InverseModMonomial<Poly> invMod, boolean copy)
dividend
- the dividenddivider
- the dividerinvMod
- pre-conditioned divider (fastDivisionPreConditioning(divider)
)copy
- whether to clone dividend
; if not, the remainder will be placed directly to dividend
and dividend
data will be lostpublic static <E> E remainderCoefficientBound(UnivariatePolynomial<E> dividend, UnivariatePolynomial<E> divider)
dividend
by divider
dividend
- the dividenddivider
- the dividerCopyright © 2018. All rights reserved.