diff options
Diffstat (limited to 'lib/Numeric/LinearAlgebra/LAPACK')
-rw-r--r-- | lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.c | 22 | ||||
-rw-r--r-- | lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.h | 6 |
2 files changed, 28 insertions, 0 deletions
diff --git a/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.c b/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.c index b9c2572..7a40991 100644 --- a/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.c +++ b/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.c | |||
@@ -1063,6 +1063,18 @@ int transR(KDMAT(x),DMAT(t)) { | |||
1063 | OK | 1063 | OK |
1064 | } | 1064 | } |
1065 | 1065 | ||
1066 | int transQ(KQMAT(x),QMAT(t)) { | ||
1067 | REQUIRES(xr==tc && xc==tr,BAD_SIZE); | ||
1068 | DEBUGMSG("transQ"); | ||
1069 | int i,j; | ||
1070 | for (i=0; i<tr; i++) { | ||
1071 | for (j=0; j<tc; j++) { | ||
1072 | ((complex*)tp)[i*tc+j] = ((complex*)xp)[j*xc+i]; | ||
1073 | } | ||
1074 | } | ||
1075 | OK | ||
1076 | } | ||
1077 | |||
1066 | int transC(KCMAT(x),CMAT(t)) { | 1078 | int transC(KCMAT(x),CMAT(t)) { |
1067 | REQUIRES(xr==tc && xc==tr,BAD_SIZE); | 1079 | REQUIRES(xr==tc && xc==tr,BAD_SIZE); |
1068 | DEBUGMSG("transC"); | 1080 | DEBUGMSG("transC"); |
@@ -1097,6 +1109,16 @@ int constantR(double * pval, DVEC(r)) { | |||
1097 | OK | 1109 | OK |
1098 | } | 1110 | } |
1099 | 1111 | ||
1112 | int constantQ(complex* pval, QVEC(r)) { | ||
1113 | DEBUGMSG("constantQ") | ||
1114 | int k; | ||
1115 | complex val = *pval; | ||
1116 | for(k=0;k<rn;k++) { | ||
1117 | ((complex*)rp)[k]=val; | ||
1118 | } | ||
1119 | OK | ||
1120 | } | ||
1121 | |||
1100 | int constantC(doublecomplex* pval, CVEC(r)) { | 1122 | int constantC(doublecomplex* pval, CVEC(r)) { |
1101 | DEBUGMSG("constantC") | 1123 | DEBUGMSG("constantC") |
1102 | int k; | 1124 | int k; |
diff --git a/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.h b/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.h index 415a6ab..d01d9e5 100644 --- a/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.h +++ b/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.h | |||
@@ -42,16 +42,20 @@ typedef short ftnlen; | |||
42 | 42 | ||
43 | #define FVEC(A) int A##n, float*A##p | 43 | #define FVEC(A) int A##n, float*A##p |
44 | #define DVEC(A) int A##n, double*A##p | 44 | #define DVEC(A) int A##n, double*A##p |
45 | #define QVEC(A) int A##n, float*A##p | ||
45 | #define CVEC(A) int A##n, double*A##p | 46 | #define CVEC(A) int A##n, double*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 | #define QMAT(A) int A##r, int A##c, float* A##p | ||
48 | #define CMAT(A) int A##r, int A##c, double* A##p | 50 | #define CMAT(A) int A##r, int A##c, double* A##p |
49 | 51 | ||
50 | #define KFVEC(A) int A##n, const float*A##p | 52 | #define KFVEC(A) int A##n, const float*A##p |
51 | #define KDVEC(A) int A##n, const double*A##p | 53 | #define KDVEC(A) int A##n, const double*A##p |
54 | #define KQVEC(A) int A##n, const float*A##p | ||
52 | #define KCVEC(A) int A##n, const double*A##p | 55 | #define KCVEC(A) int A##n, const double*A##p |
53 | #define KFMAT(A) int A##r, int A##c, const float* A##p | 56 | #define KFMAT(A) int A##r, int A##c, const float* A##p |
54 | #define KDMAT(A) int A##r, int A##c, const double* A##p | 57 | #define KDMAT(A) int A##r, int A##c, const double* A##p |
58 | #define KQMAT(A) int A##r, int A##c, const float* A##p | ||
55 | #define KCMAT(A) int A##r, int A##c, const double* A##p | 59 | #define KCMAT(A) int A##r, int A##c, const double* A##p |
56 | 60 | ||
57 | /********************************************************/ | 61 | /********************************************************/ |
@@ -61,10 +65,12 @@ int multiplyC(int ta, int tb, KCMAT(a),KCMAT(b),CMAT(r)); | |||
61 | 65 | ||
62 | int transF(KFMAT(x),FMAT(t)); | 66 | int transF(KFMAT(x),FMAT(t)); |
63 | int transR(KDMAT(x),DMAT(t)); | 67 | int transR(KDMAT(x),DMAT(t)); |
68 | int transQ(KQMAT(x),QMAT(t)); | ||
64 | int transC(KCMAT(x),CMAT(t)); | 69 | int transC(KCMAT(x),CMAT(t)); |
65 | 70 | ||
66 | int constantF(float * pval, FVEC(r)); | 71 | int constantF(float * pval, FVEC(r)); |
67 | int constantR(double * pval, DVEC(r)); | 72 | int constantR(double * pval, DVEC(r)); |
73 | int constantQ(complex* pval, QVEC(r)); | ||
68 | int constantC(doublecomplex* pval, CVEC(r)); | 74 | int constantC(doublecomplex* pval, CVEC(r)); |
69 | 75 | ||
70 | int svd_l_R(KDMAT(x),DMAT(u),DVEC(s),DMAT(v)); | 76 | int svd_l_R(KDMAT(x),DMAT(u),DVEC(s),DMAT(v)); |