diff --git a/hipparchus-core/src/changes/changes.xml b/hipparchus-core/src/changes/changes.xml index 4f85634ff..efe7374e4 100644 --- a/hipparchus-core/src/changes/changes.xml +++ b/hipparchus-core/src/changes/changes.xml @@ -50,6 +50,9 @@ If the output is not quite correct, check for invisible trailing spaces! + + Allow variable arguments for building PolynomialFunction. + Extracted class JacobiKey from PolynomialsUtils. diff --git a/hipparchus-core/src/main/java/org/hipparchus/analysis/polynomials/PolynomialFunction.java b/hipparchus-core/src/main/java/org/hipparchus/analysis/polynomials/PolynomialFunction.java index ebd63b823..36e56a817 100644 --- a/hipparchus-core/src/main/java/org/hipparchus/analysis/polynomials/PolynomialFunction.java +++ b/hipparchus-core/src/main/java/org/hipparchus/analysis/polynomials/PolynomialFunction.java @@ -68,7 +68,7 @@ public class PolynomialFunction implements UnivariateDifferentiableFunction, Fie * @throws NullArgumentException if {@code c} is {@code null}. * @throws MathIllegalArgumentException if {@code c} is empty. */ - public PolynomialFunction(double[] c) + public PolynomialFunction(double... c) throws MathIllegalArgumentException, NullArgumentException { super(); MathUtils.checkNotNull(c); @@ -392,7 +392,7 @@ public String toString() { s.append('x'); if (i > 1) { s.append('^'); - s.append(Integer.toString(i)); + s.append(i); } } } @@ -434,10 +434,7 @@ public boolean equals(Object obj) { return false; } PolynomialFunction other = (PolynomialFunction) obj; - if (!Arrays.equals(coefficients, other.coefficients)) { - return false; - } - return true; + return Arrays.equals(coefficients, other.coefficients); } /**