Skip to content

Commit

Permalink
fix ext::get and includes
Browse files Browse the repository at this point in the history
  • Loading branch information
joequant committed Sep 20, 2020
1 parent 20543ff commit d256f06
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
24 changes: 12 additions & 12 deletions ql/experimental/credit/saddlepointlossmodel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1032,10 +1032,10 @@ namespace QuantLib {
ext::tuple<Real, Real, Real, Real> cumulants =
CumGen0234DerivCond(invUncondProbs,
saddlePt, mktFactor);
Real baseVal = cumulants.get<0>();
Real secondVal = cumulants.get<1>();
Real K3Saddle = cumulants.get<2>();
Real K4Saddle = cumulants.get<3>();
Real baseVal = ext::get<0>(cumulants);
Real secondVal = ext::get<1>(cumulants);
Real K3Saddle = ext::get<2>(cumulants);
Real K4Saddle = ext::get<3>(cumulants);

Real saddleTo2 = saddlePt * saddlePt;
Real saddleTo3 = saddleTo2 * saddlePt;
Expand Down Expand Up @@ -1121,8 +1121,8 @@ namespace QuantLib {
ext::tuple<Real, Real> cumulants =
CumGen02DerivCond(invUncondPs,
saddlePt, mktFactor);
Real baseVal = cumulants.get<0>();
Real secondVal = cumulants.get<1>();
Real baseVal = ext::get<0>(cumulants);
Real secondVal = ext::get<1>(cumulants);

Real saddleTo2 = saddlePt * saddlePt;

Expand Down Expand Up @@ -1177,10 +1177,10 @@ namespace QuantLib {
CumGen0234DerivCond(invUncondPs,
saddlePt, mktFactor);
/// access them directly rather than through this copy
Real K0Saddle = cumulants.get<0>();
Real K2Saddle = cumulants.get<1>();
Real K3Saddle = cumulants.get<2>();
Real K4Saddle = cumulants.get<3>();
Real K0Saddle = ext::get<0>(cumulants);
Real K2Saddle = ext::get<1>(cumulants);
Real K3Saddle = ext::get<2>(cumulants);
Real K4Saddle = ext::get<3>(cumulants);
/* see, for instance R.Martin "he saddle point method and portfolio
optionalities." in Risk December 2006 p.93 */
//\todo the exponentials below are dangerous and agressive, tame them.
Expand Down Expand Up @@ -1387,8 +1387,8 @@ namespace QuantLib {
ext::tuple<Real, Real, Real, Real> cumulants =
CumGen0234DerivCond(uncondProbs,
saddlePt, mktFactor);
Real K0Saddle = cumulants.get<0>();///USE THEM DIRECTLY
Real K2Saddle = cumulants.get<1>();
Real K0Saddle = ext::get<0>(cumulants);///USE THEM DIRECTLY
Real K2Saddle = ext::get<1>(cumulants);
Real wq = std::sqrt(2. * saddlePt * lossPercRatio - 2. * K0Saddle);
//std::sqrt(-2. * saddlePt * lossPerc + 2. * K0Saddle);????
Expand Down
1 change: 1 addition & 0 deletions ql/quantlib.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include <ql/termstructure.hpp>
#include <ql/timegrid.hpp>
#include <ql/timeseries.hpp>
#include <ql/tuple.hpp>
#include <ql/types.hpp>
#include <ql/volatilitymodel.hpp>

Expand Down

0 comments on commit d256f06

Please sign in to comment.