aboutsummaryrefslogtreecommitdiff
path: root/redist/dclapack.h
diff options
context:
space:
mode:
authorcnlohr <lohr85@gmail.com>2018-03-17 03:05:21 -0400
committercnlohr <lohr85@gmail.com>2018-03-17 03:05:21 -0400
commit08eec7a6bd5edc0fd1cae7f98d7788ea3905a467 (patch)
tree5b7b538875a5c7dc216335c9189b8ad6b4c10c08 /redist/dclapack.h
parentbcf08b95ab6daa7ac7bffe1449fa8a11cad2a02a (diff)
downloadlibsurvive-08eec7a6bd5edc0fd1cae7f98d7788ea3905a467.tar.gz
libsurvive-08eec7a6bd5edc0fd1cae7f98d7788ea3905a467.tar.bz2
Now wrangled with ability to use submatricies.
Diffstat (limited to 'redist/dclapack.h')
-rw-r--r--redist/dclapack.h24
1 files changed, 11 insertions, 13 deletions
diff --git a/redist/dclapack.h b/redist/dclapack.h
index 76ce545..1dc7b77 100644
--- a/redist/dclapack.h
+++ b/redist/dclapack.h
@@ -10,16 +10,14 @@
#define _ABS(a) ( (a)<=0 ? 0-(a) : (a) )
#ifdef DYNAMIC_INDEX
- #define _(A,O,P) A[O*n+P]
- #define _I(A,O,P,n) A[O*n+P]
+ #define _(A,O,P) A[O*A##c+P]
#else
#define _(A,O,P) A[O][P]
- #define _I(A,O,P,n) A[O][P]
#endif
/*
- * Prints a matrix A (n by m)
+ * Prints a matrix A (n by m) (with witdth Ac)
*/
#define PRINT(A,n,m) { \
int i,j; \
@@ -34,7 +32,7 @@
}
/*
- * Returns the identity matrix
+ * Returns the identity matrix (with size n x n, but width Ic)
*/
#define IDENTITY(I,n) { \
int i,j; \
@@ -148,11 +146,11 @@
#ifdef DYNAMIC_INDEX
#define INV_SETUP(ORDER) \
- FLOAT Ipiv[ORDER*ORDER]; \
- FLOAT L[ORDER*ORDER]; \
- FLOAT U[ORDER*ORDER]; \
- FLOAT I[ORDER*ORDER]; \
- FLOAT C[ORDER*ORDER];
+ FLOAT Ipiv[ORDER*ORDER]; const int Ipivc = ORDER; \
+ FLOAT L[ORDER*ORDER]; const int Lc = ORDER; \
+ FLOAT U[ORDER*ORDER]; const int Uc = ORDER; \
+ FLOAT I[ORDER*ORDER]; const int Ic = ORDER; \
+ FLOAT C[ORDER*ORDER]; const int Cc = ORDER;
#else
#define INV_SETUP(ORDER) \
FLOAT Ipiv[ORDER][ORDER]; \
@@ -194,7 +192,7 @@ PRINT(Ainv,n,n); \
for (j=0; j<p; j++) { \
_(R,i,j) = 0.0f; \
for (k=0; k<m; k++) { \
- _(R,i,j) += _(A,i,k) * _I(B,k,j,m); \
+ _(R,i,j) += _(A,i,k) * _(B,k,j); \
} \
} \
} \
@@ -213,7 +211,7 @@ PRINT(Ainv,n,n); \
for (j=0; j<p; j++) { \
_(R,i,j) = _(C,i,j); \
for (k=0; k<m; k++) { \
- _(R,i,j) += _(A,i,k) * _I(B,k,j,m); \
+ _(R,i,j) += _(A,i,k) * _(B,k,j); \
} \
} \
} \
@@ -233,7 +231,7 @@ PRINT(Ainv,n,n); \
for (j=0; j<p; j++) { \
sum = 0.0f; \
for (k=0; k<m; k++) { \
- sum += _(A,i,k) * _I(B,k,j,m); \
+ sum += _(A,i,k) * _(B,k,j); \
} \
_(R,i,j) = alpha * sum + beta * _(C,i,j); \
} \