1

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";



}
  • Depending on the version of GSL you are running you may want to look at this bug [gsl: fsolver.c:126: ERROR: endpoints do not enclose a minimum](https://github.com/zhanxw/rvtests/issues/32) -- that was fixed about 5 years ago, but some distros may be running GSL builds from about that time. Also see: [unselected answer in - Is this a bug in GSL's minimum finding routine?](https://stackoverflow.com/q/18807512/3422102) for explanation of why that error can occur. – David C. Rankin Apr 21 '22 at 04:28

0 Answers0