2

I want to implement the Bessel functions of first and second kindDescription of bessel functions for complex numbers in C++. Now I am looking for possibilities to introduce them in my source code. Since math.h only contains bessel functions for real numbers, I would be interested in seeing any kind of possibility.

2 Answers2

2

I haven't found that Boost is compatible with complex arguments (though it may a mistake on my part).

The FORTRAN code developed by D.E. Amos (the code used by MATLAB and others) is in the public domain and can be used by anybody. I have been developing a C++ interface to the library, extending it to the case of negative orders. You can check it out on GitHub.

Joey Dumont
  • 898
  • 2
  • 7
  • 25
1

The Boost library implements ordinary Bessel functions of the first and second kind and modified Bessel functions of the first and second kind for both real and complex numbers (see documentation about Bessel functions).

Don't try to reinvent the wheel, just use the Boost implementation which is far superior to anything you could write yourself.

Kyle_the_hacker
  • 1,394
  • 1
  • 11
  • 27
  • 2
    This doesn't seem to be the case. I haven't been able to compile something like `std::cout << boost::math::cyl_bessel_j > (0.0,std::complex(1.0,0.0)) << std::endl;` with Boost. – Joey Dumont Nov 04 '14 at 03:39
  • Indeed, they don't seem to support complex arguments, if [this discussion](http://boost.2283326.n4.nabble.com/no-subject-td4478639.html) still represents current state. – Ruslan Jun 04 '15 at 12:58