Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=3058932 By: gervasoni
I got some troubles to use wavelet api from the GSL libraries. Each time i try, the program does crash. I'm using MinGW32 binaries (from gnuwin32), static version. Here's an example (coming from the gsl doc - i just replaced the file reading part by a simple array). I had this problem with gnuwin32 binaries, AND with compiled from scratch binaries. Any clues ? #include <stdio.h> #include <math.h> #include <gsl/gsl_sort.h> #include <gsl/gsl_wavelet.h> int main (int argc, char **argv) { int i,n=256,nc=20; double *data=(double*)malloc(n*sizeof (double)); double *abscoeff = (double*)malloc (n * sizeof (double)); size_t *p = (size_t*)malloc (n * sizeof (size_t)); for (i=0;i<256;i++) data[i]=(double)i; gsl_wavelet *w = gsl_wavelet_alloc (gsl_wavelet_daubechies, 4); gsl_wavelet_workspace *work = gsl_wavelet_workspace_alloc (n); gsl_wavelet_transform_forward (w, data, 1, n, work); for (i = 0; i < n; i++) { abscoeff[i] = fabs (data[i]); } gsl_sort_index (p, abscoeff, 1, n); for (i = 0; (i + nc) < n; i++) data[p[i]] = 0; gsl_wavelet_transform_inverse (w, data, 1, n, work); for (i = 0; i < n; i++) { printf ("%g\n", data[i]); } } Jean-Pierre Gervasoni ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to SourceForge.net and visit: https://sourceforge.net/forum/unmonitor.php?forum_id=74807 ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ GnuWin32-Users mailing list GnuWin32-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gnuwin32-users