fixed an error introduced by a recent change in PolynomialsFunction

(the coefficients array is automatically reduced if high degree coefficients are null)

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@739836 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Luc Maisonobe 2009-02-01 21:06:55 +00:00
parent adc64fb8cf
commit 6a965532e6
1 changed files with 5 additions and 5 deletions

View File

@ -63,9 +63,9 @@ public class SplineInterpolatorTest extends TestCase {
// Verify coefficients using analytical values
PolynomialFunction polynomials[] = ((PolynomialSplineFunction) f).getPolynomials();
double target[] = {y[0], 1d, 0d, 0d};
double target[] = {y[0], 1d};
TestUtils.assertEquals(polynomials[0].getCoefficients(), target, coefficientTolerance);
target = new double[]{y[1], 1d, 0d, 0d};
target = new double[]{y[1], 1d};
TestUtils.assertEquals(polynomials[1].getCoefficients(), target, coefficientTolerance);
// Check interpolation
@ -84,11 +84,11 @@ public class SplineInterpolatorTest extends TestCase {
// Verify coefficients using analytical values
PolynomialFunction polynomials[] = ((PolynomialSplineFunction) f).getPolynomials();
double target[] = {y[0], 1d, 0d, 0d};
double target[] = {y[0], 1d};
TestUtils.assertEquals(polynomials[0].getCoefficients(), target, coefficientTolerance);
target = new double[]{y[1], 1d, 0d, 0d};
target = new double[]{y[1], 1d};
TestUtils.assertEquals(polynomials[1].getCoefficients(), target, coefficientTolerance);
target = new double[]{y[2], 1d, 0d, 0d};
target = new double[]{y[2], 1d};
TestUtils.assertEquals(polynomials[2].getCoefficients(), target, coefficientTolerance);
// Check interpolation