class DoublesCurveInterpolatedAnchor extends InterpolatedDoublesCurve {

  public static DoublesCurveInterpolatedAnchor from(double[] xData, double[] yData, double anchor, Interpolator1D interpolator, String name) {
    ArgumentChecker.notNull(xData, "X data");
    int xLength = xData.length;
    ArgumentChecker.notNull(yData, "Y data");
    ArgumentChecker.isTrue(xLength == yData.length, "Data of incorrect length.");
    double[] xExtended = new double[xLength + 1];
    double[] yExtended = new double[xLength + 1];
    System.arraycopy(xData, 0, xExtended, 0, xLength);
    xExtended[xLength] = anchor;
    System.arraycopy(yData, 0, yExtended, 0, xLength);
    ParallelArrayBinarySort.parallelBinarySort(xExtended, yExtended);
    int anchorIndex = ArrayUtils.indexOf(xExtended, anchor);
    return new DoublesCurveInterpolatedAnchor(xExtended, yExtended, anchorIndex, interpolator, name);
  }

  private  DoublesCurveInterpolatedAnchor(double[] xData, double[] yData, int anchorIndex, Interpolator1D interpolator, String name);
  protected  DoublesCurveInterpolatedAnchor();

}