/** * Create a copy of the sensitivity and add a given sensitivity to it. * * @param other The sensitivity to add. * @return The total sensitivity. */ public CommoditySensitivity plus(final CommoditySensitivity other) { ArgChecker.notNull(other, "sensitivity"); final MulticurveSensitivity resultMulticurve = _multicurveSensitivity.plus(other._multicurveSensitivity); final Map<String, List<DoublesPair>> resultPrice = MulticurveSensitivityUtils.plus( _sensitivityCommodityForwardCurve, other._sensitivityCommodityForwardCurve); return new CommoditySensitivity(resultMulticurve, resultPrice); }
/** * Return a new sensitivity by sorting the times and adding the values at duplicated times. * * @return The cleaned sensitivity. */ public CommoditySensitivity cleaned() { final MulticurveSensitivity resultMulticurve = _multicurveSensitivity.cleaned(); final Map<String, List<DoublesPair>> resultPrice = MulticurveSensitivityUtils.cleaned(_sensitivityCommodityForwardCurve); return new CommoditySensitivity(resultMulticurve, resultPrice); }
/** * Create a new sensitivity object containing the original sensitivity multiplied by a common * factor. * * @param factor The multiplicative factor. * @return The multiplied sensitivity. */ public CommoditySensitivity multipliedBy(final double factor) { final MulticurveSensitivity resultMulticurve = _multicurveSensitivity.multipliedBy(factor); final Map<String, List<DoublesPair>> resultPrice = MulticurveSensitivityUtils.multipliedBy(_sensitivityCommodityForwardCurve, factor); return new CommoditySensitivity(resultMulticurve, resultPrice); }