diff options
author | Vivian McPhail <haskell.vivian.mcphail@gmail.com> | 2010-09-19 10:25:39 +0000 |
---|---|---|
committer | Vivian McPhail <haskell.vivian.mcphail@gmail.com> | 2010-09-19 10:25:39 +0000 |
commit | 503f598801b67886028d9ffdfdef38813954e46f (patch) | |
tree | e114d895cf0fe757117e32589883c15c13f04b91 /lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.c | |
parent | 9593058746aaf1f5afd9ce78c1dd5d64ef7b05a6 (diff) |
C functions for Storable a => transdata, constantD
Diffstat (limited to 'lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.c')
-rw-r--r-- | lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.c b/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.c index 09979cd..e8bbbdb 100644 --- a/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.c +++ b/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.c | |||
@@ -1139,6 +1139,19 @@ int transC(KCMAT(x),CMAT(t)) { | |||
1139 | OK | 1139 | OK |
1140 | } | 1140 | } |
1141 | 1141 | ||
1142 | int transP(KPMAT(x), PMAT(t)) { | ||
1143 | REQUIRES(xr==tc && xc==tr,BAD_SIZE); | ||
1144 | REQUIRES(xs==ts,NOCONVER); | ||
1145 | DEBUGMSG("transP"); | ||
1146 | int i,j; | ||
1147 | for (i=0; i<tr; i++) { | ||
1148 | for (j=0; j<tc; j++) { | ||
1149 | memcpy(tp+(i*tc+j)*xs,xp +(j*xc+i)*xs,xs); | ||
1150 | } | ||
1151 | } | ||
1152 | OK | ||
1153 | } | ||
1154 | |||
1142 | //////////////////// constant ///////////////////////// | 1155 | //////////////////// constant ///////////////////////// |
1143 | 1156 | ||
1144 | int constantF(float * pval, FVEC(r)) { | 1157 | int constantF(float * pval, FVEC(r)) { |
@@ -1181,6 +1194,15 @@ int constantC(doublecomplex* pval, CVEC(r)) { | |||
1181 | OK | 1194 | OK |
1182 | } | 1195 | } |
1183 | 1196 | ||
1197 | int constantP(void* pval, PVEC(r)) { | ||
1198 | DEBUGMSG("constantP") | ||
1199 | int k; | ||
1200 | for(k=0;k<rn;k++) { | ||
1201 | memcpy(rp+k*rs,pval,rs); | ||
1202 | } | ||
1203 | OK | ||
1204 | } | ||
1205 | |||
1184 | //////////////////// float-double conversion ///////////////////////// | 1206 | //////////////////// float-double conversion ///////////////////////// |
1185 | 1207 | ||
1186 | int float2double(FVEC(x),DVEC(y)) { | 1208 | int float2double(FVEC(x),DVEC(y)) { |