summaryrefslogtreecommitdiff
path: root/lib/Numeric/LinearAlgebra
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2009-04-17 11:55:32 +0000
committerAlberto Ruiz <aruiz@um.es>2009-04-17 11:55:32 +0000
commit33a8f087574c89d257fccefd58643bd9b8fa9f22 (patch)
treef017b6834367fd1bd29d58801d10a2eebf383be3 /lib/Numeric/LinearAlgebra
parent71ed02d2728701130cf82e61a8633af0f6375812 (diff)
restored C trans and constant for comparison
Diffstat (limited to 'lib/Numeric/LinearAlgebra')
-rw-r--r--lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.c48
-rw-r--r--lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.h6
2 files changed, 54 insertions, 0 deletions
diff --git a/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.c b/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.c
index a8ccf5f..d7248d1 100644
--- a/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.c
+++ b/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.c
@@ -908,3 +908,51 @@ int multiplyC(int ta, int tb, KCMAT(a),KCMAT(b),CMAT(r)) {
908 (doublecomplex*)rp,&ldc); 908 (doublecomplex*)rp,&ldc);
909 OK 909 OK
910} 910}
911
912//////////////////// transpose /////////////////////////
913
914int transR(KDMAT(x),DMAT(t)) {
915 REQUIRES(xr==tc && xc==tr,BAD_SIZE);
916 DEBUGMSG("transR");
917 int i,j;
918 for (i=0; i<tr; i++) {
919 for (j=0; j<tc; j++) {
920 tp[i*tc+j] = xp[j*xc+i];
921 }
922 }
923 OK
924}
925
926int transC(KCMAT(x),CMAT(t)) {
927 REQUIRES(xr==tc && xc==tr,BAD_SIZE);
928 DEBUGMSG("transC");
929 int i,j;
930 for (i=0; i<tr; i++) {
931 for (j=0; j<tc; j++) {
932 ((doublecomplex*)tp)[i*tc+j] = ((doublecomplex*)xp)[j*xc+i];
933 }
934 }
935 OK
936}
937
938//////////////////// constant /////////////////////////
939
940int constantR(double * pval, DVEC(r)) {
941 DEBUGMSG("constantR")
942 int k;
943 double val = *pval;
944 for(k=0;k<rn;k++) {
945 rp[k]=val;
946 }
947 OK
948}
949
950int constantC(doublecomplex* pval, CVEC(r)) {
951 DEBUGMSG("constantC")
952 int k;
953 doublecomplex val = *pval;
954 for(k=0;k<rn;k++) {
955 ((doublecomplex*)rp)[k]=val;
956 }
957 OK
958}
diff --git a/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.h b/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.h
index 3f58243..dc7a98f 100644
--- a/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.h
+++ b/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.h
@@ -55,6 +55,12 @@ typedef short ftnlen;
55int multiplyR(int ta, int tb, KDMAT(a),KDMAT(b),DMAT(r)); 55int multiplyR(int ta, int tb, KDMAT(a),KDMAT(b),DMAT(r));
56int multiplyC(int ta, int tb, KCMAT(a),KCMAT(b),CMAT(r)); 56int multiplyC(int ta, int tb, KCMAT(a),KCMAT(b),CMAT(r));
57 57
58int transR(KDMAT(x),DMAT(t));
59int transC(KCMAT(x),CMAT(t));
60
61int constantR(double * pval, DVEC(r));
62int constantC(doublecomplex* pval, CVEC(r));
63
58int svd_l_R(KDMAT(x),DMAT(u),DVEC(s),DMAT(v)); 64int svd_l_R(KDMAT(x),DMAT(u),DVEC(s),DMAT(v));
59int svd_l_Rdd(KDMAT(x),DMAT(u),DVEC(s),DMAT(v)); 65int svd_l_Rdd(KDMAT(x),DMAT(u),DVEC(s),DMAT(v));
60int svd_l_C(KCMAT(a),CMAT(u),DVEC(s),CMAT(v)); 66int svd_l_C(KCMAT(a),CMAT(u),DVEC(s),CMAT(v));