@@ -46,7 +46,7 @@ class SabrStrippedOptionletAdapter : public QuantLib::OptionletVolatilityStructu
4646 /* ! Constructor that does not take a reference date. The settlement days is derived from \p sob and the term
4747 structure will be a \e moving term structure.
4848 */
49- SabrStrippedOptionletAdapter (const boost ::shared_ptr<QuantLib::StrippedOptionletBase>& sob,
49+ SabrStrippedOptionletAdapter (const QuantLib::ext ::shared_ptr<QuantLib::StrippedOptionletBase>& sob,
5050 const QuantExt::SabrParametricVolatility::ModelVariant modelVariant,
5151 const TimeInterpolator& ti = TimeInterpolator(),
5252 const boost::optional<QuantLib::VolatilityType> outputVolatilityType = boost::none,
@@ -58,7 +58,7 @@ class SabrStrippedOptionletAdapter : public QuantLib::OptionletVolatilityStructu
5858 /* ! Constructor taking an explicit \p referenceDate and the term structure will therefore be not \e moving.
5959 */
6060 SabrStrippedOptionletAdapter (const QuantLib::Date& referenceDate,
61- const boost ::shared_ptr<QuantLib::StrippedOptionletBase>& sob,
61+ const QuantLib::ext ::shared_ptr<QuantLib::StrippedOptionletBase>& sob,
6262 const QuantExt::SabrParametricVolatility::ModelVariant modelVariant,
6363 const TimeInterpolator& ti = TimeInterpolator(),
6464 const boost::optional<QuantLib::VolatilityType> outputVolatilityType = boost::none,
@@ -97,19 +97,22 @@ class SabrStrippedOptionletAdapter : public QuantLib::OptionletVolatilityStructu
9797
9898 // ! \name Inspectors
9999 // @{
100- boost::shared_ptr<QuantLib::StrippedOptionletBase> optionletBase () const ;
100+ QuantLib::ext::shared_ptr<QuantLib::StrippedOptionletBase> optionletBase () const ;
101+ QuantLib::ext::shared_ptr<QuantExt::ParametricVolatility> parametricVolatility () const {
102+ return parametricVolatility_;
103+ }
101104 // @}
102105
103106protected:
104107 // ! \name OptionletVolatilityStructure interface
105108 // @{
106- boost ::shared_ptr<QuantLib::SmileSection> smileSectionImpl (QuantLib::Time optionTime) const override ;
109+ QuantLib::ext ::shared_ptr<QuantLib::SmileSection> smileSectionImpl (QuantLib::Time optionTime) const override ;
107110 QuantLib::Volatility volatilityImpl (QuantLib::Time length, QuantLib::Rate strike) const override ;
108111 // @}
109112
110113private:
111114 // ! Base optionlet object that provides the stripped optionlet volatilities
112- boost ::shared_ptr<QuantLib::StrippedOptionletBase> optionletBase_;
115+ QuantLib::ext ::shared_ptr<QuantLib::StrippedOptionletBase> optionletBase_;
113116
114117 // ! The interpolation object in the time direction
115118 TimeInterpolator ti_;
@@ -123,14 +126,14 @@ class SabrStrippedOptionletAdapter : public QuantLib::OptionletVolatilityStructu
123126 QuantLib::Real maxAcceptableError_;
124127
125128 // ! State
126- mutable std::map<Real, boost ::shared_ptr<ParametricVolatilitySmileSection>> cache_;
127- mutable boost ::shared_ptr<ParametricVolatility> parametricVolatility_;
129+ mutable std::map<Real, QuantLib::ext ::shared_ptr<ParametricVolatilitySmileSection>> cache_;
130+ mutable QuantLib::ext ::shared_ptr<ParametricVolatility> parametricVolatility_;
128131 mutable std::unique_ptr<FlatExtrapolation> atmInterpolation_;
129132};
130133
131134template <class TimeInterpolator >
132135SabrStrippedOptionletAdapter<TimeInterpolator>::SabrStrippedOptionletAdapter(
133- const boost ::shared_ptr<QuantLib::StrippedOptionletBase>& sob,
136+ const QuantLib::ext ::shared_ptr<QuantLib::StrippedOptionletBase>& sob,
134137 const QuantExt::SabrParametricVolatility::ModelVariant modelVariant, const TimeInterpolator& ti,
135138 const boost::optional<QuantLib::VolatilityType> outputVolatilityType,
136139 const std::vector<std::pair<Real, bool >>& initialModelParameters, const QuantLib::Size maxCalibrationAttempts,
@@ -145,7 +148,7 @@ SabrStrippedOptionletAdapter<TimeInterpolator>::SabrStrippedOptionletAdapter(
145148
146149template <class TimeInterpolator >
147150SabrStrippedOptionletAdapter<TimeInterpolator>::SabrStrippedOptionletAdapter(
148- const QuantLib::Date& referenceDate, const boost ::shared_ptr<QuantLib::StrippedOptionletBase>& sob,
151+ const QuantLib::Date& referenceDate, const QuantLib::ext ::shared_ptr<QuantLib::StrippedOptionletBase>& sob,
149152 const QuantExt::SabrParametricVolatility::ModelVariant modelVariant, const TimeInterpolator& ti,
150153 const boost::optional<QuantLib::VolatilityType> outputVolatilityType,
151154 const std::vector<std::pair<Real, bool >>& initialModelParameters, const QuantLib::Size maxCalibrationAttempts,
@@ -192,7 +195,7 @@ template <class TimeInterpolator>
192195inline void SabrStrippedOptionletAdapter<TimeInterpolator>::performCalculations() const {
193196 cache_.clear ();
194197
195- atmInterpolation_ = std::make_unique<FlatExtrapolation>(boost ::make_shared<LinearInterpolation>(
198+ atmInterpolation_ = std::make_unique<FlatExtrapolation>(QuantLib::ext ::make_shared<LinearInterpolation>(
196199 this ->optionletBase ()->optionletFixingTimes ().begin (), this ->optionletBase ()->optionletFixingTimes ().end (),
197200 this ->optionletBase ()->atmOptionletRates ().begin ()));
198201 atmInterpolation_->enableExtrapolation ();
@@ -214,7 +217,7 @@ inline void SabrStrippedOptionletAdapter<TimeInterpolator>::performCalculations(
214217 initialModelParameters_;
215218 }
216219
217- parametricVolatility_ = boost ::make_shared<SabrParametricVolatility>(
220+ parametricVolatility_ = QuantLib::ext ::make_shared<SabrParametricVolatility>(
218221 modelVariant_, marketSmiles, ParametricVolatility::MarketModelType::Black76,
219222 volatilityType () == QuantLib::Normal ? ParametricVolatility::MarketQuoteType::NormalVolatility
220223 : ParametricVolatility::MarketQuoteType::ShiftedLognormalVolatility,
@@ -228,21 +231,21 @@ template <class TimeInterpolator> inline void SabrStrippedOptionletAdapter<TimeI
228231}
229232
230233template <class TimeInterpolator >
231- inline boost ::shared_ptr<QuantLib::StrippedOptionletBase>
234+ inline QuantLib::ext ::shared_ptr<QuantLib::StrippedOptionletBase>
232235SabrStrippedOptionletAdapter<TimeInterpolator>::optionletBase() const {
233236 return optionletBase_;
234237}
235238
236239template <class TimeInterpolator >
237- inline boost ::shared_ptr<QuantLib::SmileSection>
240+ inline QuantLib::ext ::shared_ptr<QuantLib::SmileSection>
238241SabrStrippedOptionletAdapter<TimeInterpolator>::smileSectionImpl(QuantLib::Time optionTime) const {
239242 calculate ();
240243 if (auto c = cache_.find (optionTime); c != cache_.end ()) {
241244 return c->second ;
242245 }
243246 Real forward = atmInterpolation_->operator ()(optionTime);
244247 QuantLib::VolatilityType outVolType = outputVolatilityType_ ? *outputVolatilityType_ : volatilityType ();
245- auto tmp = boost ::make_shared<ParametricVolatilitySmileSection>(
248+ auto tmp = QuantLib::ext ::make_shared<ParametricVolatilitySmileSection>(
246249 optionTime, Null<Real>(), forward, parametricVolatility_,
247250 outVolType == QuantLib::Normal ? ParametricVolatility::MarketQuoteType::NormalVolatility
248251 : ParametricVolatility::MarketQuoteType::ShiftedLognormalVolatility);
0 commit comments