* @return The market quote sensitivity.
*/
public MultipleCurrencyParameterSensitivity fromParameterSensitivity(final MultipleCurrencyParameterSensitivity parameterSensitivity, final CurveBuildingBlockBundle units) {
ArgumentChecker.notNull(parameterSensitivity, "Sensitivity");
ArgumentChecker.notNull(units, "Units");
MultipleCurrencyParameterSensitivity result = new MultipleCurrencyParameterSensitivity();
for (final Pair<String, Currency> nameCcy : parameterSensitivity.getAllNamesCurrency()) {
final LinkedHashMap<Pair<String, Currency>, DoubleMatrix1D> oneCurveSensiMap = new LinkedHashMap<>();
final Pair<CurveBuildingBlock, DoubleMatrix2D> unitPair = units.getBlock(nameCcy.getFirst());
final double[] oneCurveSensiArray = ((DoubleMatrix1D) MATRIX_ALGEBRA.multiply(parameterSensitivity.getSensitivity(nameCcy), unitPair.getSecond())).getData();
for (final String name2 : unitPair.getFirst().getAllNames()) {
final int nbParameters = unitPair.getFirst().getNbParameters(name2);
final int start = unitPair.getFirst().getStart(name2);
final double[] sensiName2 = new double[nbParameters];
System.arraycopy(oneCurveSensiArray, start, sensiName2, 0, nbParameters);
oneCurveSensiMap.put(new ObjectsPair<>(name2, nameCcy.getSecond()), new DoubleMatrix1D(sensiName2));
}
final MultipleCurrencyParameterSensitivity sensiName = new MultipleCurrencyParameterSensitivity(oneCurveSensiMap);
result = result.plus(sensiName);
}
return result;
}