From 894f016c2a00b263daad1bbfb9f4ae71bb348629 Mon Sep 17 00:00:00 2001 From: james Date: Tue, 18 Sep 2012 01:14:38 +0000 Subject: [PATCH] --- SRC/dlasd4.f | 39 ++++++++++++++++++++++----------------- SRC/slasd4.f | 41 +++++++++++++++++++++++------------------ TESTING/svd.in | 6 +++--- 3 files changed, 48 insertions(+), 38 deletions(-) diff --git a/SRC/dlasd4.f b/SRC/dlasd4.f index 0bd1b038..13a05ddf 100644 --- a/SRC/dlasd4.f +++ b/SRC/dlasd4.f @@ -1,4 +1,4 @@ -*> \brief \b DLASD4 computes the square root of the i-th updated eigenvalue of a positive symmetric rank-one modification to a positive diagonal matrix. Used by sbdsdc. +*> \brief \b DLASD4 computes the square root of the i-th updated eigenvalue of a positive symmetric rank-one modification to a positive diagonal matrix. Used by dbdsdc. * * =========== DOCUMENTATION =========== * @@ -305,8 +305,8 @@ * SIGMA = D( N ) + TAU DO 30 J = 1, N - DELTA( J ) = ( D( J )-D( I ) ) - TAU - WORK( J ) = D( J ) + D( I ) + TAU + DELTA( J ) = ( D( J )-D( N ) ) - TAU + WORK( J ) = D( J ) + D( N ) + TAU 30 CONTINUE * * Evaluate PSI and the derivative DPSI @@ -327,8 +327,8 @@ TEMP = Z( N ) / ( DELTA( N )*WORK( N ) ) PHI = Z( N )*TEMP DPHI = TEMP*TEMP - ERRETM = EIGHT*( -PHI-PSI ) + ERRETM - PHI + RHOINV + - $ ABS( TAU2 )*( DPSI+DPHI ) + ERRETM = EIGHT*( -PHI-PSI ) + ERRETM - PHI + RHOINV +* $ + ABS( TAU2 )*( DPSI+DPHI ) * W = RHOINV + PHI + PSI * @@ -396,8 +396,8 @@ TEMP = Z( N ) / TAU2 PHI = Z( N )*TEMP DPHI = TEMP*TEMP - ERRETM = EIGHT*( -PHI-PSI ) + ERRETM - PHI + RHOINV + - $ ABS( TAU2 )*( DPSI+DPHI ) + ERRETM = EIGHT*( -PHI-PSI ) + ERRETM - PHI + RHOINV +* $ + ABS( TAU2 )*( DPSI+DPHI ) * W = RHOINV + PHI + PSI * @@ -466,8 +466,8 @@ TEMP = Z( N ) / TAU2 PHI = Z( N )*TEMP DPHI = TEMP*TEMP - ERRETM = EIGHT*( -PHI-PSI ) + ERRETM - PHI + RHOINV + - $ ABS( TAU2 )*( DPSI+DPHI ) + ERRETM = EIGHT*( -PHI-PSI ) + ERRETM - PHI + RHOINV +* $ + ABS( TAU2 )*( DPSI+DPHI ) * W = RHOINV + PHI + PSI 90 CONTINUE @@ -618,8 +618,9 @@ DW = DPSI + DPHI + TEMP*TEMP TEMP = Z( II )*TEMP W = W + TEMP - ERRETM = EIGHT*( PHI-PSI ) + ERRETM + TWO*RHOINV + - $ THREE*ABS( TEMP ) + ABS( TAU2 )*DW + ERRETM = EIGHT*( PHI-PSI ) + ERRETM + TWO*RHOINV + $ + THREE*ABS( TEMP ) +* $ + ABS( TAU2 )*DW * * Test for convergence * @@ -698,7 +699,8 @@ * IF( INFO.NE.0 ) THEN * -* If INFO is not 0, i.e., DLAED6 failed, switch back to 2 pole interpolation. +* If INFO is not 0, i.e., DLAED6 failed, switch back +* to 2 pole interpolation. * SWTCH3 = .FALSE. INFO = 0 @@ -797,8 +799,9 @@ DW = DPSI + DPHI + TEMP*TEMP TEMP = Z( II )*TEMP W = RHOINV + PHI + PSI + TEMP - ERRETM = EIGHT*( PHI-PSI ) + ERRETM + TWO*RHOINV + - $ THREE*ABS( TEMP ) + ABS( TAU2 )*DW + ERRETM = EIGHT*( PHI-PSI ) + ERRETM + TWO*RHOINV + $ + THREE*ABS( TEMP ) +* $ + ABS( TAU2 )*DW * SWTCH = .FALSE. IF( ORGATI ) THEN @@ -915,7 +918,8 @@ * IF( INFO.NE.0 ) THEN * -* If INFO is not 0, i.e., DLAED6 failed, switch back to two pole interpolation +* If INFO is not 0, i.e., DLAED6 failed, switch +* back to two pole interpolation * SWTCH3 = .FALSE. INFO = 0 @@ -1030,8 +1034,9 @@ DW = DPSI + DPHI + TEMP*TEMP TEMP = Z( II )*TEMP W = RHOINV + PHI + PSI + TEMP - ERRETM = EIGHT*( PHI-PSI ) + ERRETM + TWO*RHOINV + - $ THREE*ABS( TEMP ) + ABS( TAU2 )*DW + ERRETM = EIGHT*( PHI-PSI ) + ERRETM + TWO*RHOINV + $ + THREE*ABS( TEMP ) +* $ + ABS( TAU2 )*DW * IF( W*PREW.GT.ZERO .AND. ABS( W ).GT.ABS( PREW ) / TEN ) $ SWTCH = .NOT.SWTCH diff --git a/SRC/slasd4.f b/SRC/slasd4.f index 7264fc9f..f29559bd 100644 --- a/SRC/slasd4.f +++ b/SRC/slasd4.f @@ -160,10 +160,10 @@ * * .. Scalar Arguments .. INTEGER I, INFO, N - REAL RHO, SIGMA + REAL RHO, SIGMA * .. * .. Array Arguments .. - REAL D( * ), DELTA( * ), WORK( * ), Z( * ) + REAL D( * ), DELTA( * ), WORK( * ), Z( * ) * .. * * ===================================================================== @@ -305,8 +305,8 @@ * SIGMA = D( N ) + TAU DO 30 J = 1, N - DELTA( J ) = ( D( J )-D( I ) ) - TAU - WORK( J ) = D( J ) + D( I ) + TAU + DELTA( J ) = ( D( J )-D( N ) ) - TAU + WORK( J ) = D( J ) + D( N ) + TAU 30 CONTINUE * * Evaluate PSI and the derivative DPSI @@ -327,8 +327,8 @@ TEMP = Z( N ) / ( DELTA( N )*WORK( N ) ) PHI = Z( N )*TEMP DPHI = TEMP*TEMP - ERRETM = EIGHT*( -PHI-PSI ) + ERRETM - PHI + RHOINV + - $ ABS( TAU2 )*( DPSI+DPHI ) + ERRETM = EIGHT*( -PHI-PSI ) + ERRETM - PHI + RHOINV +* $ + ABS( TAU2 )*( DPSI+DPHI ) * W = RHOINV + PHI + PSI * @@ -396,8 +396,8 @@ TEMP = Z( N ) / TAU2 PHI = Z( N )*TEMP DPHI = TEMP*TEMP - ERRETM = EIGHT*( -PHI-PSI ) + ERRETM - PHI + RHOINV + - $ ABS( TAU2 )*( DPSI+DPHI ) + ERRETM = EIGHT*( -PHI-PSI ) + ERRETM - PHI + RHOINV +* $ + ABS( TAU2 )*( DPSI+DPHI ) * W = RHOINV + PHI + PSI * @@ -466,8 +466,8 @@ TEMP = Z( N ) / TAU2 PHI = Z( N )*TEMP DPHI = TEMP*TEMP - ERRETM = EIGHT*( -PHI-PSI ) + ERRETM - PHI + RHOINV + - $ ABS( TAU2 )*( DPSI+DPHI ) + ERRETM = EIGHT*( -PHI-PSI ) + ERRETM - PHI + RHOINV +* $ + ABS( TAU2 )*( DPSI+DPHI ) * W = RHOINV + PHI + PSI 90 CONTINUE @@ -618,8 +618,9 @@ DW = DPSI + DPHI + TEMP*TEMP TEMP = Z( II )*TEMP W = W + TEMP - ERRETM = EIGHT*( PHI-PSI ) + ERRETM + TWO*RHOINV + - $ THREE*ABS( TEMP ) + ABS( TAU2 )*DW + ERRETM = EIGHT*( PHI-PSI ) + ERRETM + TWO*RHOINV + $ + THREE*ABS( TEMP ) +* $ + ABS( TAU2 )*DW * * Test for convergence * @@ -698,7 +699,8 @@ * IF( INFO.NE.0 ) THEN * -* If INFO is not 0, i.e., SLAED6 failed, switch back to 2 pole interpolation. +* If INFO is not 0, i.e., SLAED6 failed, switch back +* to 2 pole interpolation. * SWTCH3 = .FALSE. INFO = 0 @@ -797,8 +799,9 @@ DW = DPSI + DPHI + TEMP*TEMP TEMP = Z( II )*TEMP W = RHOINV + PHI + PSI + TEMP - ERRETM = EIGHT*( PHI-PSI ) + ERRETM + TWO*RHOINV + - $ THREE*ABS( TEMP ) + ABS( TAU2 )*DW + ERRETM = EIGHT*( PHI-PSI ) + ERRETM + TWO*RHOINV + $ + THREE*ABS( TEMP ) +* $ + ABS( TAU2 )*DW * SWTCH = .FALSE. IF( ORGATI ) THEN @@ -915,7 +918,8 @@ * IF( INFO.NE.0 ) THEN * -* If INFO is not 0, i.e., SLAED6 failed, switch back to two pole interpolation +* If INFO is not 0, i.e., SLAED6 failed, switch +* back to two pole interpolation * SWTCH3 = .FALSE. INFO = 0 @@ -1030,8 +1034,9 @@ DW = DPSI + DPHI + TEMP*TEMP TEMP = Z( II )*TEMP W = RHOINV + PHI + PSI + TEMP - ERRETM = EIGHT*( PHI-PSI ) + ERRETM + TWO*RHOINV + - $ THREE*ABS( TEMP ) + ABS( TAU2 )*DW + ERRETM = EIGHT*( PHI-PSI ) + ERRETM + TWO*RHOINV + $ + THREE*ABS( TEMP ) +* $ + ABS( TAU2 )*DW * IF( W*PREW.GT.ZERO .AND. ABS( W ).GT.ABS( PREW ) / TEN ) $ SWTCH = .NOT.SWTCH diff --git a/TESTING/svd.in b/TESTING/svd.in index 0dc39b78..bc0ae2d2 100644 --- a/TESTING/svd.in +++ b/TESTING/svd.in @@ -1,7 +1,7 @@ SVD: Data file for testing Singular Value Decomposition routines -18 Number of values of M -0 0 0 1 1 2 2 3 3 3 10 10 16 16 30 30 40 40 Values of M -0 1 3 1 2 0 1 0 1 3 10 16 10 16 30 40 30 40 Values of N +19 Number of values of M +0 0 0 1 1 1 2 2 3 3 3 10 10 16 16 30 30 40 40 Values of M +0 1 3 0 1 2 0 1 0 1 3 10 16 10 16 30 40 30 40 Values of N 5 Number of parameter values 1 3 3 3 20 Values of NB (blocksize) 2 2 2 2 2 Values of NBMIN (minimum blocksize) -- 2.34.1