diff options
author | Alberto Ruiz <aruiz@um.es> | 2015-05-27 10:47:02 +0200 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2015-05-27 10:47:02 +0200 |
commit | c77c83f1e442e5fff408d883b7aac5043ba512a9 (patch) | |
tree | 8672fe52462b2bcc8f859dea50c266292a4e7a3a /packages/base/src/C | |
parent | c5795a191ded450987a30302c1d1fa4a265350ff (diff) |
omat, AT, remap
Diffstat (limited to 'packages/base/src/C')
-rw-r--r-- | packages/base/src/C/lapack-aux.c | 28 | ||||
-rw-r--r-- | packages/base/src/C/lapack-aux.h | 18 |
2 files changed, 46 insertions, 0 deletions
diff --git a/packages/base/src/C/lapack-aux.c b/packages/base/src/C/lapack-aux.c index 77381cc..a977d5f 100644 --- a/packages/base/src/C/lapack-aux.c +++ b/packages/base/src/C/lapack-aux.c | |||
@@ -1670,3 +1670,31 @@ int extractI(int modei, int modej, int tm, KIVEC(i), KIVEC(j), KIMAT(m), IMAT(r) | |||
1670 | EXTRACT_IMP | 1670 | EXTRACT_IMP |
1671 | } | 1671 | } |
1672 | 1672 | ||
1673 | //////////////////////// remap ///////////////////////////////// | ||
1674 | |||
1675 | #define REMAP_IMP \ | ||
1676 | REQUIRES(ir==jr && ic==jc && ir==rr && ic==rc ,BAD_SIZE); \ | ||
1677 | { TRAV(r,a,b) { AT(r,a,b) = AT(m,AT(i,a,b),AT(j,a,b)); } \ | ||
1678 | } \ | ||
1679 | OK | ||
1680 | |||
1681 | int remapD(KOIMAT(i), KOIMAT(j), KODMAT(m), ODMAT(r)) { | ||
1682 | REMAP_IMP | ||
1683 | } | ||
1684 | |||
1685 | int remapF(KOIMAT(i), KOIMAT(j), KOFMAT(m), OFMAT(r)) { | ||
1686 | REMAP_IMP | ||
1687 | } | ||
1688 | |||
1689 | int remapI(KOIMAT(i), KOIMAT(j), KOIMAT(m), OIMAT(r)) { | ||
1690 | REMAP_IMP | ||
1691 | } | ||
1692 | |||
1693 | int remapC(KOIMAT(i), KOIMAT(j), KOCMAT(m), OCMAT(r)) { | ||
1694 | REMAP_IMP | ||
1695 | } | ||
1696 | |||
1697 | int remapQ(KOIMAT(i), KOIMAT(j), KOQMAT(m), OQMAT(r)) { | ||
1698 | REMAP_IMP | ||
1699 | } | ||
1700 | |||
diff --git a/packages/base/src/C/lapack-aux.h b/packages/base/src/C/lapack-aux.h index b49c7c9..6ffbef1 100644 --- a/packages/base/src/C/lapack-aux.h +++ b/packages/base/src/C/lapack-aux.h | |||
@@ -42,6 +42,7 @@ typedef short ftnlen; | |||
42 | #define QVEC(A) int A##n, complex*A##p | 42 | #define QVEC(A) int A##n, complex*A##p |
43 | #define CVEC(A) int A##n, doublecomplex*A##p | 43 | #define CVEC(A) int A##n, doublecomplex*A##p |
44 | #define PVEC(A) int A##n, void* A##p, int A##s | 44 | #define PVEC(A) int A##n, void* A##p, int A##s |
45 | |||
45 | #define IMAT(A) int A##r, int A##c, int* A##p | 46 | #define IMAT(A) int A##r, int A##c, int* A##p |
46 | #define FMAT(A) int A##r, int A##c, float* A##p | 47 | #define FMAT(A) int A##r, int A##c, float* A##p |
47 | #define DMAT(A) int A##r, int A##c, double* A##p | 48 | #define DMAT(A) int A##r, int A##c, double* A##p |
@@ -49,12 +50,20 @@ typedef short ftnlen; | |||
49 | #define CMAT(A) int A##r, int A##c, doublecomplex* A##p | 50 | #define CMAT(A) int A##r, int A##c, doublecomplex* A##p |
50 | #define PMAT(A) int A##r, int A##c, void* A##p, int A##s | 51 | #define PMAT(A) int A##r, int A##c, void* A##p, int A##s |
51 | 52 | ||
53 | #define OIMAT(A) int A##r, int A##c, int A##Xr, int A##Xc, int* A##p | ||
54 | #define OFMAT(A) int A##r, int A##c, int A##Xr, int A##Xc, float* A##p | ||
55 | #define ODMAT(A) int A##r, int A##c, int A##Xr, int A##Xc, double* A##p | ||
56 | #define OQMAT(A) int A##r, int A##c, int A##Xr, int A##Xc, complex* A##p | ||
57 | #define OCMAT(A) int A##r, int A##c, int A##Xr, int A##Xc, doublecomplex* A##p | ||
58 | |||
59 | |||
52 | #define KIVEC(A) int A##n, const int*A##p | 60 | #define KIVEC(A) int A##n, const int*A##p |
53 | #define KFVEC(A) int A##n, const float*A##p | 61 | #define KFVEC(A) int A##n, const float*A##p |
54 | #define KDVEC(A) int A##n, const double*A##p | 62 | #define KDVEC(A) int A##n, const double*A##p |
55 | #define KQVEC(A) int A##n, const complex*A##p | 63 | #define KQVEC(A) int A##n, const complex*A##p |
56 | #define KCVEC(A) int A##n, const doublecomplex*A##p | 64 | #define KCVEC(A) int A##n, const doublecomplex*A##p |
57 | #define KPVEC(A) int A##n, const void* A##p, int A##s | 65 | #define KPVEC(A) int A##n, const void* A##p, int A##s |
66 | |||
58 | #define KIMAT(A) int A##r, int A##c, const int* A##p | 67 | #define KIMAT(A) int A##r, int A##c, const int* A##p |
59 | #define KFMAT(A) int A##r, int A##c, const float* A##p | 68 | #define KFMAT(A) int A##r, int A##c, const float* A##p |
60 | #define KDMAT(A) int A##r, int A##c, const double* A##p | 69 | #define KDMAT(A) int A##r, int A##c, const double* A##p |
@@ -62,3 +71,12 @@ typedef short ftnlen; | |||
62 | #define KCMAT(A) int A##r, int A##c, const doublecomplex* A##p | 71 | #define KCMAT(A) int A##r, int A##c, const doublecomplex* A##p |
63 | #define KPMAT(A) int A##r, int A##c, const void* A##p, int A##s | 72 | #define KPMAT(A) int A##r, int A##c, const void* A##p, int A##s |
64 | 73 | ||
74 | #define KOIMAT(A) int A##r, int A##c, int A##Xr, int A##Xc, const int* A##p | ||
75 | #define KOFMAT(A) int A##r, int A##c, int A##Xr, int A##Xc, const float* A##p | ||
76 | #define KODMAT(A) int A##r, int A##c, int A##Xr, int A##Xc, const double* A##p | ||
77 | #define KOQMAT(A) int A##r, int A##c, int A##Xr, int A##Xc, const complex* A##p | ||
78 | #define KOCMAT(A) int A##r, int A##c, int A##Xr, int A##Xc, const doublecomplex* A##p | ||
79 | |||
80 | #define AT(m,i,j) (m##p[(i)*m##Xr + (j)*m##Xc]) | ||
81 | #define TRAV(m,i,j) int i,j; for (i=0;i<m##r;i++) for (j=0;j<m##c;j++) | ||
82 | |||