예제 #1
0
 /**
  * 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);
 }
예제 #2
0
 /**
  * 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);
 }
예제 #3
0
 /**
  * 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);
 }