diff --git a/src/java/org/apache/commons/math/analysis/PolynomialSplineFunction.java b/src/java/org/apache/commons/math/analysis/PolynomialSplineFunction.java index ce82b8620..a73a34868 100644 --- a/src/java/org/apache/commons/math/analysis/PolynomialSplineFunction.java +++ b/src/java/org/apache/commons/math/analysis/PolynomialSplineFunction.java @@ -43,7 +43,7 @@ import org.apache.commons.math.MathException; *
j
be the index of the largest knot point that is less than or equal to x
.
* The value returned is polynomials[j](x - knot[j])
true
if the elements in x
are ordered
+ * in a stricly increasing manner. false
, otherwise.
+ */
+ private static boolean isStrictlyIncreasing(double[] x) {
+ for (int i = 1; i < x.length; ++i) {
+ if (x[i - 1] >= x[i]) {
+ return false;
+ }
+ }
+ return true;
+ }
}