@@ -226,8 +226,6 @@ typedef struct Namelist Namelist;
226226*/
227227
228228
229-
230-
231229/* Table of constant values */
232230
233231static integer c__1 = 1 ;
@@ -241,7 +239,6 @@ static integer c__0 = 0;
241239/* Online html documentation available at */
242240/* http://www.netlib.org/lapack/explore-html/ */
243241
244- /* > \htmlonly */
245242/* > Download DLASQ1 + dependencies */
246243/* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dlasq1.
247244f"> */
@@ -252,7 +249,6 @@ f"> */
252249/* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dlasq1.
253250f"> */
254251/* > [TXT]</a> */
255- /* > \endhtmlonly */
256252
257253/* Definition: */
258254/* =========== */
@@ -318,7 +314,8 @@ f"> */
318314/* > = 0: successful exit */
319315/* > < 0: if INFO = -i, the i-th argument had an illegal value */
320316/* > > 0: the algorithm failed */
321- /* > = 1, a split was marked by a positive value in E */
317+ /* > = 1, a split was marked by a positive value in E, or */
318+ /* > the input contains a NaN */
322319/* > = 2, current block of Z not diagonalized after 100*N */
323320/* > iterations (in inner while loop) On exit D and E */
324321/* > represent a matrix with the same singular values */
@@ -336,9 +333,7 @@ f"> */
336333/* > \author Univ. of Colorado Denver */
337334/* > \author NAG Ltd. */
338335
339- /* > \date December 2016 */
340-
341- /* > \ingroup auxOTHERcomputational */
336+ /* > \ingroup lasq1 */
342337
343338/* ===================================================================== */
344339/* Subroutine */ void dlasq1_ (integer * n , doublereal * d__ , doublereal * e ,
@@ -349,9 +344,10 @@ f"> */
349344 doublereal d__1 , d__2 , d__3 ;
350345
351346 /* Local variables */
347+ integer i__ ;
348+ doublereal eps ;
352349 extern /* Subroutine */ void dlas2_ (doublereal * , doublereal * , doublereal
353350 * , doublereal * , doublereal * );
354- integer i__ ;
355351 doublereal scale ;
356352 integer iinfo ;
357353 doublereal sigmn ;
@@ -363,17 +359,15 @@ f"> */
363359 extern /* Subroutine */ void dlascl_ (char * , integer * , integer * ,
364360 doublereal * , doublereal * , integer * , integer * , doublereal * ,
365361 integer * , integer * );
362+ extern logical disnan_ (doublereal * );
366363 doublereal safmin ;
367- extern /* Subroutine */ void xerbla_ (char * , integer * , ftnlen );
368- extern void dlasrt_ (
364+ extern /* Subroutine */ void xerbla_ (char * , integer * , ftnlen ), dlasrt_ (
369365 char * , integer * , doublereal * , integer * );
370- doublereal eps ;
371366
372367
373- /* -- LAPACK computational routine (version 3.7.0) -- */
368+ /* -- LAPACK computational routine -- */
374369/* -- LAPACK is a software package provided by Univ. of Tennessee, -- */
375370/* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- */
376- /* December 2016 */
377371
378372
379373/* ===================================================================== */
@@ -431,6 +425,14 @@ f"> */
431425/* L20: */
432426 }
433427
428+ /* A NaN in D or E can make SIGMX a NaN, which DLASCL would reject */
429+ /* by stopping in XERBLA; report it through INFO instead. */
430+
431+ if (disnan_ (& sigmx )) {
432+ * info = 1 ;
433+ return ;
434+ }
435+
434436/* Copy D and E into WORK (in the Z format) and scale (squaring the */
435437/* input data makes scaling by a power of the radix pointless). */
436438
0 commit comments