Skip to content

Commit

Permalink
Merge pull request #1296.
Browse files Browse the repository at this point in the history
Replace boost::array with std::array
  • Loading branch information
lballabio committed Feb 9, 2022
2 parents d293d29 + eaec95a commit c7a000e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions ql/experimental/volatility/sabrvolsurface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ namespace QuantLib {
registerWithMarketData();
}

boost::array<Real, 4> SabrVolSurface::sabrGuesses(const Date& d) const {
std::array<Real, 4> SabrVolSurface::sabrGuesses(const Date& d) const {

// the guesses for sabr parameters are assumed to be piecewise constant
if (d<=optionDates_[0]) return sabrGuesses_[0];
Expand All @@ -73,7 +73,7 @@ namespace QuantLib {
return sabrGuesses_[i];
}

void SabrVolSurface::updateSabrGuesses(const Date& d, boost::array<Real, 4> newGuesses) const {
void SabrVolSurface::updateSabrGuesses(const Date& d, std::array<Real, 4> newGuesses) const {

Size i=0;
while (i<optionDates_.size() && d<=optionDates_[i])
Expand Down Expand Up @@ -123,7 +123,7 @@ namespace QuantLib {
std::vector<Volatility> volSpreads = volatilitySpreads(d);

// calculate sabr fit
boost::array<Real, 4> sabrParameters1 = sabrGuesses(d);
std::array<Real, 4> sabrParameters1 = sabrGuesses(d);

ext::shared_ptr<SabrInterpolatedSmileSection> tmp(new
SabrInterpolatedSmileSection(d,
Expand Down
8 changes: 4 additions & 4 deletions ql/experimental/volatility/sabrvolsurface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <ql/experimental/volatility/blackatmvolcurve.hpp>
#include <ql/quote.hpp>
#include <ql/termstructures/volatility/sabrinterpolatedsmilesection.hpp>
#include <boost/array.hpp>
#include <array>

namespace QuantLib {

Expand Down Expand Up @@ -67,7 +67,7 @@ namespace QuantLib {
std::vector<Volatility> volatilitySpreads(const Period&) const;
std::vector<Volatility> volatilitySpreads(const Date&) const;
protected:
boost::array<Real, 4> sabrGuesses(const Date&) const;
std::array<Real, 4> sabrGuesses(const Date&) const;
public:
//@}
//! \name BlackVolSurface interface
Expand All @@ -84,7 +84,7 @@ namespace QuantLib {
private:
void registerWithMarketData();
void checkInputs() const;
void updateSabrGuesses(const Date& d, boost::array<Real, 4> newGuesses) const;
void updateSabrGuesses(const Date& d, std::array<Real, 4> newGuesses) const;
Handle<BlackAtmVolCurve> atmCurve_;
std::vector<Period> optionTenors_;
std::vector<Time> optionTimes_;
Expand All @@ -98,7 +98,7 @@ namespace QuantLib {
bool isRhoFixed_;
bool vegaWeighted_;
//
mutable std::vector<boost::array<Real,4> > sabrGuesses_;
mutable std::vector<std::array<Real,4>> sabrGuesses_;
};

// inline
Expand Down

0 comments on commit c7a000e

Please sign in to comment.