本文整理汇总了Java中org.apache.commons.math3.exception.util.LocalizedFormats.NOT_ENOUGH_POINTS_IN_SPLINE_PARTITION属性的典型用法代码示例。如果您正苦于以下问题:Java LocalizedFormats.NOT_ENOUGH_POINTS_IN_SPLINE_PARTITION属性的具体用法?Java LocalizedFormats.NOT_ENOUGH_POINTS_IN_SPLINE_PARTITION怎么用?Java LocalizedFormats.NOT_ENOUGH_POINTS_IN_SPLINE_PARTITION使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.commons.math3.exception.util.LocalizedFormats
的用法示例。
在下文中一共展示了LocalizedFormats.NOT_ENOUGH_POINTS_IN_SPLINE_PARTITION属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: PolynomialSplineFunction
/**
* 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);
}