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.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.c b/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.c
index 9b6c1db..04ef416 100644
--- a/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.c
+++ b/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.c
@@ -663,3 +663,41 @@ int qr_l_C(KCMAT(a), CVEC(tau), CMAT(r)) {
663 free(WORK); 663 free(WORK);
664 OK 664 OK
665} 665}
666
667//////////////////// Hessenberg factorization /////////////////////////
668
669int hess_l_R(KDMAT(a), DVEC(tau), DMAT(r)) {
670 integer m = ar;
671 integer n = ac;
672 integer mn = MIN(m,n);
673 REQUIRES(m>=1 && n == m && rr== m && rc == n && taun == mn-1, BAD_SIZE);
674 DEBUGMSG("hess_l_R");
675 integer lwork = 5*n; // fixme
676 double *WORK = (double*)malloc(lwork*sizeof(double));
677 CHECK(!WORK,MEM);
678 memcpy(rp,ap,m*n*sizeof(double));
679 integer res;
680 integer one = 1;
681 dgehrd_ (&n,&one,&n,rp,&n,taup,WORK,&lwork,&res);
682 CHECK(res,res);
683 free(WORK);
684 OK
685}
686
687int hess_l_C(KCMAT(a), CVEC(tau), CMAT(r)) {
688 integer m = ar;
689 integer n = ac;
690 integer mn = MIN(m,n);
691 REQUIRES(m>=1 && n == m && rr== m && rc == n && taun == mn-1, BAD_SIZE);
692 DEBUGMSG("hess_l_C");
693 integer lwork = 5*n; // fixme
694 doublecomplex *WORK = (doublecomplex*)malloc(lwork*sizeof(doublecomplex));
695 CHECK(!WORK,MEM);
696 memcpy(rp,ap,m*n*sizeof(doublecomplex));
697 integer res;
698 integer one = 1;
699 zgehrd_ (&n,&one,&n,(doublecomplex*)rp,&n,(doublecomplex*)taup,WORK,&lwork,&res);
700 CHECK(res,res);
701 free(WORK);
702 OK
703}