class MultiCapFloorPricerGrid extends MultiCapFloorPricer {

  @Override
  public DoubleMatrix2D vegaFromCapletVols(double[] capletVolGridValues) {
    ArgumentChecker.notEmpty(capletVolGridValues, "null caplet volatilities");
    ArgumentChecker.isTrue(_gridSize == capletVolGridValues.length, "Expect caplet vols on a (flatened) grid of {} strikes by {} expiries, so {} values. Given {} capletVols", getStrikes().length,
        getCapletExpiries().length, _gridSize, capletVolGridValues.length);

    // do not compute the vega of the 'dummy' caplets
    double[] capletVega = new double[_gridSize];
    int n = getNumCaplets();
    for (int i = 0; i < n; i++) {
      int gridIndex = _optionsToGridMap[i];
      capletVega[gridIndex] = BlackFormulaRepository.vega(getOption(i), capletVolGridValues[gridIndex]);
    }

    int nCaps = getNumCaps();
    DoubleMatrix2D jac = new DoubleMatrix2D(nCaps, _gridSize);
    for (int i = 0; i < nCaps; i++) {
      double[] data = jac.getData()[i];
      int[] indices = _capToGridMap[i];
      for (int index : indices) {
        data[index] = capletVega[index];
      }
    }
    return jac;
  }

  public  MultiCapFloorPricerGrid(List<CapFloor> caps, MulticurveProviderInterface curves);

}