BigDecimal coefficients.
Some methods (like add) change the polynomial, others (like mult) do
not but return the result as a new polynomial.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv BigDecimal[] | |
| private static final BigDecimal | |
| private static final BigDecimal |
| Access | Constructor and Description |
|---|---|
| pack-priv | BigDecimalPolynomial(int
the number of coefficients N)Constructs a new polynomial with |
| pack-priv | BigDecimalPolynomial(BigDecimal[]
the coefficients coeffs)Constructs a new polynomial with a given set of coefficients. |
| public | BigDecimalPolynomial(BigIntPolynomial
the original polynomial p)Constructs a |
| Modifier and Type | Method and Description |
|---|---|
| public void | add(BigDecimalPolynomial
another polynomial b)Adds another polynomial which can have a different number of coefficients. |
| public Object | clone()
Overrides java. Makes a copy of the polynomial that is independent of the original. |
| private BigDecimal[] | |
| private BigDecimal[] | |
| public BigDecimal[] | |
| public void | |
| public BigDecimalPolynomial | Returns: a new polynomialthe polynomial to multiply by poly2)Multiplies the polynomial by another. |
| public BigDecimalPolynomial | Returns: a new polynomialthe polynomial to multiply by poly2)Multiplies the polynomial by another, taking the indices mod N. |
| private BigDecimalPolynomial | |
| public BigIntPolynomial | Returns: a new polynomial withBigInteger coefficientsRounds all coefficients to the nearest integer. |
| pack-priv void | sub(BigDecimalPolynomial b)
Subtracts another polynomial which can have a different number of coefficients. |
| coeffs | back to summary |
|---|---|
| pack-priv BigDecimal[] coeffs | |
| ONE_HALF | back to summary |
|---|---|
| private static final BigDecimal ONE_HALF | |
| ZERO | back to summary |
|---|---|
| private static final BigDecimal ZERO | |
| BigDecimalPolynomial | back to summary |
|---|---|
| pack-priv BigDecimalPolynomial(int N) Constructs a new polynomial with
| |
| BigDecimalPolynomial | back to summary |
|---|---|
| pack-priv BigDecimalPolynomial(BigDecimal[] coeffs) Constructs a new polynomial with a given set of coefficients.
| |
| BigDecimalPolynomial | back to summary |
|---|---|
| public BigDecimalPolynomial(BigIntPolynomial p) Constructs a
| |
| add | back to summary |
|---|---|
| public void add(BigDecimalPolynomial b) Adds another polynomial which can have a different number of coefficients.
| |
| clone | back to summary |
|---|---|
| public Object clone() Overrides java. Makes a copy of the polynomial that is independent of the original.
| |
| copyOf | back to summary |
|---|---|
| private BigDecimal[] copyOf(BigDecimal[] a, int length) | |
| copyOfRange | back to summary |
|---|---|
| private BigDecimal[] copyOfRange(BigDecimal[] a, int from, int to) | |
| getCoeffs | back to summary |
|---|---|
| public BigDecimal[] getCoeffs() | |
| halve | back to summary |
|---|---|
| public void halve() Divides all coefficients by 2. | |
| mult | back to summary |
|---|---|
| public BigDecimalPolynomial mult(BigIntPolynomial poly2) Multiplies the polynomial by another. Does not change this polynomial but returns the result as a new polynomial.
| |
| mult | back to summary |
|---|---|
| public BigDecimalPolynomial mult(BigDecimalPolynomial poly2) Multiplies the polynomial by another, taking the indices mod N. Does not change this polynomial but returns the result as a new polynomial.
| |
| multRecursive | back to summary |
|---|---|
| private BigDecimalPolynomial multRecursive(BigDecimalPolynomial poly2) Karazuba multiplication | |
| round | back to summary |
|---|---|
| public BigIntPolynomial round() Rounds all coefficients to the nearest integer.
| |
| sub | back to summary |
|---|---|
| pack-priv void sub(BigDecimalPolynomial b) Subtracts another polynomial which can have a different number of coefficients. | |