From 6dc70f79414ded94e88755755ffa1c1d16509d9d Mon Sep 17 00:00:00 2001 From: ntfrgl Date: Sun, 9 Aug 2015 00:06:32 +0200 Subject: Possible fix for #141 --- packages/base/src/Internal/C/lapack-aux.c | 12 ++++-------- packages/base/src/Internal/C/lapack-aux.h | 21 +++++++++++++++++++++ packages/base/src/Internal/C/vector-aux.c | 20 -------------------- 3 files changed, 25 insertions(+), 28 deletions(-) (limited to 'packages') diff --git a/packages/base/src/Internal/C/lapack-aux.c b/packages/base/src/Internal/C/lapack-aux.c index 177d373..ff7ad92 100644 --- a/packages/base/src/Internal/C/lapack-aux.c +++ b/packages/base/src/Internal/C/lapack-aux.c @@ -55,10 +55,6 @@ typedef float complex TCF; #define NODEFPOS 2006 #define NOSPRTD 2007 -inline int mod (int a, int b); - -inline int64_t mod_l (int64_t a, int64_t b); - //////////////////////////////////////////////////////////////////////////////// void asm_finit() { #ifdef i386 @@ -247,7 +243,7 @@ int svd_l_C(OCMAT(a),OCMAT(u), DVEC(s),OCMAT(v)) { ldvt = q; } }DEBUGMSG("svd_l_C"); - + double *rwork = (double*) malloc(5*q*sizeof(double)); CHECK(!rwork,MEM); integer lwork = -1; @@ -423,7 +419,7 @@ int eig_l_R(ODMAT(a),ODMAT(u), CVEC(s),ODMAT(v)) { //////////////////// symmetric real eigensystem //////////// int dsyev_(char *jobz, char *uplo, integer *n, doublereal *a, - integer *lda, doublereal *w, doublereal *work, integer *lwork, + integer *lda, doublereal *w, doublereal *work, integer *lwork, integer *info); int eig_l_S(int wantV,DVEC(s),ODMAT(v)) { @@ -665,7 +661,7 @@ int linearSolveLSC_l(OCMAT(a),OCMAT(b)) { int dgelss_(integer *m, integer *n, integer *nrhs, doublereal *a, integer *lda, doublereal *b, integer *ldb, doublereal * s, doublereal *rcond, integer *rank, doublereal *work, integer *lwork, - integer *info); + integer *info); int linearSolveSVDR_l(double rcond,ODMAT(a),ODMAT(b)) { integer m = ar; @@ -955,7 +951,7 @@ int schur_l_R(ODMAT(u), ODMAT(s)) { int zgees_(char *jobvs, char *sort, L_fp select, integer *n, doublecomplex *a, integer *lda, integer *sdim, doublecomplex *w, doublecomplex *vs, integer *ldvs, doublecomplex *work, integer *lwork, - doublereal *rwork, logical *bwork, integer *info); + doublereal *rwork, logical *bwork, integer *info); int schur_l_C(OCMAT(u), OCMAT(s)) { integer m = sr; diff --git a/packages/base/src/Internal/C/lapack-aux.h b/packages/base/src/Internal/C/lapack-aux.h index b38ca7a..e0dd5f6 100644 --- a/packages/base/src/Internal/C/lapack-aux.h +++ b/packages/base/src/Internal/C/lapack-aux.h @@ -88,3 +88,24 @@ typedef short ftnlen; #define AT(m,i,j) (m##p[(i)*m##Xr + (j)*m##Xc]) #define TRAV(m,i,j) int i,j; for (i=0;i0) { + return m >=0 ? m : m+b; + } else { + return m <=0 ? m : m+b; + } +} + +inline +int64_t mod_l (int64_t a, int64_t b) { + int64_t m = a % b; + if (b>0) { + return m >=0 ? m : m+b; + } else { + return m <=0 ? m : m+b; + } +} diff --git a/packages/base/src/Internal/C/vector-aux.c b/packages/base/src/Internal/C/vector-aux.c index 5528a9d..a52b969 100644 --- a/packages/base/src/Internal/C/vector-aux.c +++ b/packages/base/src/Internal/C/vector-aux.c @@ -716,16 +716,6 @@ int mapValF(int code, float* pval, KFVEC(x), FVEC(r)) { } } -inline -int mod (int a, int b) { - int m = a % b; - if (b>0) { - return m >=0 ? m : m+b; - } else { - return m <=0 ? m : m+b; - } -} - int mapValI(int code, int* pval, KIVEC(x), IVEC(r)) { int k; int val = *pval; @@ -742,16 +732,6 @@ int mapValI(int code, int* pval, KIVEC(x), IVEC(r)) { } } -inline -int64_t mod_l (int64_t a, int64_t b) { - int64_t m = a % b; - if (b>0) { - return m >=0 ? m : m+b; - } else { - return m <=0 ? m : m+b; - } -} - int mapValL(int code, int64_t* pval, KLVEC(x), LVEC(r)) { int k; int64_t val = *pval; -- cgit v1.2.3