|
30 | 30 | #include <ql/termstructures/volatility/equityfx/andreasenhugevolatilityinterpl.hpp> |
31 | 31 | #include <ql/termstructures/volatility/equityfx/localconstantvol.hpp> |
32 | 32 | #include <ql/termstructures/volatility/equityfx/localvolsurface.hpp> |
| 33 | +#include <ql/termstructures/volatility/equityfx/noexceptlocalvolsurface.hpp> |
33 | 34 | #include <ql/time/daycounters/actualactual.hpp> |
34 | 35 | #include <ql/pricingengines/vanilla/analyticeuropeanengine.hpp> |
35 | 36 |
|
@@ -133,11 +134,15 @@ std::vector<boost::shared_ptr<GeneralizedBlackScholesProcess>> LocalVolModelBuil |
133 | 134 | "calibration error min=" |
134 | 135 | << std::scientific << std::setprecision(6) << boost::get<0>(ah->calibrationError()) << " max=" |
135 | 136 | << boost::get<1>(ah->calibrationError()) << " avg=" << boost::get<2>(ah->calibrationError())); |
136 | | - } else if (lvType_ == Type::Dupire || lvType_ == Type::DupireFloored) { |
| 137 | + } else if (lvType_ == Type::Dupire) { |
137 | 138 | localVol = Handle<LocalVolTermStructure>( |
138 | 139 | boost::make_shared<LocalVolSurface>(processes_[l]->blackVolatility(), processes_[l]->riskFreeRate(), |
139 | | - processes_[l]->dividendYield(), processes_[l]->stateVariable(), |
140 | | - lvType_ == Type::DupireFloored ? true : false)); |
| 140 | + processes_[l]->dividendYield(), processes_[l]->stateVariable())); |
| 141 | + } else if (lvType_ == Type::DupireFloored) { |
| 142 | + localVol = Handle<LocalVolTermStructure>( |
| 143 | + boost::make_shared<NoExceptLocalVolSurface>(processes_[l]->blackVolatility(), processes_[l]->riskFreeRate(), |
| 144 | + processes_[l]->dividendYield(), processes_[l]->stateVariable(), |
| 145 | + 0.0)); |
141 | 146 | } else { |
142 | 147 | QL_FAIL("unexpected local vol type"); |
143 | 148 | } |
|
0 commit comments