Skip to content

Commit 4aefeb7

Browse files
authored
Merge pull request #463 from thijssteel/fix/XGGGLM-initialization
initialize x and y to zero in case N = 0 in xggglm
2 parents 5e16b11 + 920c79a commit 4aefeb7

File tree

4 files changed

+36
-8
lines changed

4 files changed

+36
-8
lines changed

SRC/cggglm.f

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,15 @@ SUBROUTINE CGGGLM( N, M, P, A, LDA, B, LDB, D, X, Y, WORK, LWORK,
271271
*
272272
* Quick return if possible
273273
*
274-
IF( N.EQ.0 )
275-
$ RETURN
274+
IF( N.EQ.0 ) THEN
275+
DO I = 1, M
276+
X(I) = CZERO
277+
END DO
278+
DO I = 1, P
279+
Y(I) = CZERO
280+
END DO
281+
RETURN
282+
END IF
276283
*
277284
* Compute the GQR factorization of matrices A and B:
278285
*

SRC/dggglm.f

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,15 @@ SUBROUTINE DGGGLM( N, M, P, A, LDA, B, LDB, D, X, Y, WORK, LWORK,
270270
*
271271
* Quick return if possible
272272
*
273-
IF( N.EQ.0 )
274-
$ RETURN
273+
IF( N.EQ.0 ) THEN
274+
DO I = 1, M
275+
X(I) = ZERO
276+
END DO
277+
DO I = 1, P
278+
Y(I) = ZERO
279+
END DO
280+
RETURN
281+
END IF
275282
*
276283
* Compute the GQR factorization of matrices A and B:
277284
*

SRC/sggglm.f

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,15 @@ SUBROUTINE SGGGLM( N, M, P, A, LDA, B, LDB, D, X, Y, WORK, LWORK,
270270
*
271271
* Quick return if possible
272272
*
273-
IF( N.EQ.0 )
274-
$ RETURN
273+
IF( N.EQ.0 ) THEN
274+
DO I = 1, M
275+
X(I) = ZERO
276+
END DO
277+
DO I = 1, P
278+
Y(I) = ZERO
279+
END DO
280+
RETURN
281+
END IF
275282
*
276283
* Compute the GQR factorization of matrices A and B:
277284
*

SRC/zggglm.f

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,15 @@ SUBROUTINE ZGGGLM( N, M, P, A, LDA, B, LDB, D, X, Y, WORK, LWORK,
271271
*
272272
* Quick return if possible
273273
*
274-
IF( N.EQ.0 )
275-
$ RETURN
274+
IF( N.EQ.0 ) THEN
275+
DO I = 1, M
276+
X(I) = CZERO
277+
END DO
278+
DO I = 1, P
279+
Y(I) = CZERO
280+
END DO
281+
RETURN
282+
END IF
276283
*
277284
* Compute the GQR factorization of matrices A and B:
278285
*

0 commit comments

Comments
 (0)