forum.alglib.net
http://forum.alglib.net/

Numerical integration fails
http://forum.alglib.net/viewtopic.php?f=2&t=4379
Page 1 of 1

Author:  YuriRzhanov [ Fri Mar 26, 2021 6:13 pm ]
Post subject:  Numerical integration fails

Hello, I'm using an optimization procedure and each step requires tens of integrations (definite integrals of smooth functions). Every time call of AutoGKSmooth fails at
ae_assert(ae_isfinite(a, _state), "AutoGKSmooth: A is not finite!", _state);
Every time in different place (optimization uses randomization), and debugger shows that "a" is a valid floating number. Nevertheless ae_assert() claims that "cond" is "false".
Code:
               memset(&state, 0, sizeof(state));
               memset(&rep, 0, sizeof(rep));
               _autogkstate_init(&state, &_state, ae_true);
               _autogkreport_init(&rep, &_state, ae_true);
               autogksmooth(startLambda[i], stopLambda[i], &state, &_state);
               while (autogkiteration(&state, &_state))
               {
                  state.f = IntegrandAir(state.x, (void*)&pId[i]);
               }
               autogkresults(&state, &vAir, &rep, &_state);

Could it be a memory issue? Do I need to free anything after each integration?

Thank you,
Yuri

Author:  YuriRzhanov [ Sun Mar 28, 2021 3:02 pm ]
Post subject:  Re: Numerical integration fails

My fault, sorry. Should have checked that _state is being properly passed through the call stack.
I close the subject.

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/