|
From: Simon I. <Sim...@fs...> - 2011-01-04 10:22:28
|
Unfortunately, that would mean producing a specialised template routine for McSimulation::value() (and others) as we cannot instantiate both result_type of Array and result_type of double using begin() and end() arguments. That would take us back to the beginning of this email chain... I personally would go for a constructor of Array(const std::vector<double>&) for simplicity. Would you agree? Simon -----Original Message----- From: Luigi Ballabio [mailto:lui...@gm...] Sent: 24 December 2010 09:55 To: Simon Ibbotson Cc: qua...@li... Subject: RE: [Quantlib-dev] Returning multiple values from a Monte-Carlo pricing engine On Tue, 2010-12-14 at 12:48 +0000, Simon Ibbotson wrote: > Unfortunately not; McSimulation::value() instantiates a result_type > (i.e. an Array) from a vector<double> obtained from the > sampleAccumulator at several points (also in ::valueWithSamples()). > > Therefore, Array would need a new constructor either: > > [...] > > Which would you recommend? Neither. You can use the existing Array(ForwardIterator begin, ForwardIterator end); and pass the begin() and end() of the vector. Luigi -- It is better to know some of the questions than all of the answers. -- James Thurber 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 ***************************************************************** |