diff options
author | Julien Langou <julien.langou@ucdenver.edu> | 2016-11-25 13:46:11 +0100 |
---|---|---|
committer | Julien Langou <julien.langou@ucdenver.edu> | 2016-11-25 13:46:11 +0100 |
commit | 6661906c90105eec543cce45d484255f68e23d8e (patch) | |
tree | 32db37e6dcaf0b716a5e91237e31b915653d401e | |
parent | 0d36145952f8e077b6bd056114b6be003152e693 (diff) |
Bug reported by Peng HongBo, Joan McComb, and Yi LB Peng from IBM.
When M=0 or N=0, [C/Z]GESDD would not return the value 1 in WORK(1).
Fixing this by following [S/D]GESDD code.
-rw-r--r-- | SRC/cgesdd.f | 8 | ||||
-rw-r--r-- | SRC/zgesdd.f | 8 |
2 files changed, 10 insertions, 6 deletions
diff --git a/SRC/cgesdd.f b/SRC/cgesdd.f index d10f5281..719cac5f 100644 --- a/SRC/cgesdd.f +++ b/SRC/cgesdd.f @@ -330,8 +330,10 @@ * real workspace. NB refers to the optimal block size for the * immediately following subroutine, as returned by ILAENV.) * - IF( INFO.EQ.0 .AND. M.GT.0 .AND. N.GT.0 ) THEN - IF( M.GE.N ) THEN + IF( INFO.EQ.0 ) THEN + MINWRK = 1 + MAXWRK = 1 + IF( M.GE.N .AND. MINMN.GT.0 ) THEN * * There is no complex work space needed for bidiagonal SVD * The real work space needed for bidiagonal SVD (sbdsdc) is @@ -472,7 +474,7 @@ MAXWRK = MAX( MAXWRK, 2*N + LWORK_CUNMBR_PRC_NN ) END IF END IF - ELSE + ELSE IF( MINMN.GT.0 ) THEN * * There is no complex work space needed for bidiagonal SVD * The real work space needed for bidiagonal SVD (sbdsdc) is diff --git a/SRC/zgesdd.f b/SRC/zgesdd.f index 4a59d8aa..77bdb121 100644 --- a/SRC/zgesdd.f +++ b/SRC/zgesdd.f @@ -330,8 +330,10 @@ * real workspace. NB refers to the optimal block size for the * immediately following subroutine, as returned by ILAENV.) * - IF( INFO.EQ.0 .AND. M.GT.0 .AND. N.GT.0 ) THEN - IF( M.GE.N ) THEN + IF( INFO.EQ.0 ) THEN + MINWRK = 1 + MAXWRK = 1 + IF( M.GE.N .AND. MINMN.GT.0 ) THEN * * There is no complex work space needed for bidiagonal SVD * The real work space needed for bidiagonal SVD (dbdsdc) is @@ -472,7 +474,7 @@ MAXWRK = MAX( MAXWRK, 2*N + LWORK_ZUNMBR_PRC_NN ) END IF END IF - ELSE + ELSE IF( MINMN.GT.0 ) THEN * * There is no complex work space needed for bidiagonal SVD * The real work space needed for bidiagonal SVD (dbdsdc) is |