Java Code Examples for org.apache.commons.math3.exception.util.LocalizedFormats#NOT_ENOUGH_POINTS_IN_SPLINE_PARTITION

The following examples show how to use org.apache.commons.math3.exception.util.LocalizedFormats#NOT_ENOUGH_POINTS_IN_SPLINE_PARTITION . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PolynomialSplineFunction.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Construct a polynomial spline function with the given segment delimiters
 * and interpolating polynomials.
 * The constructor copies both arrays and assigns the copies to the knots
 * and polynomials properties, respectively.
 *
 * @param knots Spline segment interval delimiters.
 * @param polynomials Polynomial functions that make up the spline.
 * @throws NullArgumentException if either of the input arrays is {@code null}.
 * @throws NumberIsTooSmallException if knots has length less than 2.
 * @throws DimensionMismatchException if {@code polynomials.length != knots.length - 1}.
 * @throws NonMonotonicSequenceException if the {@code knots} array is not strictly increasing.
 *
 */
public PolynomialSplineFunction(double knots[], PolynomialFunction polynomials[])
    throws NullArgumentException, NumberIsTooSmallException,
           DimensionMismatchException, NonMonotonicSequenceException{
    if (knots == null ||
        polynomials == null) {
        throw new NullArgumentException();
    }
    if (knots.length < 2) {
        throw new NumberIsTooSmallException(LocalizedFormats.NOT_ENOUGH_POINTS_IN_SPLINE_PARTITION,
                                            2, knots.length, false);
    }
    if (knots.length - 1 != polynomials.length) {
        throw new DimensionMismatchException(polynomials.length, knots.length);
    }
    MathArrays.checkOrder(knots);

    this.n = knots.length -1;
    this.knots = new double[n + 1];
    System.arraycopy(knots, 0, this.knots, 0, n + 1);
    this.polynomials = new PolynomialFunction[n];
    System.arraycopy(polynomials, 0, this.polynomials, 0, n);
}
 
Example 2
Source File: PolynomialSplineFunction.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Construct a polynomial spline function with the given segment delimiters
 * and interpolating polynomials.
 * The constructor copies both arrays and assigns the copies to the knots
 * and polynomials properties, respectively.
 *
 * @param knots Spline segment interval delimiters.
 * @param polynomials Polynomial functions that make up the spline.
 * @throws NullArgumentException if either of the input arrays is {@code null}.
 * @throws NumberIsTooSmallException if knots has length less than 2.
 * @throws DimensionMismatchException if {@code polynomials.length != knots.length - 1}.
 * @throws org.apache.commons.math3.exception.NonMonotonicSequenceException if
 * the {@code knots} array is not strictly increasing.
 *
 */
public PolynomialSplineFunction(double knots[], PolynomialFunction polynomials[]) {
    if (knots == null ||
        polynomials == null) {
        throw new NullArgumentException();
    }
    if (knots.length < 2) {
        throw new NumberIsTooSmallException(LocalizedFormats.NOT_ENOUGH_POINTS_IN_SPLINE_PARTITION,
                                            2, knots.length, false);
    }
    if (knots.length - 1 != polynomials.length) {
        throw new DimensionMismatchException(polynomials.length, knots.length);
    }
    MathArrays.checkOrder(knots);

    this.n = knots.length -1;
    this.knots = new double[n + 1];
    System.arraycopy(knots, 0, this.knots, 0, n + 1);
    this.polynomials = new PolynomialFunction[n];
    System.arraycopy(polynomials, 0, this.polynomials, 0, n);
}
 
Example 3
Source File: PolynomialSplineFunction.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Construct a polynomial spline function with the given segment delimiters
 * and interpolating polynomials.
 * The constructor copies both arrays and assigns the copies to the knots
 * and polynomials properties, respectively.
 *
 * @param knots Spline segment interval delimiters.
 * @param polynomials Polynomial functions that make up the spline.
 * @throws NullArgumentException if either of the input arrays is {@code null}.
 * @throws NumberIsTooSmallException if knots has length less than 2.
 * @throws DimensionMismatchException if {@code polynomials.length != knots.length - 1}.
 * @throws org.apache.commons.math3.exception.NonMonotonicSequenceException if
 * the {@code knots} array is not strictly increasing.
 *
 */
