gpt4 book ai didi

c++ - boost::numeric::quadrature 或 gsl quadrature 中的加权函数

转载 作者:塔克拉玛干 更新时间:2023-11-03 07:57:35 25 4
gpt4 key购买 nike

我正在尝试对 Gamma PDF (pdf(x, a, b)) 进行积分并应用加权函数 (w(x))。我一直在尝试为 boost 或 gsl 在 C++ 中找到一个示例来执行此操作,但到目前为止还不够。

我试图将其用作 boost 中的输入函数,但它似乎不起作用

struct f(a, b)
{
double operator()(double x){ return w(x)*gamma_distribution(a, b) };

}

虽然我不是 100% 确定原因。

非常感谢。

最佳答案

首先,你的语法是错误的。你的片段应该是

struct f
{
double operator()(double x) { return w(x)*gamma_distribution(a, b); }
};

关于c++ - boost::numeric::quadrature 或 gsl quadrature 中的加权函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15994382/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com