internal Bound(DoubleArray xValues, DoubleArray yValues) : base(xValues, yValues) { this.xValues = xValues.toArrayUnsafe(); this.yValues = yValues.toArrayUnsafe(); PiecewisePolynomialInterpolator underlying = new NaturalSplineInterpolator(); this.poly = underlying.interpolate(xValues.toArray(), yValues.toArray()); this.polySens = Suppliers.memoize(() => underlying.interpolateWithSensitivity(xValues.toArray(), yValues.toArray())); }
internal Bound(DoubleArray xValues, DoubleArray yValues) : base(xValues, yValues) { ArgChecker.isTrue(xValues.get(0) > 0d || xValues.get(xValues.size() - 1) < 0d, "xValues must have the same sign"); this.xValues = xValues.toArrayUnsafe(); this.yValues = yValues.toArrayUnsafe(); NaturalSplineInterpolator underlying = new NaturalSplineInterpolator(); this.poly = underlying.interpolate(xValues.toArray(), getProduct(this.xValues, this.yValues)); this.polySens = Suppliers.memoize(() => underlying.interpolateWithSensitivity(xValues.toArray(), getProduct(this.xValues, this.yValues))); }