/** * */ @Test(expectedExceptions = IllegalArgumentException.class) public void DataShortClapmedTest() { final double[] xValues = new double[] {1. }; final double[] yValues = new double[] {0., 4., 3. }; CubicSplineInterpolator interp = new CubicSplineInterpolator(); interp.interpolate(xValues, yValues); }
/** * */ @Test(expectedExceptions = IllegalArgumentException.class) public void NaNOutputNakTest() { final double[] xValues = new double[] {1., 2., 3., 4. }; final double[] yValues = new double[] {1., 6.e307, -2.e306, 3. }; CubicSplineInterpolator interp = new CubicSplineInterpolator(); interp.interpolate(xValues, yValues); }
/** * */ @Test(expectedExceptions = IllegalArgumentException.class) public void LargeMultiKeyTest() { final double[] xValues = new double[] {1., 2., 3., 4. }; final double[] yValues = new double[] {8., 6., 7., 8. }; final double[] key = new double[] {1., 3., 3.e103 }; CubicSplineInterpolator interp = new CubicSplineInterpolator(); interp.interpolate(xValues, yValues, key); }
/** * Repeated data are not allowed */ @Test(expectedExceptions = IllegalArgumentException.class) public void RepeatDataTest() { final double[] xValues = new double[] {1., 2., 0.5, 8., 1. / 2. }; final double[] yValues = new double[] {2., 3., 4., 5., 8. }; CubicSplineInterpolator interp = new CubicSplineInterpolator(); interp.interpolate(xValues, yValues); }
/** * */ @Test(expectedExceptions = IllegalArgumentException.class) public void NaNOutputClampedTest() { final double[] xValues = new double[] {1., 2., 3., 4. }; final double[] yValues = new double[] {2., 1., 6.e307, -2.e306, 3., 6. }; CubicSplineInterpolator interp = new CubicSplineInterpolator(); interp.interpolate(xValues, yValues); }
/** * */ @Test(expectedExceptions = IllegalArgumentException.class) public void NaNOutputNakMultiTest() { final double[] xValues = new double[] {1., 2., 3., 4. }; final double[][] yValues = new double[][] { {1., 2., 3., 4. }, {1., 6.e307, -2.e306, 3. } }; CubicSplineInterpolator interp = new CubicSplineInterpolator(); interp.interpolate(xValues, yValues); }
/** * */ @Test(expectedExceptions = IllegalArgumentException.class) public void InfOutputClampedTest() { final double[] xValues = new double[] {1., 1.000001 }; final double[] yValues = new double[] {0., 1., 3.e307, 0. }; CubicSplineInterpolator interp = new CubicSplineInterpolator(); interp.interpolate(xValues, yValues); }
/** * */ @Test(expectedExceptions = IllegalArgumentException.class) public void LargeMultiKeyMultiTest() { final double[] xValues = new double[] {1., 2., 3., 4. }; final double[][] yValues = new double[][] { {8., 6., 7., 8. }, {3., 12., 1., 8. } }; final double[] key = new double[] {1., 3., 3.e103 }; CubicSplineInterpolator interp = new CubicSplineInterpolator(); interp.interpolate(xValues, yValues, key); }
/** * */ @Test(expectedExceptions = IllegalArgumentException.class) public void NullKeyMultiTest() { double[] xValues = new double[] {1., 2., 3. }; double[][] yValues = new double[][] { {1., 3., 4. }, {2., 3., 1. } }; double[] xKey = new double[3]; xKey = null; CubicSplineInterpolator interp = new CubicSplineInterpolator(); interp.interpolate(xValues, yValues, xKey); }
/** * */ @Test(expectedExceptions = IllegalArgumentException.class) public void DataShortNakMultiTest() { final double[] xValues = new double[] {1. }; final double[][] yValues = new double[][] { {4. }, {3. } }; CubicSplineInterpolator interp = new CubicSplineInterpolator(); interp.interpolate(xValues, yValues); }
/** * (yValues length) == (xValues length) + 2 or (yValues length) == (xValues length) should be satisfied */ @Test(expectedExceptions = IllegalArgumentException.class) public void WrongDataLengthTest() { final double[] xValues = new double[] {1, 2, 3 }; final double[] yValues = new double[] {2, 3, 4, 5 }; CubicSplineInterpolator interp = new CubicSplineInterpolator(); interp.interpolate(xValues, yValues); }
/** * Data are null */ @Test(expectedExceptions = IllegalArgumentException.class) public void NullTest() { final double[] xValues = null; final double[] yValues = null; CubicSplineInterpolator interp = new CubicSplineInterpolator(); interp.interpolate(xValues, yValues); }
/** * */ @Test(expectedExceptions = IllegalArgumentException.class) public void NullmultiTest() { final double[] xValues = null; final double[][] yValues = null; CubicSplineInterpolator interp = new CubicSplineInterpolator(); interp.interpolate(xValues, yValues); }
/** * Infinite output due to large data */ @Test(expectedExceptions = IllegalArgumentException.class) public void InfOutputNakTest() { final double[] xValues = new double[] {1., 1.000001 }; final double[] yValues = new double[] {1., 3.e307 }; CubicSplineInterpolator interp = new CubicSplineInterpolator(); interp.interpolate(xValues, yValues); }
/** * */ @Test(expectedExceptions = IllegalArgumentException.class) public void LargeKeyMultiTest() { final double[] xValues = new double[] {1., 2., 3., 4. }; final double[][] yValues = new double[][] { {8., 6., 7., 8. }, {3., 12., 1., 8. } }; final double key = 3.e103; CubicSplineInterpolator interp = new CubicSplineInterpolator(); interp.interpolate(xValues, yValues, key); }
/** * */ @Test(expectedExceptions = IllegalArgumentException.class) public void NullKeyMatrixTest() { double[] xValues = new double[] {1., 2., 3. }; double[] yValues = new double[] {1., 3., 4. }; double[][] xKey = new double[3][3]; xKey = null; CubicSplineInterpolator interp = new CubicSplineInterpolator(); interp.interpolate(xValues, yValues, xKey); }
/** * */ @Test(expectedExceptions = IllegalArgumentException.class) public void NullKeyMatrixMultiTest() { double[] xValues = new double[] {1., 2., 3. }; double[][] yValues = new double[][] { {1., 3., 4. }, {2., 3., 1. } }; double[][] xKey = new double[3][4]; xKey = null; CubicSplineInterpolator interp = new CubicSplineInterpolator(); interp.interpolate(xValues, yValues, xKey); }
/** * */ @Test(expectedExceptions = IllegalArgumentException.class) public void DataShortClapmedMultiTest() { final double[] xValues = new double[] {1. }; final double[][] yValues = new double[][] { {0., 4., 3. }, {9., 4., 1.5 } }; CubicSplineInterpolator interp = new CubicSplineInterpolator(); interp.interpolate(xValues, yValues); }
/** * */ @Test(expectedExceptions = IllegalArgumentException.class) public void InfOutputNakQuadTest() { final double[] xValues = new double[] {1., 1.000001, 1.000002 }; final double[] yValues = new double[] {1., 3.e307, 3.e-307 }; CubicSplineInterpolator interp = new CubicSplineInterpolator(); interp.interpolate(xValues, yValues); }
/** * */ @Test(expectedExceptions = IllegalArgumentException.class) public void InfOutputNakQuadMultiTest() { final double[] xValues = new double[] {1., 1.000001, 1.000002 }; final double[][] yValues = new double[][] { {2., 3., 4. }, {1., 3.e307, 3.e-307 } }; CubicSplineInterpolator interp = new CubicSplineInterpolator(); interp.interpolate(xValues, yValues); }