Re: Returning multiple values from a Monte-Carlo pricing engine

Posted by Simon Ibbotson-2 on
URL: http://quantlib.414.s1.nabble.com/Returning-multiple-values-from-a-Monte-Carlo-pricing-engine-tp9175p9181.html

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:[hidden email]]
Sent: 24 December 2010 09:55
To: Simon Ibbotson
Cc: [hidden email]
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 [hidden email] 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
*****************************************************************


------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev