From: SourceForge.net <noreply@so...>  20040525 13:53:27

Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=2585307 By: yxi Sorry to bother again. I have something new. I also tested the polynomial solver and two bessel function examples, and just found that the two programs for bessel functions did work under MinGW gcc and outputs are exactly as they should be. But the code for polynomial root solver still behaved same as my matrix example. (All compiling steps are same as previous one). I attached the code again. Seems something is wrong with the memory allocation under my MinGW? How can I examine further? Thank you very much for any help! yxi (Yingfu) /*Program for polynomail roots solver*/ #include <stdio.h> #include <gsl/gsl_poly.h> int main (void) { int i; /* coefficient of P(x) = 1 + x^5 */ double a[6] = { 1, 0, 0, 0, 0, 1 }; double z[10]; gsl_poly_complex_workspace * w = gsl_poly_complex_workspace_alloc (6); gsl_poly_complex_solve (a, 6, w, z); gsl_poly_complex_workspace_free (w); for (i = 0; i < 5; i++) { printf ("z%d = %+.18f %+.18f\n", i, z[2*i], z[2*i+1]); } return 0; } /*end of pplynomial solver*/ /*program for bessel function 1*/ #include <stdio.h> #include <gsl/gsl_errno.h> #include <gsl/gsl_sf_bessel.h> int main (void) { double x = 5.0; gsl_sf_result result; double expected = 0.17759677131433830434739701; int status = gsl_sf_bessel_J0_e (x, &result); printf ("status = %s\n", gsl_strerror(status)); printf ("J0(5.0) = %.18f\n" " +/ % .18f\n", result.val, result.err); printf ("exact = %.18f\n", expected); return status; } /*program for bessel function 2*/ #include <stdio.h> #include <gsl/gsl_sf_bessel.h> int main (void) { double x = 5.0; double expected = 0.17759677131433830434739701; double y = gsl_sf_bessel_J0 (x); printf ("J0(5.0) = %.18f\n", y); printf ("exact = %.18f\n", expected); return 0; } ______________________________________________________________________ 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=286529 