From 9b2ba8469df6158713c960d5b971508d8144d5b3 Mon Sep 17 00:00:00 2001 From: Dominic Steinitz Date: Fri, 29 Sep 2017 09:34:52 +0100 Subject: Print errors to stderr --- packages/gsl/src/Numeric/GSL/gsl-ode.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'packages/gsl/src/Numeric') diff --git a/packages/gsl/src/Numeric/GSL/gsl-ode.c b/packages/gsl/src/Numeric/GSL/gsl-ode.c index 72c8617..4e24cb6 100644 --- a/packages/gsl/src/Numeric/GSL/gsl-ode.c +++ b/packages/gsl/src/Numeric/GSL/gsl-ode.c @@ -40,9 +40,9 @@ int ode(int method, int control, double h, case 5 : {T = gsl_odeiv_step_rk2imp; break; } case 6 : {T = gsl_odeiv_step_rk4imp; break; } case 7 : {T = gsl_odeiv_step_bsimp; break; } - case 8 : { printf("Sorry: ODE rk1imp not available in this GSL version\n"); exit(0); } - case 9 : { printf("Sorry: ODE msadams not available in this GSL version\n"); exit(0); } - case 10: { printf("Sorry: ODE msbdf not available in this GSL version\n"); exit(0); } + case 8 : { fprintf(stderr,"Sorry: ODE rk1imp not available in this GSL version\n"); exit(0); } + case 9 : { fprintf(stderr,"Sorry: ODE msadams not available in this GSL version\n"); exit(0); } + case 10: { fprintf(stderr,"Sorry: ODE msbdf not available in this GSL version\n"); exit(0); } default: ERROR(BAD_CODE); } @@ -180,11 +180,11 @@ int ode(int method, int control, double h, if (status != GSL_SUCCESS) { int k; printf ("error in ode, return value=%d\n", status); - printf("last successful values are:\n"); - printf("t = %.5e\n", t); + fprintf(stderr,"last successful values are:\n"); + fprintf(stderr,"t = %.5e\n", t); for (k=0; k < xin; k++) { - printf("y[%d] = %.5e\n", k, y[k]); + fprintf(stderr,"y[%d] = %.5e\n", k, y[k]); } break; } -- cgit v1.2.3 From 4fa4dd4c80f7fcd94f31ae1bb82bef7d1b3bb0f8 Mon Sep 17 00:00:00 2001 From: Dominic Steinitz Date: Fri, 29 Sep 2017 10:22:48 +0100 Subject: Fix missed printf --- packages/gsl/src/Numeric/GSL/gsl-ode.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'packages/gsl/src/Numeric') diff --git a/packages/gsl/src/Numeric/GSL/gsl-ode.c b/packages/gsl/src/Numeric/GSL/gsl-ode.c index 4e24cb6..84626d9 100644 --- a/packages/gsl/src/Numeric/GSL/gsl-ode.c +++ b/packages/gsl/src/Numeric/GSL/gsl-ode.c @@ -40,9 +40,9 @@ int ode(int method, int control, double h, case 5 : {T = gsl_odeiv_step_rk2imp; break; } case 6 : {T = gsl_odeiv_step_rk4imp; break; } case 7 : {T = gsl_odeiv_step_bsimp; break; } - case 8 : { fprintf(stderr,"Sorry: ODE rk1imp not available in this GSL version\n"); exit(0); } - case 9 : { fprintf(stderr,"Sorry: ODE msadams not available in this GSL version\n"); exit(0); } - case 10: { fprintf(stderr,"Sorry: ODE msbdf not available in this GSL version\n"); exit(0); } + case 8 : { fprintf(stderr, "Sorry: ODE rk1imp not available in this GSL version\n"); exit(0); } + case 9 : { fprintf(stderr, "Sorry: ODE msadams not available in this GSL version\n"); exit(0); } + case 10: { fprintf(stderr, "Sorry: ODE msbdf not available in this GSL version\n"); exit(0); } default: ERROR(BAD_CODE); } @@ -179,12 +179,12 @@ int ode(int method, int control, double h, if (status != GSL_SUCCESS) { int k; - printf ("error in ode, return value=%d\n", status); - fprintf(stderr,"last successful values are:\n"); - fprintf(stderr,"t = %.5e\n", t); + fprintf(stderr, "error in ode, return value=%d\n", status); + fprintf(stderr, "last successful values are:\n"); + fprintf(stderr, "t = %.5e\n", t); for (k=0; k < xin; k++) { - fprintf(stderr,"y[%d] = %.5e\n", k, y[k]); + fprintf(stderr, "y[%d] = %.5e\n", k, y[k]); } break; } -- cgit v1.2.3