public PolynomialSplineFunction(double knots[], PolynomialFunction polynomials[]) {
    if (knots == null ||
        polynomials == null) {
        throw new NullArgumentException();
    }
    if (knots.length < 2) {
        throw new NumberIsTooSmallException(LocalizedFormats.NOT_ENOUGH_POINTS_IN_SPLINE_PARTITION,
                                            2, knots.length, false);
    }
    if (knots.length - 1 != polynomials.length) {
        throw new DimensionMismatchException(polynomials.length, knots.length);
    }
    MathArrays.checkOrder(knots);

    this.n = knots.length -1;
    this.knots = new double[n + 1];
    System.arraycopy(knots, 0, this.knots, 0, n + 1);
    this.polynomials = new PolynomialFunction[n];
    System.arraycopy(polynomials, 0, this.polynomials, 0, n);
}
 
Example 4
Source File: PolynomialSplineFunction.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Construct a polynomial spline function with the given segment delimiters
 * and interpolating polynomials.
 * The constructor copies both arrays and assigns the copies to the knots
 * and polynomials properties, respectively.
 *
 * @param knots Spline segment interval delimiters.
 * @param polynomials Polynomial functions that make up the spline.
 * @throws NullArgumentException if either of the input arrays is {@code null}.
 * @throws NumberIsTooSmallException if knots has length less than 2.
 * @throws DimensionMismatchException if {@code polynomials.length != knots.length - 1}.
 * @throws NonMonotonicSequenceException if the {@code knots} array is not strictly increasing.
 *
 */
public PolynomialSplineFunction(double knots[], PolynomialFunction polynomials[])
    throws NullArgumentException, NumberIsTooSmallException,
           DimensionMismatchException, NonMonotonicSequenceException{
    if (knots == null ||
        polynomials == null) {
        throw new NullArgumentException();
    }
    if (knots.length < 2) {
        throw new NumberIsTooSmallException(LocalizedFormats.NOT_ENOUGH_POINTS_IN_SPLINE_PARTITION,
                                            2, knots.length, false);
    }
    if (knots.length - 1 != polynomials.length) {
        throw new DimensionMismatchException(polynomials.length, knots.length);
    }
    MathArrays.checkOrder(knots);

    this.n = knots.length -1;
    this.knots = new double[n + 1];
    System.arraycopy(knots, 0, this.knots, 0, n + 1);
    this.polynomials = new PolynomialFunction[n];
    System.arraycopy(polynomials, 0, this.polynomials, 0, n);
}
 
Example 5
Source File: PolynomialSplineFunction.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Construct a polynomial spline function with the given segment delimiters
 * and interpolating polynomials.
 * The constructor copies both arrays and assigns the copies to the knots
 * and polynomials properties, respectively.
 *
 * @param knots Spline segment interval delimiters.
 * @param polynomials Polynomial functions that make up the spline.
 * @throws NullArgumentException if either of the input arrays is {@code null}.
 * @throws NumberIsTooSmallException if knots has length less than 2.
 * @throws DimensionMismatchException if {@code polynomials.length != knots.length - 1}.
 * @throws org.apache.commons.math3.exception.NonMonotonicSequenceException if
 * the {@code knots} array is not strictly increasing.
 *
 */
public PolynomialSplineFunction(double knots[], PolynomialFunction polynomials[]) {
    if (knots == null ||
        polynomials == null) {
        throw new NullArgumentException();
    }
    if (knots.length < 2) {
        throw new NumberIsTooSmallException(LocalizedFormats.NOT_ENOUGH_POINTS_IN_SPLINE_PARTITION,
                                            2, knots.length, false);
    }
    if (knots.length - 1 != polynomials.length) {
        throw new DimensionMismatchException(polynomials.length, knots.length);
    }
    MathArrays.checkOrder(knots);

    this.n = knots.length -1;
    this.knots = new double[n + 1];
    System.arraycopy(knots, 0, this.knots, 0, n + 1);
    this.polynomials = new PolynomialFunction[n];
    System.arraycopy(polynomials, 0, this.polynomials, 0, n);
}
 
Example 6
Source File: PolynomialSplineFunction.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Construct a polynomial spline function with the given segment delimiters
 * and interpolating polynomials.
 * The constructor copies both arrays and assigns the copies to the knots
 * and polynomials properties, respectively.
 *
 * @param knots Spline segment interval delimiters.
 * @param polynomials Polynomial functions that make up the spline.
 * @throws NullArgumentException if either of the input arrays is {@code null}.
 * @throws NumberIsTooSmallException if knots has length less than 2.
 * @throws DimensionMismatchException if {@code polynomials.length != knots.length - 1}.
 * @throws NonMonotonicSequenceException if the {@code knots} array is not strictly increasing.
 *
 */
