문제

I am seeking a C or C++ version of gamma and log gamma functions.

Are there any code pieces or libraries recommended?

If possible, I want to know the principle of the implementations.

Thank you!!!

도움이 되었습니까?

해결책 2

If you can't use C++11: The GNU GSL has all Gamma function you would ever need: http://www.gnu.org/software/gsl/manual/html_node/Gamma-Functions.html#index-gsl_005fsf_005flngamma-583

Or you can have a look at boost's math special functions: http://www.boost.org/doc/libs/1_53_0/libs/math/doc/sf_and_dist/html/math_toolkit/special/sf_gamma/lgamma.html

다른 팁

In c++11, you can use std::lgamma for log gamma, and tgamma for gamma.

You can try to have a look at Numerical Recipes In C, it should contain the functions you need.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top