如何在boost中使用双伽马函数

how to use digamma function in boost

本文关键字:马函数 函数 boost      更新时间:2023-10-16

我不明白boost的digamma函数如何在程序中使用。任何例子,是赞赏的。我包含了boost

#include <boost/math/special_functions/digamma.hpp>

,但函数调用digamma(x),其中x是double给出以下错误:

error: ' digamma '没有依赖于模板的参数参数,因此必须声明' digamma '(-fpermissive)

下面是一个例子:http://cpp.sh/7bdu

#include <boost/math/special_functions/digamma.hpp>
#include <iostream>
int main() {
    std::cout << boost::math::digamma(3.14) << "n";
}

edit:问题被编辑时出现错误消息。这个错误信息意味着编译器没有找到digamma的定义,因为您没有包含命名空间位boost::math::