Skip to content
Permalink
Browse files
MATH-1589: Remove spurious "throws" clause.
  • Loading branch information
Gilles Sadowski committed Aug 12, 2022
1 parent 1119bdb commit 3c1c92d3eb6c13db92ea6123f8ad0d2383117f66
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 19 deletions.
@@ -19,7 +19,6 @@
import org.apache.commons.math4.legacy.analysis.polynomials.PolynomialFunction;
import org.apache.commons.math4.legacy.analysis.polynomials.PolynomialSplineFunction;
import org.apache.commons.math4.legacy.exception.DimensionMismatchException;
import org.apache.commons.math4.legacy.exception.NonMonotonicSequenceException;
import org.apache.commons.math4.legacy.exception.NumberIsTooSmallException;
import org.apache.commons.math4.legacy.exception.util.LocalizedFormats;
import org.apache.commons.math4.legacy.core.MathArrays;
@@ -57,16 +56,12 @@ public class SplineInterpolator implements UnivariateInterpolator {
* @return a function which interpolates the data set
* @throws DimensionMismatchException if {@code x} and {@code y}
* have different sizes.
* @throws NonMonotonicSequenceException if {@code x} is not sorted in
* strict increasing order.
* @throws NumberIsTooSmallException if the size of {@code x} is smaller
* than 3.
* @throws NumberIsTooSmallException if the size of {@code x < 3}.
* @throws org.apache.commons.math4.legacy.exception.NonMonotonicSequenceException
* if {@code x} is not sorted in strict increasing order.
*/
@Override
public PolynomialSplineFunction interpolate(double[] x, double[] y)
throws DimensionMismatchException,
NumberIsTooSmallException,
NonMonotonicSequenceException {
public PolynomialSplineFunction interpolate(double[] x, double[] y) {
if (x.length != y.length) {
throw new DimensionMismatchException(x.length, y.length);
}
@@ -17,25 +17,19 @@
package org.apache.commons.math4.legacy.analysis.interpolation;

import org.apache.commons.math4.legacy.analysis.UnivariateFunction;
import org.apache.commons.math4.legacy.exception.DimensionMismatchException;
import org.apache.commons.math4.legacy.exception.MathIllegalArgumentException;

/**
* Interface representing a univariate real interpolating function.
*
*/
public interface UnivariateInterpolator {
/**
* Compute an interpolating function for the dataset.
* Computes an interpolating function for the dataset.
*
* @param xval Arguments for the interpolation points.
* @param yval Values for the interpolation points.
* @return a function which interpolates the dataset.
* @throws MathIllegalArgumentException
* if the arguments violate assumptions made by the interpolation
* algorithm.
* @throws DimensionMismatchException if arrays lengths do not match
* @throws org.apache.commons.math4.legacy.exception.MathIllegalArgumentException
* if the arguments violate assumptions made by the interpolation algorithm.
*/
UnivariateFunction interpolate(double[] xval, double[] yval)
throws MathIllegalArgumentException, DimensionMismatchException;
UnivariateFunction interpolate(double[] xval, double[] yval);
}

0 comments on commit 3c1c92d

Please sign in to comment.