final YieldAndDiscountCurve curve) {
final Collection<FactorExposureData> decodedSensitivities = RawSecurityUtils.decodeFactorExposureData(secSource, rawSecurity);
final double[] entries = new double[curveSpec.getStrips().size()];
int i = 0;
for (final FixedIncomeStripWithSecurity strip : curveSpec.getStrips()) {
final FactorExposureData swapExternalSensitivitiesData = searchForSwapTenorMatch(decodedSensitivities, strip);
if (swapExternalSensitivitiesData != null) {
final ComputedValue computedValue = inputs.getComputedValue(getSensitivityRequirement(swapExternalSensitivitiesData.getExposureExternalId()));
if (computedValue != null) {
final ManageableHistoricalTimeSeries mhts = (ManageableHistoricalTimeSeries) computedValue.getValue();
final Double value = mhts.getTimeSeries().getLatestValue();
entries[i] = -value; //* (qty.doubleValue() ); // we invert here because OpenGamma uses -1bp shift rather than +1. DV01 function will invert back.
} else {
s_logger.warn("Value was null when getting required input data " + swapExternalSensitivitiesData.getExposureExternalId());
entries[i] = 0d;
}
} else {
entries[i] = 0d;
}
i++;
}
// Quick hack to map in bond data.
i = 0;
for (final FixedIncomeStripWithSecurity strip : curveSpec.getStrips()) {
final FactorExposureData bondExternalSensitivitiesData = searchForBondTenorMatch(decodedSensitivities, strip);
if (bondExternalSensitivitiesData != null) {
final ComputedValue computedValue = inputs.getComputedValue(getSensitivityRequirement(bondExternalSensitivitiesData.getExposureExternalId()));
if (computedValue != null) {
final ManageableHistoricalTimeSeries mhts = (ManageableHistoricalTimeSeries) computedValue.getValue();
final Double value = mhts.getTimeSeries().getLatestValue();
entries[i] -= value; //* (qty.doubleValue() ); // we invert here because OpenGamma uses -1bp shift rather than +1. DV01 function will invert back.
} else {
s_logger.warn("Value was null when getting required input data " + bondExternalSensitivitiesData.getExposureExternalId());
}
}
i++;
}
return new DoubleMatrix1D(entries);