27 const std::string& riskFactorColumn,
const std::string& deltaColumn,
28 const std::string& currencyColumn,
const std::string& baseNpvColumn,
29 const std::string& shiftSizeColumn) {
32 while (reader.
next()) {
33 QuantLib::Real shiftSize = QuantLib::Null<QuantLib::Real>();
34 QuantLib::Real baseNpv = QuantLib::Null<QuantLib::Real>();
35 QuantLib::Real delta = QuantLib::Null<QuantLib::Real>();
36 std::string
id = reader.
get(idColumn);
37 std::string key = reader.
get(riskFactorColumn);
38 std::string currency = reader.
get(currencyColumn);
42 if (validDelta && validNpv && validShiftSize && !QuantLib::close_enough(delta, 0.0)) {
43 sensitivities_[id].push_back({key, delta, currency, baseNpv, shiftSize});
std::map< std::string, std::vector< ZeroSensitivity > > sensitivities_
ZeroSensitivityLoader(const std::string &filename, const std::string &idColum="TradeId", const std::string &riskFactorColumn="Factor_1", const std::string &deltaColumn="Delta", const std::string ¤cyColumn="Currency", const std::string &baseNpvColumn="Base NPV", const std::string &shiftSizeColumn="ShiftSize_1")
std::string get(const std::string &field) const
bool tryParseReal(const string &s, QuantLib::Real &result)
Class for structured analytics warnings.