@@ -113,24 +113,26 @@ void BlackScholesLocalVolBase::performCalculationsFd(const bool localVol) const
113113
114114 // 6 set additional results
115115
116- setAdditionalResults ();
116+ setAdditionalResults (localVol );
117117}
118118
119- void BlackScholesLocalVolBase::setAdditionalResults () const {
119+ void BlackScholesLocalVolBase::setAdditionalResults (const bool localVol) const {
120+
121+ std::string label = localVol ? " LocalVol" : " BlackScholes" ;
120122
121123 Matrix correlation = getCorrelation ();
122124
123125 for (Size i = 0 ; i < indices_.size (); ++i) {
124126 for (Size j = 0 ; j < i; ++j) {
125- additionalResults_[" BlackScholes .Correlation_" + indices_[i].name () + " _" + indices_[j].name ()] =
127+ additionalResults_[label + " .Correlation_" + indices_[i].name () + " _" + indices_[j].name ()] =
126128 correlation (i, j);
127129 }
128130 }
129131
130132 std::vector<Real> calibrationStrikes = getCalibrationStrikes ();
131133
132134 for (Size i = 0 ; i < calibrationStrikes.size (); ++i) {
133- additionalResults_[" BlackScholesLocalVolBase .CalibrationStrike_" + indices_[i].name ()] =
135+ additionalResults_[label + " .CalibrationStrike_" + indices_[i].name ()] =
134136 (calibrationStrikes[i] == Null<Real>() ? " ATMF" : std::to_string (calibrationStrikes[i]));
135137 }
136138
@@ -143,11 +145,10 @@ void BlackScholesLocalVolBase::setAdditionalResults() const {
143145 Real volatility = model_->generalizedBlackScholesProcesses ()[i]->blackVolatility ()->blackVol (
144146 t, (calibrationStrikes.empty () || calibrationStrikes[i] == Null<Real>()) ? forward
145147 : calibrationStrikes[i]);
146- additionalResults_[" BlackScholesLocalVolBase .Volatility_" + indices_[i].name () + " _" +
147- ore::data::to_string (d)] = volatility;
148+ additionalResults_[label + " .Volatility_" + indices_[i].name () + " _" + ore::data::to_string (d)] =
149+ volatility;
148150 }
149- additionalResults_[" BlackScholesLocalVolBase.Forward_" + indices_[i].name () + " _" +
150- ore::data::to_string (d)] = forward;
151+ additionalResults_[label + " .Forward_" + indices_[i].name () + " _" + ore::data::to_string (d)] = forward;
151152 ++timeStep;
152153 }
153154 }
0 commit comments