summaryrefslogtreecommitdiff
path: root/packages/base/src/Internal/C/lapack-aux.c
diff options
context:
space:
mode:
Diffstat (limited to 'packages/base/src/Internal/C/lapack-aux.c')
-rw-r--r--packages/base/src/Internal/C/lapack-aux.c38
1 files changed, 17 insertions, 21 deletions
diff --git a/packages/base/src/Internal/C/lapack-aux.c b/packages/base/src/Internal/C/lapack-aux.c
index 7da6f6a..1601bef 100644
--- a/packages/base/src/Internal/C/lapack-aux.c
+++ b/packages/base/src/Internal/C/lapack-aux.c
@@ -1290,29 +1290,25 @@ int multiplyQ(int ta, int tb, KQMAT(a),KQMAT(b),QMAT(r)) {
1290} 1290}
1291 1291
1292 1292
1293int multiplyI(KOIMAT(a), KOIMAT(b), OIMAT(r)) { 1293#define MULT_IMP_VER(OP) \
1294 { TRAV(r,i,j) { 1294 { TRAV(r,i,j) { \
1295 int k; 1295 int k; \
1296 AT(r,i,j) = 0; 1296 AT(r,i,j) = 0; \
1297 for (k=0;k<ac;k++) { 1297 for (k=0;k<ac;k++) { \
1298 AT(r,i,j) += AT(a,i,k) * AT(b,k,j); 1298 OP \
1299 } 1299 } \
1300 } 1300 } \
1301 } 1301 }
1302 OK
1303}
1304 1302
1305int multiplyL(KOLMAT(a), KOLMAT(b), OLMAT(r)) { 1303#define MULT_IMP { \
1306 { TRAV(r,i,j) { 1304 if (m==1) { \
1307 int k; 1305 MULT_IMP_VER( AT(r,i,j) += AT(a,i,k) * AT(b,k,j); ) \
1308 AT(r,i,j) = 0; 1306 } else { \
1309 for (k=0;k<ac;k++) { 1307 MULT_IMP_VER( AT(r,i,j) = (AT(r,i,j) + (AT(a,i,k) * AT(b,k,j)) % m) % m ; ) \
1310 AT(r,i,j) += AT(a,i,k) * AT(b,k,j); 1308 } OK }
1311 } 1309
1312 } 1310int multiplyI(int m, KOIMAT(a), KOIMAT(b), OIMAT(r)) MULT_IMP
1313 } 1311int multiplyL(int32_t m, KOLMAT(a), KOLMAT(b), OLMAT(r)) MULT_IMP
1314 OK
1315}
1316 1312
1317 1313
1318////////////////// sparse matrix-product /////////////////////////////////////// 1314////////////////// sparse matrix-product ///////////////////////////////////////