无法理解此错误(错误:端点不会封闭最小值(GSL:FSOLVER.C:126))

发布于 2025-01-22 23:06:53 字数 1636 浏览 3 评论 0原文

我正在处理此代码: https://github.com/ucla-tmd/ogata 。如果执行快速傅立叶变换。

它集成了函数 test ,根据一些预定义的选项,这些选项是fbt -fbt的参数(bessel order,某些选项,无关紧要的选项,函数调用的数量,估算函数具有最大值的估算值)。到目前为止,一切都很好。

该代码可以从 test 中使用该函数,但这不是我实际使用的功能,因此我切换到EXP(x)之类的东西,无论我做什么我总是得到:(

它总是可以编译好,但是当我运行.o文件时,它给了我这个)

gsl:fsolver.c:126:错误:端点: 调用默认GSL错误处理程序。 。

首先,我认为该函数的最大值Q在FBT中可能是一个问题,但是每当我更改它时,它会给我带来相同的错误

非常感谢任何帮助。

double test( double x, double width ){ return x*exp(-x/width);} // test function to transform data allows to send anything else to the function


int main( void )
{

 //FBT(Bessel Order nu, option of function (always zero), number of function calls,  rough estimate where the maximum of the function f(x) is).
 
  FBT ogata0 = FBT(0.0,0,10,1.0); // Fourier Transform with Jnu, nu=0.0 and N=10
  
  double qT = 1.;
  double width = 1.;

 //call da ogata 0 para função teste 
  auto begin = std::chrono::high_resolution_clock::now();
  double res = ogata0.fbt(std::bind(test, std::placeholders::_1, width),qT);
  auto end = std::chrono::high_resolution_clock::now();


  std::cout << std::setprecision(30) << " FT( J0(x*qT) x*exp(-x) ) at qT= " << qT << std::endl;
  std::cout << std::setprecision(30) << "Numerical transformed = " << res << std::endl;
  auto overhead=std::chrono::duration_cast<std::chrono::nanoseconds>(end-begin).count();
  std::cout<<"Calc time: "<<overhead<<" nanoseconds\n";



}

I'm working with this code: https://github.com/UCLA-TMD/Ogata. If performs a fast fourier transform.

It integrates the function test, according to some predefined options that are argument of the FBT - FBT(bessel order,some option that doesnt matter,Number of function calls, estimate value where function has its maximum). So far so good.

This code works fine with that function from test, but that's not the function I actually need to use, so I switched to something like exp(x) just to test it, and I no matter what I do I always get:

(It always compiles okay, but when I run the .o file, it gives me this)

gsl: fsolver.c:126: ERROR: endpoints do not enclose a minimum
Default GSL error handler invoked.
Aborted (core dumped)

At first I thought it could be a problem with the function's maximum value Q in FBT, but whenever I change it, it gives me the same error.

Would really appreciate any help.

double test( double x, double width ){ return x*exp(-x/width);} // test function to transform data allows to send anything else to the function


int main( void )
{

 //FBT(Bessel Order nu, option of function (always zero), number of function calls,  rough estimate where the maximum of the function f(x) is).
 
  FBT ogata0 = FBT(0.0,0,10,1.0); // Fourier Transform with Jnu, nu=0.0 and N=10
  
  double qT = 1.;
  double width = 1.;

 //call da ogata 0 para função teste 
  auto begin = std::chrono::high_resolution_clock::now();
  double res = ogata0.fbt(std::bind(test, std::placeholders::_1, width),qT);
  auto end = std::chrono::high_resolution_clock::now();


  std::cout << std::setprecision(30) << " FT( J0(x*qT) x*exp(-x) ) at qT= " << qT << std::endl;
  std::cout << std::setprecision(30) << "Numerical transformed = " << res << std::endl;
  auto overhead=std::chrono::duration_cast<std::chrono::nanoseconds>(end-begin).count();
  std::cout<<"Calc time: "<<overhead<<" nanoseconds\n";



}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文