Re: Exception running EuropeanOption example (maybe boost problem?)
Posted by
Bojan Nikolic on
URL: http://quantlib.414.s1.nabble.com/Exception-running-EuropeanOption-example-maybe-boost-problem-tp7357p7358.html
This does look like to be a bug in boost on your platform/compiler
combination. The std::transform takes a copy of the function (i.e.,
fourth) argument and boost seems to trip up when it is time to destroy
it.
I would try expanding out the transform code in the leastsquares
code. Something as simple as below should do I think as a first check.
Best,
Bojan
--- a/ql/math/linearleastsquaresregression.hpp
+++ b/ql/math/linearleastsquaresregression.hpp
@@ -106,7 +106,11 @@
Matrix A(n, m);
for (i=0; i<m; ++i)
- std::transform(x.begin(), x.end(), A.column_begin(i), v[i]);
+ for(size_t j=0; j<x.size(); ++j)
+ {
+ A[j][i]=v[i](x[j]);
+ }
+
const SVD svd(A);
const Matrix& V = svd.V();
--
Bojan Nikolic ||
http://www.bnikolic.co.uk------------------------------------------------------------------------------
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users