Search in sources :

Example 1 with NoDataException

use of org.apache.commons.math3.exception.NoDataException in project mafscaling by vimsh.

the class BilinearInterpolator method interpolate.

@Override
public BivariateFunction interpolate(double[] xval, double[] yval, double[][] fval) throws NoDataException, DimensionMismatchException, NonMonotonicSequenceException, NumberIsTooSmallException {
    if (xval.length == 0 || yval.length == 0 || fval.length == 0)
        throw new NoDataException();
    if (xval.length != fval.length)
        throw new DimensionMismatchException(xval.length, fval.length);
    if (yval.length != fval[0].length)
        throw new DimensionMismatchException(yval.length, fval[0].length);
    MathArrays.checkOrder(xval);
    MathArrays.checkOrder(yval);
    return new BilinearInterpolatingFunction(xval, yval, fval);
}
Also used : DimensionMismatchException(org.apache.commons.math3.exception.DimensionMismatchException) NoDataException(org.apache.commons.math3.exception.NoDataException)

Aggregations

DimensionMismatchException (org.apache.commons.math3.exception.DimensionMismatchException)1 NoDataException (org.apache.commons.math3.exception.NoDataException)1