diff options
author | Alberto Ruiz <aruiz@um.es> | 2014-05-06 09:43:39 +0200 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2014-05-06 09:43:39 +0200 |
commit | 8ecec15cee88462e46ec9d0ce361224c0fcdba31 (patch) | |
tree | 02d521e954ccdab7f023432ba229054e59785ea5 /lib | |
parent | c9914d694d3b86ece46fa0c76e0466c6cd394d14 (diff) |
fix C warnings
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Numeric/GSL/gsl-aux.c | 4 | ||||
-rw-r--r-- | lib/Numeric/GSL/gsl-ode.c | 2 | ||||
-rw-r--r-- | lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.c | 34 |
3 files changed, 21 insertions, 19 deletions
diff --git a/lib/Numeric/GSL/gsl-aux.c b/lib/Numeric/GSL/gsl-aux.c index 1a4a3e6..410d157 100644 --- a/lib/Numeric/GSL/gsl-aux.c +++ b/lib/Numeric/GSL/gsl-aux.c | |||
@@ -810,7 +810,9 @@ int integrate_cquad(double f(double,void*), double a, double b, double aprec, do | |||
810 | gsl_function F; | 810 | gsl_function F; |
811 | F.function = f; | 811 | F.function = f; |
812 | F.params = NULL; | 812 | F.params = NULL; |
813 | int res = gsl_integration_cquad (&F, a, b, aprec, prec, wk, result, error, neval); | 813 | size_t * sneval = NULL; |
814 | int res = gsl_integration_cquad (&F, a, b, aprec, prec, wk, result, error, sneval); | ||
815 | *neval = *sneval; | ||
814 | CHECK(res,res); | 816 | CHECK(res,res); |
815 | gsl_integration_cquad_workspace_free (wk); | 817 | gsl_integration_cquad_workspace_free (wk); |
816 | OK | 818 | OK |
diff --git a/lib/Numeric/GSL/gsl-ode.c b/lib/Numeric/GSL/gsl-ode.c index 7386d10..3f2771b 100644 --- a/lib/Numeric/GSL/gsl-ode.c +++ b/lib/Numeric/GSL/gsl-ode.c | |||
@@ -148,7 +148,7 @@ int ode(int method, double h, double eps_abs, double eps_rel, | |||
148 | 148 | ||
149 | double* y = (double*)calloc(xin,sizeof(double)); | 149 | double* y = (double*)calloc(xin,sizeof(double)); |
150 | int i,j; | 150 | int i,j; |
151 | int status; | 151 | int status=0; |
152 | for(i=0; i< xin; i++) { | 152 | for(i=0; i< xin; i++) { |
153 | y[i] = xip[i]; | 153 | y[i] = xip[i]; |
154 | solp[i] = xip[i]; | 154 | solp[i] = xip[i]; |
diff --git a/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.c b/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.c index 1c35376..51972eb 100644 --- a/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.c +++ b/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.c | |||
@@ -111,7 +111,7 @@ int svd_l_R(KDMAT(a),DMAT(u), DVEC(s),DMAT(v)) { | |||
111 | integer n = ac; | 111 | integer n = ac; |
112 | integer q = MIN(m,n); | 112 | integer q = MIN(m,n); |
113 | REQUIRES(sn==q,BAD_SIZE); | 113 | REQUIRES(sn==q,BAD_SIZE); |
114 | REQUIRES(up==NULL || ur==m && (uc==m || uc==q),BAD_SIZE); | 114 | REQUIRES(up==NULL || (ur==m && (uc==m || uc==q)),BAD_SIZE); |
115 | char* jobu = "A"; | 115 | char* jobu = "A"; |
116 | if (up==NULL) { | 116 | if (up==NULL) { |
117 | jobu = "N"; | 117 | jobu = "N"; |
@@ -120,7 +120,7 @@ int svd_l_R(KDMAT(a),DMAT(u), DVEC(s),DMAT(v)) { | |||
120 | jobu = "S"; | 120 | jobu = "S"; |
121 | } | 121 | } |
122 | } | 122 | } |
123 | REQUIRES(vp==NULL || vc==n && (vr==n || vr==q),BAD_SIZE); | 123 | REQUIRES(vp==NULL || (vc==n && (vr==n || vr==q)),BAD_SIZE); |
124 | char* jobvt = "A"; | 124 | char* jobvt = "A"; |
125 | integer ldvt = n; | 125 | integer ldvt = n; |
126 | if (vp==NULL) { | 126 | if (vp==NULL) { |
@@ -174,10 +174,10 @@ int svd_l_Rdd(KDMAT(a),DMAT(u), DVEC(s),DMAT(v)) { | |||
174 | integer n = ac; | 174 | integer n = ac; |
175 | integer q = MIN(m,n); | 175 | integer q = MIN(m,n); |
176 | REQUIRES(sn==q,BAD_SIZE); | 176 | REQUIRES(sn==q,BAD_SIZE); |
177 | REQUIRES(up == NULL && vp == NULL | 177 | REQUIRES((up == NULL && vp == NULL) |
178 | || ur==m && vc==n | 178 | || (ur==m && vc==n |
179 | && (uc == q && vr == q | 179 | && ((uc == q && vr == q) |
180 | || uc == m && vc==n),BAD_SIZE); | 180 | || (uc == m && vc==n))),BAD_SIZE); |
181 | char* jobz = "A"; | 181 | char* jobz = "A"; |
182 | integer ldvt = n; | 182 | integer ldvt = n; |
183 | if (up==NULL) { | 183 | if (up==NULL) { |
@@ -224,7 +224,7 @@ int svd_l_C(KCMAT(a),CMAT(u), DVEC(s),CMAT(v)) { | |||
224 | integer n = ac; | 224 | integer n = ac; |
225 | integer q = MIN(m,n); | 225 | integer q = MIN(m,n); |
226 | REQUIRES(sn==q,BAD_SIZE); | 226 | REQUIRES(sn==q,BAD_SIZE); |
227 | REQUIRES(up==NULL || ur==m && (uc==m || uc==q),BAD_SIZE); | 227 | REQUIRES(up==NULL || (ur==m && (uc==m || uc==q)),BAD_SIZE); |
228 | char* jobu = "A"; | 228 | char* jobu = "A"; |
229 | if (up==NULL) { | 229 | if (up==NULL) { |
230 | jobu = "N"; | 230 | jobu = "N"; |
@@ -233,7 +233,7 @@ int svd_l_C(KCMAT(a),CMAT(u), DVEC(s),CMAT(v)) { | |||
233 | jobu = "S"; | 233 | jobu = "S"; |
234 | } | 234 | } |
235 | } | 235 | } |
236 | REQUIRES(vp==NULL || vc==n && (vr==n || vr==q),BAD_SIZE); | 236 | REQUIRES(vp==NULL || (vc==n && (vr==n || vr==q)),BAD_SIZE); |
237 | char* jobvt = "A"; | 237 | char* jobvt = "A"; |
238 | integer ldvt = n; | 238 | integer ldvt = n; |
239 | if (vp==NULL) { | 239 | if (vp==NULL) { |
@@ -291,10 +291,10 @@ int svd_l_Cdd(KCMAT(a),CMAT(u), DVEC(s),CMAT(v)) { | |||
291 | integer n = ac; | 291 | integer n = ac; |
292 | integer q = MIN(m,n); | 292 | integer q = MIN(m,n); |
293 | REQUIRES(sn==q,BAD_SIZE); | 293 | REQUIRES(sn==q,BAD_SIZE); |
294 | REQUIRES(up == NULL && vp == NULL | 294 | REQUIRES((up == NULL && vp == NULL) |
295 | || ur==m && vc==n | 295 | || (ur==m && vc==n |
296 | && (uc == q && vr == q | 296 | && ((uc == q && vr == q) |
297 | || uc == m && vc==n),BAD_SIZE); | 297 | || (uc == m && vc==n))),BAD_SIZE); |
298 | char* jobz = "A"; | 298 | char* jobz = "A"; |
299 | integer ldvt = n; | 299 | integer ldvt = n; |
300 | if (up==NULL) { | 300 | if (up==NULL) { |
@@ -349,9 +349,9 @@ int svd_l_Cdd(KCMAT(a),CMAT(u), DVEC(s),CMAT(v)) { | |||
349 | int eig_l_C(KCMAT(a), CMAT(u), CVEC(s),CMAT(v)) { | 349 | int eig_l_C(KCMAT(a), CMAT(u), CVEC(s),CMAT(v)) { |
350 | integer n = ar; | 350 | integer n = ar; |
351 | REQUIRES(ac==n && sn==n, BAD_SIZE); | 351 | REQUIRES(ac==n && sn==n, BAD_SIZE); |
352 | REQUIRES(up==NULL || ur==n && uc==n, BAD_SIZE); | 352 | REQUIRES(up==NULL || (ur==n && uc==n), BAD_SIZE); |
353 | char jobvl = up==NULL?'N':'V'; | 353 | char jobvl = up==NULL?'N':'V'; |
354 | REQUIRES(vp==NULL || vr==n && vc==n, BAD_SIZE); | 354 | REQUIRES(vp==NULL || (vr==n && vc==n), BAD_SIZE); |
355 | char jobvr = vp==NULL?'N':'V'; | 355 | char jobvr = vp==NULL?'N':'V'; |
356 | DEBUGMSG("eig_l_C"); | 356 | DEBUGMSG("eig_l_C"); |
357 | doublecomplex *B = (doublecomplex*)malloc(n*n*sizeof(doublecomplex)); | 357 | doublecomplex *B = (doublecomplex*)malloc(n*n*sizeof(doublecomplex)); |
@@ -404,9 +404,9 @@ int eig_l_C(KCMAT(a), CMAT(u), CVEC(s),CMAT(v)) { | |||
404 | int eig_l_R(KDMAT(a),DMAT(u), CVEC(s),DMAT(v)) { | 404 | int eig_l_R(KDMAT(a),DMAT(u), CVEC(s),DMAT(v)) { |
405 | integer n = ar; | 405 | integer n = ar; |
406 | REQUIRES(ac==n && sn==n, BAD_SIZE); | 406 | REQUIRES(ac==n && sn==n, BAD_SIZE); |
407 | REQUIRES(up==NULL || ur==n && uc==n, BAD_SIZE); | 407 | REQUIRES(up==NULL || (ur==n && uc==n), BAD_SIZE); |
408 | char jobvl = up==NULL?'N':'V'; | 408 | char jobvl = up==NULL?'N':'V'; |
409 | REQUIRES(vp==NULL || vr==n && vc==n, BAD_SIZE); | 409 | REQUIRES(vp==NULL || (vr==n && vc==n), BAD_SIZE); |
410 | char jobvr = vp==NULL?'N':'V'; | 410 | char jobvr = vp==NULL?'N':'V'; |
411 | DEBUGMSG("eig_l_R"); | 411 | DEBUGMSG("eig_l_R"); |
412 | double *B = (double*)malloc(n*n*sizeof(double)); | 412 | double *B = (double*)malloc(n*n*sizeof(double)); |
@@ -989,7 +989,7 @@ int schur_l_R(KDMAT(a), DMAT(u), DMAT(s)) { | |||
989 | integer n = ac; | 989 | integer n = ac; |
990 | REQUIRES(m>=1 && n==m && ur==n && uc==n && sr==n && sc==n, BAD_SIZE); | 990 | REQUIRES(m>=1 && n==m && ur==n && uc==n && sr==n && sc==n, BAD_SIZE); |
991 | DEBUGMSG("schur_l_R"); | 991 | DEBUGMSG("schur_l_R"); |
992 | int k; | 992 | //int k; |
993 | //printf("---------------------------\n"); | 993 | //printf("---------------------------\n"); |
994 | //printf("%p: ",ap); for(k=0;k<n*n;k++) printf("%f ",ap[k]); printf("\n"); | 994 | //printf("%p: ",ap); for(k=0;k<n*n;k++) printf("%f ",ap[k]); printf("\n"); |
995 | //printf("%p: ",up); for(k=0;k<n*n;k++) printf("%f ",up[k]); printf("\n"); | 995 | //printf("%p: ",up); for(k=0;k<n*n;k++) printf("%f ",up[k]); printf("\n"); |