|
From: Simon I. <Sim...@fs...> - 2010-12-03 15:57:25
|
The problem is that MonteCarloModel::addSamples(Size samples) does some simple arithmetic operations on the result_type. Also, McSimulation::value() and McSimulation::calculate() do some other simple operations. In the short-term, I've fully specialised the addSamples() function and defined some arithmetic operations for std::vector<double>. In the long-term, I'd prefer a cleaner solution. I'd suggest making GenericSequenceStatistics into a double template class - GenericRiskStatistics<GaussianStatistics,template <class> class TVector = std::vector> and create a specific TVector class for MonteCarlo simulations. What do you think? Simon > Then either > > a) Define arithmetic operations for the VECTOR return type or > > b) Write parts of MonteCarloModel specialised (via class > template) for the particular traits class. No, I don't think you need to do that. SequenceStatistics doesn't do statistics on the passed vectors as such, it just maintains a set of 1-D statistics. This part should just work. Let me know how it goes, Luigi This communication and any attachments contains information which is confidential and may be subject to legal privilege. It is for intended recipients only. If you are not the intended recipient you must not copy, distribute, publish, rely on or otherwise use it without our consent. Some of our communications may contain confidential information which it could be a criminal offence for you to disclose or use without authority. If you have received this email in error please notify pos...@fs... immediately and delete the email from your computer. The FSA reserves the right to monitor all email communications for compliance with legal, regulatory and professional standards. This email is not intended to nor should it be taken to create any legal relations or contractual relationships. This email has originated from The Financial Services Authority (FSA) 25 The North Colonnade, Canary Wharf, London E14 5HS United Kingdom Registered as a Limited Company in England and Wales No.1920623. Registered Office as above Switchboard: 020 7066 1000 Web Site: http://www.fsa.gov.uk ***************************************************************** |