|
From: Toyin A. <toy...@ho...> - 2010-01-19 04:04:45
|
Hi all,
I have been looking at the class AnalyticHestonEngine::Integration and I find that there are two variables that seem to be declared but never used (AnalyticHestonEngine.hpp).
mutable Real c_inf_;
mutable boost::function1<Real, Real> f_;
Also line 231 within the file AnalyticHestonEngine.cpp returns an expression, but the two (const std::complex<Real>) computed local expressions above it are never used in the return value. Am I missing something?
Finally, can someone verify the following (Line 537 of AnalyticHestonEngine.cpp)
(
boost::function1<Real, Real>(
if_then_else_return ( (_1+1.0)*c_inf> QL_EPSILON,
bind(f, -bind(std::ptr_fun<Real,Real>(std::log),
0.5*_1+0.5 )/c_inf )/((_1+1.0)*c_inf),
bind(constant<Real, Real>(0.0), _1))));
is basically the same as
double dRes = 0.0;
if ((_1 + 1.0) * c_inf> QL_EPSILON)
{
dRes = (-std::log(0.5 * _1 + 0.5) / c_inf);
dRes = f(dRes) / ((_1 + 1.0) * c_inf);
}
else
{
dRes = 0.0;
}
return dRes;
AND (Line 548 of AnalyticHestonEngine.cpp)
(
boost::function1<Real, Real>(
if_then_else_return ( _1*c_inf> QL_EPSILON,
bind(f,-bind(std::ptr_fun<Real,Real>(std::log), _1)
/c_inf) /(_1*c_inf),
bind(constant<Real, Real>(0.0), _1))),
0.0, 1.0);
is bascically the same as
double dRes = 0.0;
if (_1 * c_inf> QL_EPSILON)
{
dRes = (-std::log(_1) / c_inf);
dRes = f(dRes) / (_1 * c_inf);
}
else
{
dRes = 0.0;
}
return dRes;
Best Regards and thanks,
Toyin Akin.
_________________________________________________________________
Do you have a story that started on Hotmail? Tell us now
http://clk.atdmt.com/UKM/go/195013117/direct/01/
|