public PolynomialSplineFunction(double knots[], PolynomialFunction polynomials[])
    throws NullArgumentException, NumberIsTooSmallException,
           DimensionMismatchException, NonMonotonicSequenceException{
    if (knots == null ||
        polynomials == null) {
        throw new NullArgumentException();
    }
    if (knots.length < 2) {
        throw new NumberIsTooSmallException(LocalizedFormats.NOT_ENOUGH_POINTS_IN_SPLINE_PARTITION,
                                            2, knots.length, false);
    }
    if (knots.length - 1 != polynomials.length) {
        throw new DimensionMismatchException(polynomials.length, knots.length);
    }
    MathArrays.checkOrder(knots);

    this.n = knots.length -1;
    this.knots = new double[n + 1];
    System.arraycopy(knots, 0, this.knots, 0, n + 1);
    this.polynomials = new PolynomialFunction[n];
    System.arraycopy(polynomials, 0, this.polynomials, 0, n);
}
 
Example 7
Source File: PolynomialSplineFunction.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Construct a polynomial spline function with the given segment delimiters
 * and interpolating polynomials.
 * The constructor copies both arrays and assigns the copies to the knots
 * and polynomials properties, respectively.
 *
 * @param knots Spline segment interval delimiters.
 * @param polynomials Polynomial functions that make up the spline.
 * @throws NullArgumentException if either of the input arrays is {@code null}.
 * @throws NumberIsTooSmallException if knots has length less than 2.
 * @throws DimensionMismatchException if {@code polynomials.length != knots.length - 1}.
 * @throws NonMonotonicSequenceException if the {@code knots} array is not strictly increasing.
 *
 */
public PolynomialSplineFunction(double knots[], PolynomialFunction polynomials[])
    throws NullArgumentException, NumberIsTooSmallException,
           DimensionMismatchException, NonMonotonicSequenceException{
    if (knots == null ||
        polynomials == null) {
        throw new NullArgumentException();
    }
    if (knots.length < 2) {
        throw new NumberIsTooSmallException(LocalizedFormats.NOT_ENOUGH_POINTS_IN_SPLINE_PARTITION,
                                            2, knots.length, false);
    }
    if (knots.length - 1 != polynomials.length) {
        throw new DimensionMismatchException(polynomials.length, knots.length);
    }
    MathArrays.checkOrder(knots);

    this.n = knots.length -1;
    this.knots = new double[n + 1];
    System.arraycopy(knots, 0, this.knots, 0, n + 1);
    this.polynomials = new PolynomialFunction[n];
    System.arraycopy(polynomials, 0, this.polynomials, 0, n);
}
 
Example 8
Source File: PolynomialSplineFunction.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Construct a polynomial spline function with the given segment delimiters
 * and interpolating polynomials.
 * The constructor copies both arrays and assigns the copies to the knots
 * and polynomials properties, respectively.
 *
 * @param knots Spline segment interval delimiters.
 * @param polynomials Polynomial functions that make up the spline.
 * @throws NullArgumentException if either of the input arrays is {@code null}.
 * @throws NumberIsTooSmallException if knots has length less than 2.
 * @throws DimensionMismatchException if {@code polynomials.length != knots.length - 1}.
 * @throws NonMonotonicSequenceException if the {@code knots} array is not strictly increasing.
 *
 */
public PolynomialSplineFunction(double knots[], PolynomialFunction polynomials[])
    throws NullArgumentException, NumberIsTooSmallException,
           DimensionMismatchException, NonMonotonicSequenceException{
    if (knots == null ||
        polynomials == null) {
        throw new NullArgumentException();
    }
    if (knots.length < 2) {
        throw new NumberIsTooSmallException(LocalizedFormats.NOT_ENOUGH_POINTS_IN_SPLINE_PARTITION,
                                            2, knots.length, false);
    }
    if (knots.length - 1 != polynomials.length) {
        throw new DimensionMismatchException(polynomials.length, knots.length);
    }
    MathArrays.checkOrder(knots);

    this.n = knots.length -1;
    this.knots = new double[n + 1];
    System.arraycopy(knots, 0, this.knots, 0, n + 1);
    this.polynomials = new PolynomialFunction[n];
    System.arraycopy(polynomials, 0, this.polynomials, 0, n);
}