summaryrefslogtreecommitdiff
path: root/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.c')
-rw-r--r--lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.c b/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.c
index 842b5ad..e85c1b7 100644
--- a/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.c
+++ b/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.c
@@ -860,3 +860,44 @@ int luS_l_C(KCMAT(a), KDVEC(ipiv), KCMAT(b), CMAT(x)) {
860 free(auxipiv); 860 free(auxipiv);
861 OK 861 OK
862} 862}
863
864//////////////////// Matrix Product /////////////////////////
865
866void dgemm_(char *, char *, integer *, integer *, integer *,
867 double *, const double *, integer *, const double *,
868 integer *, double *, double *, integer *);
869
870int multiplyR(int ta, int tb, KDMAT(a),KDMAT(b),DMAT(r)) {
871 //REQUIRES(ac==br && ar==rr && bc==rc,BAD_SIZE);
872 integer m = ta?ac:ar;
873 integer n = tb?br:bc;
874 integer k = ta?ar:ac;
875 integer lda = ar;
876 integer ldb = br;
877 integer ldc = rr;
878 double alpha = 1;
879 double beta = 0;
880 dgemm_(ta?"T":"N",tb?"T":"N",&m,&n,&k,&alpha,ap,&lda,bp,&ldb,&beta,rp,&ldc);
881 OK
882}
883
884void zgemm_(char *, char *, integer *, integer *, integer *,
885 doublecomplex *, const doublecomplex *, integer *, const doublecomplex *,
886 integer *, doublecomplex *, doublecomplex *, integer *);
887
888int multiplyC(int ta, int tb, KCMAT(a),KCMAT(b),CMAT(r)) {
889 //REQUIRES(ac==br && ar==rr && bc==rc,BAD_SIZE);
890 integer m = ta?ac:ar;
891 integer n = tb?br:bc;
892 integer k = ta?ar:ac;
893 integer lda = ar;
894 integer ldb = br;
895 integer ldc = rr;
896 doublecomplex alpha = {1,0};
897 doublecomplex beta = {0,0};
898 zgemm_(ta?"T":"N",tb?"T":"N",&m,&n,&k,&alpha,
899 (doublecomplex*)ap,&lda,
900 (doublecomplex*)bp,&ldb,&beta,
901 (doublecomplex*)rp,&ldc);
902 OK
903}