示例#1
0
            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();
                LinearInterpolator underlying = new LinearInterpolator();

                this.poly     = underlying.interpolate(xValues.toArray(), getProduct(this.xValues, this.yValues));
                this.polySens = Suppliers.memoize(() => underlying.interpolateWithSensitivity(xValues.toArray(), getProduct(this.xValues, this.yValues)));
            }