using boost for modified bessel function

Discuss code issues here

using boost for modified bessel function

Postby sruggiero » Thu Apr 28, 2011 12:55 pm


I am trying to use modified bessel function of the first kind (to be used in exact heston simulation) from boost.

According to boost's website the code is:

template <class T1, class T2>
calculated-result-type cyl_bessel_i(T1 v, T2 x);

but when i try the following piece of code I get tons of errors.

If I try passing doubles or ints to bessel function it works fine...why not complex? Boosts website states it works with complex numbers so I guess it must be a syntax error?

int main()
complex <double> x(1,1), result;
int a=1;
result = boost::math::cyl_bessel_i(a,x);
cout << result << endl;
return 0;

Thanks for any suggestions.
Posts: 13
Joined: Sat Jul 11, 2009 7:36 pm

Re: using boost for modified bessel function

Postby mj » Mon May 02, 2011 12:52 am

i've never tried boost's Bessel functions. Maybe Numerical recipes would be easier.
Site Admin
Posts: 1380
Joined: Fri Jul 27, 2007 7:21 am

Return to Code

Who is online

Users browsing this forum: No registered users and 1 guest