问题
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.
回答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.
回答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.
来源:https://stackoverflow.com/questions/18036274/c-bessel-function-for-complex-numbers