Skip to content

Commit

Permalink
Make dividends optional for BinomialConvertibleEngine
Browse files Browse the repository at this point in the history
  • Loading branch information
lballabio committed Dec 3, 2021
1 parent eaf0315 commit b27c999
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ql/pricingengines/bond/binomialconvertibleengine.hpp
Expand Up @@ -48,7 +48,7 @@ namespace QuantLib {
BinomialConvertibleEngine(ext::shared_ptr<GeneralizedBlackScholesProcess> process,
Size timeSteps,
const Handle<Quote>& creditSpread,
DividendSchedule dividends)
DividendSchedule dividends = DividendSchedule())
: process_(std::move(process)), timeSteps_(timeSteps),
dividends_(std::move(dividends)), creditSpread_(creditSpread)
{
Expand Down
6 changes: 2 additions & 4 deletions test-suite/convertiblebonds.cpp
Expand Up @@ -63,7 +63,6 @@ namespace convertible_bonds_test {
RelinkableHandle<Quote> creditSpread;

CallabilitySchedule no_callability;
DividendSchedule no_dividends;

Real faceAmount, redemption, conversionRatio;

Expand Down Expand Up @@ -131,8 +130,7 @@ void ConvertibleBondTest::testBond() {
ext::shared_ptr<PricingEngine> engine =
ext::make_shared<BinomialConvertibleEngine<CoxRossRubinstein> >(vars.process,
timeSteps,
vars.creditSpread,
vars.no_dividends);
vars.creditSpread);

Handle<YieldTermStructure> discountCurve(
ext::make_shared<ForwardSpreadedTermStructure>(vars.riskFreeRate,
Expand Down Expand Up @@ -317,7 +315,7 @@ void ConvertibleBondTest::testOption() {
Size timeSteps = 2001;
ext::shared_ptr<PricingEngine> engine =
ext::make_shared<BinomialConvertibleEngine<CoxRossRubinstein> >(
vars.process, timeSteps, vars.creditSpread, vars.no_dividends);
vars.process, timeSteps, vars.creditSpread);
ext::shared_ptr<PricingEngine> vanillaEngine =
ext::make_shared<BinomialVanillaEngine<CoxRossRubinstein> >(
vars.process, timeSteps);
Expand Down

0 comments on commit b27c999

Please sign in to comment.