summaryrefslogtreecommitdiff
path: root/SRC
diff options
context:
space:
mode:
authorJulien Langou <julien.langou@ucdenver.edu>2017-03-23 15:40:14 -0400
committerJulien Langou <julien.langou@ucdenver.edu>2017-03-23 15:40:14 -0400
commit42fe66c8488b5d7a9117e9ca72d0a563f765cd08 (patch)
tree86db04570a95b2d5e20e3629d96d4f0c12606911 /SRC
parent6a229fb1ef741e429b921d303545c1e6526eccd4 (diff)
downloadlapack-42fe66c8488b5d7a9117e9ca72d0a563f765cd08.tar.gz
lapack-42fe66c8488b5d7a9117e9ca72d0a563f765cd08.tar.bz2
lapack-42fe66c8488b5d7a9117e9ca72d0a563f765cd08.zip
Fix #135
Thanks Cezary Dendek!
Diffstat (limited to 'SRC')
-rw-r--r--SRC/dbdsqr.f29
-rw-r--r--SRC/sbdsqr.f28
2 files changed, 45 insertions, 12 deletions
diff --git a/SRC/dbdsqr.f b/SRC/dbdsqr.f
index b9894d89..0e46e71c 100644
--- a/SRC/dbdsqr.f
+++ b/SRC/dbdsqr.f
@@ -212,6 +212,17 @@
*> algorithm through its inner loop. The algorithms stops
*> (and so fails to converge) if the number of passes
*> through the inner loop exceeds MAXITR*N**2.
+*>
+*> \endverbatim
+*
+*> \par Note:
+* ===========
+*>
+*> \verbatim
+*> Bug report from Cezary Dendek.
+*> On March 23rd 2017, the INTEGER variable MAXIT = MAXITR*N**2 is
+*> removed since it can overflow pretty easily (for N larger or equal
+*> than 18,919). We instead use MAXITDIVN = MAXITR*N.
*> \endverbatim
*
* Authors:
@@ -266,8 +277,8 @@
* ..
* .. Local Scalars ..
LOGICAL LOWER, ROTATE
- INTEGER I, IDIR, ISUB, ITER, J, LL, LLL, M, MAXIT, NM1,
- $ NM12, NM13, OLDLL, OLDM
+ INTEGER I, IDIR, ISUB, ITER, ITERDIVN, J, LL, LLL, M,
+ $ MAXITDIVN, NM1, NM12, NM13, OLDLL, OLDM
DOUBLE PRECISION ABSE, ABSS, COSL, COSR, CS, EPS, F, G, H, MU,
$ OLDCS, OLDSN, R, SHIFT, SIGMN, SIGMX, SINL,
$ SINR, SLL, SMAX, SMIN, SMINL, SMINOA,
@@ -412,8 +423,9 @@
* (MAXIT is the maximum number of passes through the inner
* loop permitted before nonconvergence signalled.)
*
- MAXIT = MAXITR*N*N
- ITER = 0
+ MAXITDIVN = MAXITR*N
+ ITERDIVN = 0
+ ITER = -1
OLDLL = -1
OLDM = -1
*
@@ -429,8 +441,13 @@
*
IF( M.LE.1 )
$ GO TO 160
- IF( ITER.GT.MAXIT )
- $ GO TO 200
+*
+ IF( ITER.GE.N ) THEN
+ ITER = ITER - N
+ ITERDIVN = ITERDIVN + 1
+ IF( ITERDIVN.GE.MAXITDIVN )
+ $ GO TO 200
+ END IF
*
* Find diagonal block of matrix to work on
*
diff --git a/SRC/sbdsqr.f b/SRC/sbdsqr.f
index 7dc3dd7c..14560108 100644
--- a/SRC/sbdsqr.f
+++ b/SRC/sbdsqr.f
@@ -214,6 +214,16 @@
*> through the inner loop exceeds MAXITR*N**2.
*> \endverbatim
*
+*> \par Note:
+* ===========
+*>
+*> \verbatim
+*> Bug report from Cezary Dendek.
+*> On March 23rd 2017, the INTEGER variable MAXIT = MAXITR*N**2 is
+*> removed since it can overflow pretty easily (for N larger or equal
+*> than 18,919). We instead use MAXITDIVN = MAXITR*N.
+*> \endverbatim
+*
* Authors:
* ========
*
@@ -266,8 +276,8 @@
* ..
* .. Local Scalars ..
LOGICAL LOWER, ROTATE
- INTEGER I, IDIR, ISUB, ITER, J, LL, LLL, M, MAXIT, NM1,
- $ NM12, NM13, OLDLL, OLDM
+ INTEGER I, IDIR, ISUB, ITER, ITERDIVN, J, LL, LLL, M,
+ $ MAXITDIVN, NM1, NM12, NM13, OLDLL, OLDM
REAL ABSE, ABSS, COSL, COSR, CS, EPS, F, G, H, MU,
$ OLDCS, OLDSN, R, SHIFT, SIGMN, SIGMX, SINL,
$ SINR, SLL, SMAX, SMIN, SMINL, SMINOA,
@@ -412,8 +422,9 @@
* (MAXIT is the maximum number of passes through the inner
* loop permitted before nonconvergence signalled.)
*
- MAXIT = MAXITR*N*N
- ITER = 0
+ MAXITDIVN = MAXITR*N
+ ITERDIVN = 0
+ ITER = -1
OLDLL = -1
OLDM = -1
*
@@ -429,8 +440,13 @@
*
IF( M.LE.1 )
$ GO TO 160
- IF( ITER.GT.MAXIT )
- $ GO TO 200
+*
+ IF( ITER.GE.N ) THEN
+ ITER = ITER - N
+ ITERDIVN = ITERDIVN + 1
+ IF( ITERDIVN.GE.MAXITDIVN )
+ $ GO TO 200
+ END IF
*
* Find diagonal block of matrix to work on
*