/** * */ @Test(expectedExceptions = IllegalArgumentException.class) public void dataShortTest() { final double[] xValues = new double[] {1., 2. }; final double[] yValues = new double[] {0., 0.1 }; PiecewisePolynomialInterpolator interp = new CubicSplineInterpolator(); PiecewisePolynomialInterpolator interpPos = new NonnegativityPreservingCubicSplineInterpolator(interp); interpPos.interpolate(xValues, yValues); }
/** * */ @Test(expectedExceptions = IllegalArgumentException.class) public void nullYdataTest() { double[] xValues = new double[] {1., 2., 3., 4. }; double[] yValues = new double[] {0., 0.1, 0.05, 0.2 }; yValues = null; PiecewisePolynomialInterpolator interp = new CubicSplineInterpolator(); PiecewisePolynomialInterpolator interpPos = new MonotonicityPreservingCubicSplineInterpolator(interp); interpPos.interpolate(xValues, yValues); }
/** * */ @Test(expectedExceptions = IllegalArgumentException.class) public void diffDataTest() { final double[] xValues = new double[] {1., 2., 3., 4. }; final double[] yValues = new double[] {0., 0.1, 0.05 }; PiecewisePolynomialInterpolator interp = new NaturalSplineInterpolator(); PiecewisePolynomialInterpolator interpPos = new NonnegativityPreservingCubicSplineInterpolator(interp); interpPos.interpolate(xValues, yValues); }
/** * */ @Test(expectedExceptions = IllegalArgumentException.class) public void diffDataTest() { final double[] xValues = new double[] {1., 2., 3., 4. }; final double[] yValues = new double[] {0., 0.1, 0.05 }; PiecewisePolynomialInterpolator interp = new NaturalSplineInterpolator(); PiecewisePolynomialInterpolator interpPos = new MonotonicityPreservingCubicSplineInterpolator(interp); interpPos.interpolate(xValues, yValues); }
/** * */ @Test(expectedExceptions = IllegalArgumentException.class) public void dataShortMultiTest() { final double[] xValues = new double[] {1., 2., }; final double[][] yValues = new double[][] { {0., 0.1 }, {0., 0.1 } }; PiecewisePolynomialInterpolator interp = new PiecewiseCubicHermiteSplineInterpolator(); PiecewisePolynomialInterpolator interpPos = new NonnegativityPreservingCubicSplineInterpolator(interp); interpPos.interpolate(xValues, yValues); }
/** * */ @Test(expectedExceptions = IllegalArgumentException.class) public void dataShortMultiTest() { final double[] xValues = new double[] {1., 2., }; final double[][] yValues = new double[][] { {0., 0.1 }, {0., 0.1 } }; PiecewisePolynomialInterpolator interp = new PiecewiseCubicHermiteSplineInterpolator(); PiecewisePolynomialInterpolator interpPos = new MonotonicityPreservingCubicSplineInterpolator(interp); interpPos.interpolate(xValues, yValues); }
/** * */ @Test(expectedExceptions = IllegalArgumentException.class) public void coincideDataTest() { final double[] xValues = new double[] {1., 1., 3. }; final double[] yValues = new double[] {0., 0.1, 0.05 }; PiecewisePolynomialInterpolator interp = new CubicSplineInterpolator(); PiecewisePolynomialInterpolator interpPos = new NonnegativityPreservingCubicSplineInterpolator(interp); interpPos.interpolate(xValues, yValues); }
/** * */ @Test(expectedExceptions = IllegalArgumentException.class) public void infXdataMultiTest() { double[] xValues = new double[] {1., 2., 3., INF }; double[][] yValues = new double[][] { {0., 0.1, 0.05, 0.2 }, {0., 0.1, 0.05, 0.2 } }; PiecewisePolynomialInterpolator interp = new CubicSplineInterpolator(); PiecewisePolynomialInterpolator interpPos = new MonotonicityPreservingCubicSplineInterpolator(interp); interpPos.interpolate(xValues, yValues); }
/** * */ @Test(expectedExceptions = IllegalArgumentException.class) public void nullXdataTest() { double[] xValues = new double[] {1., 2., 3., 4. }; double[] yValues = new double[] {0., 0.1, 0.05, 0.2 }; xValues = null; PiecewisePolynomialInterpolator interp = new CubicSplineInterpolator(); PiecewisePolynomialInterpolator interpPos = new NonnegativityPreservingCubicSplineInterpolator(interp); interpPos.interpolate(xValues, yValues); }
/** * */ @Test(expectedExceptions = IllegalArgumentException.class) public void nullXdataTest() { double[] xValues = new double[] {1., 2., 3., 4. }; double[] yValues = new double[] {0., 0.1, 0.05, 0.2 }; xValues = null; PiecewisePolynomialInterpolator interp = new CubicSplineInterpolator(); PiecewisePolynomialInterpolator interpPos = new MonotonicityPreservingCubicSplineInterpolator(interp); interpPos.interpolate(xValues, yValues); }
/** * */ @Test(expectedExceptions = IllegalArgumentException.class) public void nanXdataTest() { double[] xValues = new double[] {1., 2., 3., Double.NaN }; double[] yValues = new double[] {0., 0.1, 0.05, 0.2 }; PiecewisePolynomialInterpolator interp = new CubicSplineInterpolator(); PiecewisePolynomialInterpolator interpPos = new NonnegativityPreservingCubicSplineInterpolator(interp); interpPos.interpolate(xValues, yValues); }
/** * */ @Test(expectedExceptions = IllegalArgumentException.class) public void nullYdataMultiTest() { double[] xValues = new double[] {1., 2., 3., 4. }; double[][] yValues = new double[][] { {0., 0.1, 0.05, 0.2 }, {0., 0.1, 0.05, 0.2 } }; yValues = null; PiecewisePolynomialInterpolator interp = new CubicSplineInterpolator(); PiecewisePolynomialInterpolator interpPos = new MonotonicityPreservingCubicSplineInterpolator(interp); interpPos.interpolate(xValues, yValues); }
/** * */ @Test(expectedExceptions = IllegalArgumentException.class) public void infXdataMultiTest() { double[] xValues = new double[] {1., 2., 3., INF }; double[][] yValues = new double[][] { {0., 0.1, 0.05, 0.2 }, {0., 0.1, 0.05, 0.2 } }; PiecewisePolynomialInterpolator interp = new CubicSplineInterpolator(); PiecewisePolynomialInterpolator interpPos = new NonnegativityPreservingCubicSplineInterpolator(interp); interpPos.interpolate(xValues, yValues); }
/** * */ @Test(expectedExceptions = IllegalArgumentException.class) public void coincideDataMultiTest() { final double[] xValues = new double[] {1., 2., 2. }; final double[][] yValues = new double[][] { {2., 0., 0.1, 0.05, 2. }, {1., 0., 0.1, 1.05, 2. } }; PiecewisePolynomialInterpolator interp = new CubicSplineInterpolator(); PiecewisePolynomialInterpolator interpPos = new MonotonicityPreservingCubicSplineInterpolator(interp); interpPos.interpolate(xValues, yValues); }
/** * */ @Test(expectedExceptions = IllegalArgumentException.class) public void nullYdataTest() { double[] xValues = new double[] {1., 2., 3., 4. }; double[] yValues = new double[] {0., 0.1, 0.05, 0.2 }; yValues = null; PiecewisePolynomialInterpolator interp = new CubicSplineInterpolator(); PiecewisePolynomialInterpolator interpPos = new NonnegativityPreservingCubicSplineInterpolator(interp); interpPos.interpolate(xValues, yValues); }
/** * */ @Test(expectedExceptions = IllegalArgumentException.class) public void infXdataTest() { double[] xValues = new double[] {1., 2., 3., INF }; double[] yValues = new double[] {0., 0.1, 0.05, 0.2 }; PiecewisePolynomialInterpolator interp = new CubicSplineInterpolator(); PiecewisePolynomialInterpolator interpPos = new MonotonicityPreservingCubicSplineInterpolator(interp); interpPos.interpolate(xValues, yValues); }
/** * */ @Test(expectedExceptions = IllegalArgumentException.class) public void nullXdataMultiTest() { double[] xValues = new double[] {1., 2., 3., 4. }; double[][] yValues = new double[][] { {0., 0.1, 0.05, 0.2 }, {0., 0.1, 0.05, 0.2 } }; xValues = null; PiecewisePolynomialInterpolator interp = new CubicSplineInterpolator(); PiecewisePolynomialInterpolator interpPos = new NonnegativityPreservingCubicSplineInterpolator(interp); interpPos.interpolate(xValues, yValues); }
/** * */ @Test(expectedExceptions = IllegalArgumentException.class) public void infYdataMultiTest() { double[] xValues = new double[] {1., 2., 3., 4. }; double[][] yValues = new double[][] { {0., 0., 0.1, 0.05, 0.2, 1. }, {0., 0., 0.1, 0.05, 0.2, INF } }; PiecewisePolynomialInterpolator interp = new CubicSplineInterpolator(); PiecewisePolynomialInterpolator interpPos = new MonotonicityPreservingCubicSplineInterpolator(interp); interpPos.interpolate(xValues, yValues); }
/** * */ @Test(expectedExceptions = IllegalArgumentException.class) public void nanYdataTest() { double[] xValues = new double[] {1., 2., 3., 4. }; double[] yValues = new double[] {0., 0., 0.1, 0.05, 0.2, Double.NaN }; PiecewisePolynomialInterpolator interp = new CubicSplineInterpolator(); PiecewisePolynomialInterpolator interpPos = new NonnegativityPreservingCubicSplineInterpolator(interp); interpPos.interpolate(xValues, yValues); }
/** * */ @Test(expectedExceptions = IllegalArgumentException.class) public void nanXdataMultiTest() { double[] xValues = new double[] {1., 2., 3., Double.NaN }; double[][] yValues = new double[][] { {0., 0.1, 0.05, 0.2 }, {0., 0.1, 0.05, 0.2 } }; PiecewisePolynomialInterpolator interp = new CubicSplineInterpolator(); PiecewisePolynomialInterpolator interpPos = new NonnegativityPreservingCubicSplineInterpolator(interp); interpPos.interpolate(xValues, yValues); }