我正在寻找伽马和对数伽马函数的C或C++版本。
有推荐的代码片段或库吗?
如果可能的话,我想知道实现的原理。
谢谢!
发布于 2013-03-18 17:21:24
如果你不能使用C++11: GNU GSL有你需要的所有Gamma功能:http://www.gnu.org/software/gsl/manual/html_node/Gamma-Functions.html#index-gsl_005fsf_005flngamma-583
或者,您可以查看boost的数学特殊函数:http://www.boost.org/doc/libs/1_53_0/libs/math/doc/sf_and_dist/html/math_toolkit/special/sf_gamma/lgamma.html
发布于 2013-03-18 16:58:59
在c++11中,可以使用std::lgamma表示对数gamma,使用tgamma表示gamma。
发布于 2013-03-18 16:59:51
你可以试着看看Numerical Recipes In C,它应该包含你需要的函数。
https://stackoverflow.com/questions/15472803
复制相似问题