public class BigDecimalPolynomial
extends java.lang.Object
BigDecimal coefficients.
Some methods (like add) change the polynomial, others (like mult) do
not but return the result as a new polynomial.| Constructor and Description |
|---|
BigDecimalPolynomial(BigIntPolynomial p)
Constructs a
BigDecimalPolynomial from a BigIntPolynomial. |
| Modifier and Type | Method and Description |
|---|---|
void |
add(BigDecimalPolynomial b)
Adds another polynomial which can have a different number of coefficients.
|
java.lang.Object |
clone()
Makes a copy of the polynomial that is independent of the original.
|
java.math.BigDecimal[] |
getCoeffs() |
void |
halve()
Divides all coefficients by 2.
|
BigDecimalPolynomial |
mult(BigDecimalPolynomial poly2)
Multiplies the polynomial by another, taking the indices mod N.
|
BigDecimalPolynomial |
mult(BigIntPolynomial poly2)
Multiplies the polynomial by another.
|
BigIntPolynomial |
round()
Rounds all coefficients to the nearest integer.
|
public BigDecimalPolynomial(BigIntPolynomial p)
BigDecimalPolynomial from a BigIntPolynomial. The two polynomials are independent of each other.p - the original polynomialpublic void halve()
public BigDecimalPolynomial mult(BigIntPolynomial poly2)
poly2 - the polynomial to multiply bypublic BigDecimalPolynomial mult(BigDecimalPolynomial poly2)
poly2 - the polynomial to multiply bypublic void add(BigDecimalPolynomial b)
b - another polynomialpublic BigIntPolynomial round()
BigInteger coefficientspublic java.lang.Object clone()
clone in class java.lang.Objectpublic java.math.BigDecimal[] getCoeffs()