25#include <ql/experimental/credit/pool.hpp>
27#include <ql/instruments/bond.hpp>
32bool operator<(
const Currency&,
const Currency&);
33bool operator>(
const Currency&,
const Currency&);
35inline bool operator<(
const Currency& c1,
const Currency& c2) {
return c1.name() < c2.name(); }
37inline bool operator>(
const Currency& c1,
const Currency& c2) {
return c1.name() > c2.name(); }
76 const std::map<std::string, QuantLib::ext::shared_ptr<QuantLib::Bond>>& qlBonds,
78 const std::map<std::string, double>& recoveries,
80 const std::map<std::string, double>& multipliers,
82 const std::map<std::string, QuantLib::Handle<QuantLib::YieldTermStructure>>& yieldTermStructures,
84 const std::map<std::string, Currency>& currencies,
86 const QuantLib::ext::shared_ptr<QuantLib::Pool>
pool,
90 const std::map <std::string, QuantLib::ext::shared_ptr<QuantExt::FxIndex>>&
fxIndexMap,
92 const QuantLib::Date & reinvestmentEndDate,
96 const std::map<std::string, std::vector<std::string>>&
flowType);
100 const std::map<std::string, QuantLib::ext::shared_ptr<QuantLib::Bond>>&
bonds()
const {
return qlBonds_; }
102 const QuantLib::ext::shared_ptr<QuantLib::Pool>&
pool()
const;
104 const std::map <std::string, QuantLib::ext::shared_ptr<QuantExt::FxIndex>>&
fxIndexMap()
const {
return fxIndexMap_;}
108 const double recoveryRate (
const std::string& name)
const;
110 const double multiplier (
const std::string& name)
const ;
113 Real
convert(Real amount, Currency ccy, Date date = Date());
119 void setGrid(std::vector<Date> dates);
120 std::map<Currency, std::vector<Cash>>
scenarioCashflow(std::vector<Date> dates);
124 std::map<Currency, std::vector<Cash>>
scenarioLossflow(std::vector<Date> dates);
125 std::map<Currency, std::vector<Cash>>
scenarioFeeflow(
const std::vector<QuantLib::Date>& dates);
131 const double getScalar(
const std::string& name,
const QuantLib::Date& currentDate)
const;
132 const QuantLib::Handle<QuantLib::YieldTermStructure>
yts(
const std::string& name)
const;
133 const Currency
currency(
const std::string& name)
const;
135 const std::string
flowType(
const std::string& name,
int idx)
const;
136 const QuantLib::ext::shared_ptr<QuantExt::FxIndex>
fxIndex(
const std::string& name)
const;
139 const std::map<std::string, QuantLib::ext::shared_ptr<QuantLib::Bond>>
qlBonds_;
144 const QuantLib::ext::shared_ptr<QuantLib::Pool>
pool_;
146 const std::map <std::string, QuantLib::ext::shared_ptr<QuantExt::FxIndex>>
fxIndexMap_;
149 const std::map<std::string, std::vector<std::string>>
flowType_;
159 std::map<std::string, std::vector<ext::shared_ptr<QuantLib::CashFlow>>>
cashflows_;
160 std::map<std::string, std::vector<ext::shared_ptr<QuantLib::CashFlow>>>
interestFlows_;
161 std::map<std::string, std::vector<ext::shared_ptr<QuantLib::CashFlow>>>
notionalFlows_;
162 std::map<std::string, std::vector<ext::shared_ptr<QuantLib::CashFlow>>>
feeFlows_;
const QuantLib::ext::shared_ptr< QuantLib::Pool > pool_
const QuantLib::ext::shared_ptr< QuantExt::FxIndex > fxIndex(const std::string &name) const
std::map< std::string, std::vector< int > > interestflow2grid_
const Date reinvestmentEndDate_
std::map< std::string, std::vector< ext::shared_ptr< QuantLib::CashFlow > > > feeFlows_
std::map< Currency, std::vector< Cash > > scenarioLossflow(std::vector< Date > dates)
std::vector< Date > grid_
const std::map< std::string, std::vector< double > > reinvestmentScalar_
std::map< Currency, std::vector< Cash > > scenarioCashflow(std::vector< Date > dates)
const double multiplier(const std::string &name) const
std::map< Currency, std::vector< Cash > > scenarioInterestflow(std::vector< Date > dates)
const Currency currency(const std::string &name) const
const std::map< std::string, double > recoveries_
Real convert(Real amount, Currency ccy, Date date=Date())
std::map< std::string, std::vector< ext::shared_ptr< QuantLib::CashFlow > > > notionalFlows_
void setGrid(std::vector< Date > dates)
std::map< std::string, std::vector< int > > cashflow2grid_
const double recoveryRate(const std::string &name) const
std::map< Currency, std::vector< Real > > scenarioRemainingNotional(std::vector< Date > dates)
const std::vector< double > reinvestmentScalar(const std::string &name) const
const double getScalar(const std::string &name, const QuantLib::Date ¤tDate) const
std::map< std::string, std::vector< ext::shared_ptr< QuantLib::CashFlow > > > interestFlows_
const std::map< std::string, QuantLib::ext::shared_ptr< QuantExt::FxIndex > > fxIndexMap_
const std::map< std::string, QuantLib::ext::shared_ptr< QuantLib::Bond > > qlBonds_
const QuantLib::Handle< QuantLib::YieldTermStructure > yts(const std::string &name) const
std::set< QuantLib::Currency > unique_currencies_
std::map< Currency, std::vector< Cash > > scenarioPrincipalflow(std::vector< Date > dates)
const std::map< std::string, QuantLib::ext::shared_ptr< QuantExt::FxIndex > > & fxIndexMap() const
const std::map< std::string, QuantLib::Currency > currencies_
std::map< Currency, std::vector< Cash > > scenarioFeeflow(const std::vector< QuantLib::Date > &dates)
std::map< std::string, std::vector< int > > notionalflow2grid_
const std::map< std::string, std::vector< std::string > > flowType_
std::map< std::string, std::vector< int > > feeflow2grid_
const std::string flowType(const std::string &name, int idx) const
const QuantLib::ext::shared_ptr< QuantLib::Pool > & pool() const
std::map< std::string, std::vector< ext::shared_ptr< QuantLib::CashFlow > > > cashflows_
const std::map< std::string, QuantLib::Handle< QuantLib::YieldTermStructure > > yieldTermStructures_
const std::set< QuantLib::Currency > unique_currencies() const
const std::map< std::string, QuantLib::ext::shared_ptr< QuantLib::Bond > > & bonds() const
Inspectors.
const std::map< std::string, double > multipliers_
Cash(Real flow=0.0, Real discountedFlow=0.0)
Real sumDiscounted(const Cash &c, const Cash &d)
Real sum(const Cash &c, const Cash &d)
bool operator>(const Currency &, const Currency &)
bool operator<(const Currency &c1, const Currency &c2)