Posted by
Luigi Ballabio on
URL: http://quantlib.414.s1.nabble.com/Returning-multiple-values-from-a-Monte-Carlo-pricing-engine-tp9175p9182.html
On Tue, 2011-01-04 at 10:22 +0000, Simon Ibbotson wrote:
> 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...
Oh, rats.
> I personally would go for a constructor of Array(const
> std::vector<double>&) for simplicity. Would you agree?
Hmm, I don't like coupling Array and vector. I'd try doing it as
locally as possible. For example, in McSimulation, we could use two
template functions copy and combine (add? average?) instead of operator=
and operator+ so that we can write specializations for double and
Array/vector.
--
All generalizations are dangerous, even this one.
-- Alexandre Dumas
------------------------------------------------------------------------------
Gaining the trust of online customers is vital for the success of any company
that requires sensitive data to be transmitted over the Web. Learn how to
best implement a security strategy that keeps consumers' information secure
and instills the confidence they need to proceed with transactions.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev