class DiscreteVolatilityFunctionProviderFromInterpolatedTermStructure extends DiscreteVolatilityFunctionProvider {

  @Override
  public DiscreteVolatilityFunction from(final DoublesPair[] expiryStrikePoints) {
    ArgumentChecker.noNulls(expiryStrikePoints, "expiryStrikePoints");
    final int n = expiryStrikePoints.length;
    final Double[] expiries = new Double[n];
    for (int i = 0; i < n; i++) {
      expiries[i] = expiryStrikePoints[i].first;
    }
    final VectorFunction vf = _funcPro.from(expiries);

    return new DiscreteVolatilityFunction() {

      @Override
      public int getLengthOfRange() {
        return vf.getLengthOfRange();
      }

      @Override
      public int getLengthOfDomain() {
        return vf.getLengthOfDomain();
      }

      @Override
      public DoubleMatrix2D calculateJacobian(final DoubleMatrix1D x) {
        return vf.calculateJacobian(x);
      }

      @Override
      public DoubleMatrix1D evaluate(final DoubleMatrix1D x) {
        return vf.evaluate(x);
      }
    };
  }

  public  DiscreteVolatilityFunctionProviderFromInterpolatedTermStructure(final double[] knotPoints, final Interpolator1D interpolator);

}