aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreugene.chereshnev <eugenechereshnev@gmail.com>2016-12-14 11:43:10 -0800
committereugene.chereshnev <eugenechereshnev@gmail.com>2016-12-14 11:43:10 -0800
commit6128cc649f6e17d9166a4123b7c255501baddd0f (patch)
treebe591069e7e3db0f7989ccc3b6989a7443149f03
parentfd746a6013490e2154dc0c2eeb14357c94fa97f8 (diff)
Fix ?LAMTSQR
-rw-r--r--SRC/clamtsqr.f27
-rw-r--r--SRC/dlamtsqr.f15
-rw-r--r--SRC/slamtsqr.f18
-rw-r--r--SRC/zlamtsqr.f18
4 files changed, 57 insertions, 21 deletions
diff --git a/SRC/clamtsqr.f b/SRC/clamtsqr.f
index 387e1fe1..aa2740f0 100644
--- a/SRC/clamtsqr.f
+++ b/SRC/clamtsqr.f
@@ -33,14 +33,19 @@
* ==========
*
*> \param[in] SIDE
+*> \verbatim
*> SIDE is CHARACTER*1
*> = 'L': apply Q or Q**T from the Left;
*> = 'R': apply Q or Q**T from the Right.
+*> \endverbatim
*>
*> \param[in] TRANS
+*> \verbatim
*> TRANS is CHARACTER*1
*> = 'N': No transpose, apply Q;
*> = 'C': Conjugate Transpose, apply Q**C.
+*> \endverbatim
+*>
*> \param[in] M
*> \verbatim
*> M is INTEGER
@@ -109,12 +114,17 @@
*> \endverbatim
*>
*> \param[in,out] C
+*> \verbatim
*> C is COMPLEX array, dimension (LDC,N)
*> On entry, the M-by-N matrix C.
*> On exit, C is overwritten by Q*C or Q**T*C or C*Q**T or C*Q.
+*> \endverbatim
+*>
*> \param[in] LDC
+*> \verbatim
*> LDC is INTEGER
*> The leading dimension of the array C. LDC >= max(1,M).
+*> \endverbatim
*>
*> \param[out] WORK
*> \verbatim
@@ -247,14 +257,13 @@
ELSE IF(( LWORK.LT.MAX(1,LW)).AND.(.NOT.LQUERY)) THEN
INFO = -15
END IF
- IF( INFO.EQ.0) THEN
*
* Determine the block size if it is tall skinny or short and wide
*
IF( INFO.EQ.0) THEN
WORK(1) = LW
END IF
- END IF
+*
IF( INFO.NE.0 ) THEN
CALL XERBLA( 'CLAMTSQR', -INFO )
RETURN
@@ -354,10 +363,10 @@
*
* Multiply Q to the current block of C (1:M,I:I+MB)
*
- CTR = CTR - 1
- CALL CTPMQRT('R','C',M , MB-K, K, 0,NB, A(I,1), LDA,
- $ T(1,CTR*K+1), LDT, C(1,1), LDC,
- $ C(1,I), LDC, WORK, INFO )
+ CTR = CTR - 1
+ CALL CTPMQRT('R','C',M , MB-K, K, 0,NB, A(I,1), LDA,
+ $ T(1,CTR*K+1), LDT, C(1,1), LDC,
+ $ C(1,I), LDC, WORK, INFO )
END DO
*
* Multiply Q to the first block of C (1:M,1:MB)
@@ -397,11 +406,7 @@
*
END IF
*
- IF(LEFT) THEN
- WORK(1)= N * NB
- ELSE IF(RIGHT) THEN
- WORK(1)= MB * NB
- END IF
+ WORK(1) = LW
RETURN
*
* End of CLAMTSQR
diff --git a/SRC/dlamtsqr.f b/SRC/dlamtsqr.f
index a4f5a025..59d4ae55 100644
--- a/SRC/dlamtsqr.f
+++ b/SRC/dlamtsqr.f
@@ -33,14 +33,19 @@
* ==========
*
*> \param[in] SIDE
+*> \verbatim
*> SIDE is CHARACTER*1
*> = 'L': apply Q or Q**T from the Left;
*> = 'R': apply Q or Q**T from the Right.
+*> \endverbatim
*>
*> \param[in] TRANS
+*> \verbatim
*> TRANS is CHARACTER*1
*> = 'N': No transpose, apply Q;
*> = 'T': Transpose, apply Q**T.
+*> \endverbatim
+*>
*> \param[in] M
*> \verbatim
*> M is INTEGER
@@ -109,12 +114,17 @@
*> \endverbatim
*>
*> \param[in,out] C
+*> \verbatim
*> C is DOUBLE PRECISION array, dimension (LDC,N)
*> On entry, the M-by-N matrix C.
*> On exit, C is overwritten by Q*C or Q**T*C or C*Q**T or C*Q.
+*> \endverbatim
+*>
*> \param[in] LDC
+*> \verbatim
*> LDC is INTEGER
*> The leading dimension of the array C. LDC >= max(1,M).
+*> \endverbatim
*>
*> \param[out] WORK
*> \verbatim
@@ -253,6 +263,7 @@
IF( INFO.EQ.0) THEN
WORK(1) = LW
END IF
+*
IF( INFO.NE.0 ) THEN
CALL XERBLA( 'DLAMTSQR', -INFO )
RETURN
@@ -352,8 +363,8 @@
*
* Multiply Q to the current block of C (1:M,I:I+MB)
*
- CTR = CTR - 1
- CALL DTPMQRT('R','T',M , MB-K, K, 0,NB, A(I,1), LDA,
+ CTR = CTR - 1
+ CALL DTPMQRT('R','T',M , MB-K, K, 0,NB, A(I,1), LDA,
$ T(1,CTR*K+1), LDT, C(1,1), LDC,
$ C(1,I), LDC, WORK, INFO )
*
diff --git a/SRC/slamtsqr.f b/SRC/slamtsqr.f
index 69d6c327..f3e176db 100644
--- a/SRC/slamtsqr.f
+++ b/SRC/slamtsqr.f
@@ -33,14 +33,19 @@
* ==========
*
*> \param[in] SIDE
+*> \verbatim
*> SIDE is CHARACTER*1
*> = 'L': apply Q or Q**T from the Left;
*> = 'R': apply Q or Q**T from the Right.
+*> \endverbatim
*>
*> \param[in] TRANS
+*> \verbatim
*> TRANS is CHARACTER*1
*> = 'N': No transpose, apply Q;
*> = 'T': Transpose, apply Q**T.
+*> \endverbatim
+*>
*> \param[in] M
*> \verbatim
*> M is INTEGER
@@ -109,12 +114,17 @@
*> \endverbatim
*>
*> \param[in,out] C
+*> \verbatim
*> C is REAL array, dimension (LDC,N)
*> On entry, the M-by-N matrix C.
*> On exit, C is overwritten by Q*C or Q**T*C or C*Q**T or C*Q.
+*> \endverbatim
+*>
*> \param[in] LDC
+*> \verbatim
*> LDC is INTEGER
*> The leading dimension of the array C. LDC >= max(1,M).
+*> \endverbatim
*>
*> \param[out] WORK
*> \verbatim
@@ -247,14 +257,13 @@
ELSE IF(( LWORK.LT.MAX(1,LW)).AND.(.NOT.LQUERY)) THEN
INFO = -15
END IF
- IF( INFO.EQ.0) THEN
*
* Determine the block size if it is tall skinny or short and wide
*
IF( INFO.EQ.0) THEN
WORK(1) = LW
END IF
- END IF
+*
IF( INFO.NE.0 ) THEN
CALL XERBLA( 'SLAMTSQR', -INFO )
RETURN
@@ -354,10 +363,11 @@
*
* Multiply Q to the current block of C (1:M,I:I+MB)
*
- CTR = CTR - 1
- CALL STPMQRT('R','T',M , MB-K, K, 0,NB, A(I,1), LDA,
+ CTR = CTR - 1
+ CALL STPMQRT('R','T',M , MB-K, K, 0,NB, A(I,1), LDA,
$ T(1, CTR * K + 1), LDT, C(1,1), LDC,
$ C(1,I), LDC, WORK, INFO )
+*
END DO
*
* Multiply Q to the first block of C (1:M,1:MB)
diff --git a/SRC/zlamtsqr.f b/SRC/zlamtsqr.f
index 7195f9e1..103049c2 100644
--- a/SRC/zlamtsqr.f
+++ b/SRC/zlamtsqr.f
@@ -33,14 +33,19 @@
* ==========
*
*> \param[in] SIDE
+*> \verbatim
*> SIDE is CHARACTER*1
*> = 'L': apply Q or Q**T from the Left;
*> = 'R': apply Q or Q**T from the Right.
+*> \endverbatim
*>
*> \param[in] TRANS
+*> \verbatim
*> TRANS is CHARACTER*1
*> = 'N': No transpose, apply Q;
*> = 'C': Conjugate Transpose, apply Q**C.
+*> \endverbatim
+*>
*> \param[in] M
*> \verbatim
*> M is INTEGER
@@ -109,12 +114,17 @@
*> \endverbatim
*>
*> \param[in,out] C
+*> \verbatim
*> C is COMPLEX*16 array, dimension (LDC,N)
*> On entry, the M-by-N matrix C.
*> On exit, C is overwritten by Q*C or Q**T*C or C*Q**T or C*Q.
+*> \endverbatim
+*>
*> \param[in] LDC
+*> \verbatim
*> LDC is INTEGER
*> The leading dimension of the array C. LDC >= max(1,M).
+*> \endverbatim
*>
*> \param[out] WORK
*> \verbatim
@@ -310,9 +320,9 @@
*
KK = MOD((M-K),(MB-K))
II=M-KK+1
+ CTR = 1
CALL ZGEMQRT('L','C',MB , N, K, NB, A(1,1), LDA, T
$ ,LDT ,C(1,1), LDC, WORK, INFO )
- CTR = 1
*
DO I=MB+1,II-MB+K,(MB-K)
*
@@ -350,11 +360,11 @@
END IF
*
DO I=II-(MB-K),MB+1,-(MB-K)
- CTR = CTR - 1
*
* Multiply Q to the current block of C (1:M,I:I+MB)
*
- CALL ZTPMQRT('R','C',M , MB-K, K, 0,NB, A(I,1), LDA,
+ CTR = CTR - 1
+ CALL ZTPMQRT('R','C',M , MB-K, K, 0,NB, A(I,1), LDA,
$ T(1, CTR * K + 1), LDT, C(1,1), LDC,
$ C(1,I), LDC, WORK, INFO )
@@ -371,9 +381,9 @@
*
KK = MOD((N-K),(MB-K))
II=N-KK+1
+ CTR = 1
CALL ZGEMQRT('R','N', M, MB , K, NB, A(1,1), LDA, T
$ ,LDT ,C(1,1), LDC, WORK, INFO )
- CTR = 1
*
DO I=MB+1,II-MB+K,(MB-K)
*