47 SensitivityAggregator(
const std::map<std::string, std::set<std::pair<std::string, QuantLib::Size>>>& categories);
64 QuantLib::ext::make_shared<ScenarioFilter>());
71 const std::set<SensitivityRecord>&
sensitivities(
const std::string& category)
const;
75 typedef std::pair<RiskFactorKey, RiskFactorKey>
CrossPair;
76 void generateDeltaGamma(
const std::string& category, std::map<RiskFactorKey, QuantLib::Real>& deltas,
77 std::map<CrossPair, QuantLib::Real>& gammas);
83 std::map<std::string, std::set<std::pair<std::string, QuantLib::Size>>>
setCategories_;
87 std::map<std::string, std::set<SensitivityRecord>>
aggRecords_;
94 bool inCategory(
const std::string& tradeId,
const std::string& category)
const;
void init()
Initialise the container of aggregated records.
void generateDeltaGamma(const std::string &category, std::map< RiskFactorKey, QuantLib::Real > &deltas, std::map< CrossPair, QuantLib::Real > &gammas)
const std::set< SensitivityRecord > & sensitivities(const std::string &category) const
std::map< std::string, std::function< bool(std::string)> > categories_
Container for category names and their definition via functions.
bool inCategory(const std::string &tradeId, const std::string &category) const
Determine if the tradeId is in the given category.
std::map< std::string, std::set< std::pair< std::string, QuantLib::Size > > > setCategories_
SensitivityAggregator(const std::map< std::string, std::set< std::pair< std::string, QuantLib::Size > > > &categories)
void aggregate(SensitivityStream &ss, const QuantLib::ext::shared_ptr< ScenarioFilter > &filter=QuantLib::ext::make_shared< ScenarioFilter >())
SensitivityAggregator(const std::map< std::string, std::function< bool(std::string)> > &categories)
void add(SensitivityRecord &sr, std::set< SensitivityRecord > &records)
Add a sensitivity record to the set of aggregated records.
std::map< std::string, std::set< SensitivityRecord > > aggRecords_
Sensitivity records aggregated according to categories_
std::pair< RiskFactorKey, RiskFactorKey > CrossPair
void reset()
Reset the aggregator to it's initial state by clearing all aggregations.
Base Class for streaming SensitivityRecords.
A Market class that can be updated by Scenarios.
Base class for sensitivity record streamer.