#include#if!defined(BOOST_ALL_NO_LIB)&&defined(BOOST_MSVC)#include#endif#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#includeusingnamespace QuantLib;intmain(int,char*[]){try{std::cout << std::endl;/**************************** GLOBAL SETTINGS ****************************/Calendar calendar =TARGET();Date todaysDate(11, December,2012);Settings::instance().evaluationDate()= todaysDate;todaysDate =Settings::instance().evaluationDate();Integer fixingDays =2;Date settlementDate = calendar.advance(todaysDate, fixingDays, Days);// must be a business daysettlementDate = calendar.adjust(settlementDate);std::cout <<"Today: "<< todaysDate.weekday()<<", "<< todaysDate << std::endl;std::cout <<"Settlement date: "<< settlementDate.weekday()<<", "<< settlementDate << std::endl;/*********************** EONIA CURVE ***********************/DayCounter termStructureDayCounter =Actual365Fixed();std::vector<ext::shared_ptr<RateHelper>> eoniaInstruments;ext::shared_ptr<Eonia>eonia(new Eonia);// a SimpleQuote instance stores a value which can be manually changed;// other Quote subclasses could read the value from a database// or some kind of data feed.// RateHelpers are built from the quotes, together with// other info depending on the instrument. Quotes are passed in// relinkable handles which could be relinked to some other// data source later.// depositsstd::map<Natural, ext::shared_ptr<Quote>> depoQuotes ={// settlement days, quote{0, ext::make_shared<SimpleQuote>(0.0004)},{1, ext::make_shared<SimpleQuote>(0.0004)},{2, ext::make_shared<SimpleQuote>(0.0004)}};DayCounter depositDayCounter =Actual360();for(constauto& q : depoQuotes){auto settlementDays = q.first;auto quote = q.second;auto helper = ext::make_shared<DepositRateHelper>(Handle<Quote>(quote),1* Days, settlementDays,calendar, Following,false, depositDayCounter);eoniaInstruments.push_back(helper);}// short-term OISstd::map<Period, ext::shared_ptr<Quote>> shortOisQuotes ={{1* Weeks, ext::make_shared<SimpleQuote>(0.00070)},{2* Weeks, ext::make_shared<SimpleQuote>(0.00069)},{3* Weeks, ext::make_shared<SimpleQuote>(0.00078)},{1* Months, ext::make_shared<SimpleQuote>(0.00074)}};for(constauto& q : shortOisQuotes){auto tenor = q.first;auto quote = q.second;auto helper = ext::make_shared<OISRateHelper>(2, tenor,Handle<Quote>(quote), eonia);eoniaInstruments.push_back(helper);}// Dated OISstd::map<std::pair<Date, Date>, ext::shared_ptr<Quote>> datedOisQuotes ={{{Date(16, January,2013),Date(13, February,2013)}, ext::make_shared<SimpleQuote>(0.000460)},{{Date(13, February,2013),Date(13, March,2013)}, ext::make_shared<SimpleQuote>(0.000160)},{{Date(13, March,2013),Date(10, April,2013)}, ext::make_shared&