strange behaviour with gsl_cdf_fdist_Q()
Rajarshi Guha
rajarshi@presidency.com
Wed Sep 3 16:59:00 GMT 2003
Hi,
more problems with gsl_cdf_fdist_Q() and very strange ones at that!
I'm using the above function in a program where a memory is alloced and
realloced multiple times.
I edited the file fdist.c to print out values on entry and just before
exit and the values that I see are OK:
# x = 3.145724 nu1 = 3.000000 nu2 = 23.000000 P = 0.044555
However, the return value is weird!
double pf = 0.0;
...
pf = gsl_cdf_fdist_Q(3.145724,(double)3,(double)23);
printf("%f\n", pf);
gives me
13.00000
Furthermore, on the next iteration a struct is corrupted for some reason
(elements have values of nan).
I have run my program through valgrind and I have no memory errors or
leaks. I also checked it with ElectricFence and that gives my program a
clean bill.
I'm pretty sure its some form of memory corruption somewhere, but as far
as the tools above see, my code is clean. I understand that the problem
is probably in my program, but has anybody experienced anything like
this and if so did they find out what was going on?
I delved into fdist.c but it seems that any memory problems would come
from beta.c but I'm not sure.
Any suggestions would prevent me from going bald at an early age :)
-------------------------------------------------------------------
Rajarshi Guha <rajarshi@presidency.com> <http://jijo.cjb.net>
GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE
-------------------------------------------------------------------
Psychology is merely producing habits out of rats.
More information about the Gsl-discuss
mailing list