Skip to content

Commit 3028bb9

Browse files
committed
lapack_d: cleanup some loops/variables
1 parent fbac7a4 commit 3028bb9

File tree

1 file changed

+26
-38
lines changed

1 file changed

+26
-38
lines changed

src/stdlib_linalg_lapack_d.fypp

Lines changed: 26 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -29177,8 +29177,7 @@ module stdlib_linalg_lapack_d
2917729177
end do
2917829178
f = finit + tau*fc
2917929179
erretm = eight*( abs( finit )+abs( tau )*erretm ) +abs( tau )*df
29180-
if( ( abs( f )<=four*eps*erretm ) .or.( (ubd-lbd)<=four*eps*abs(tau) ) )go to &
29181-
60
29180+
if( ( abs( f )<=four*eps*erretm ) .or.( (ubd-lbd)<=four*eps*abs(tau) ) ) go to 60
2918229181
if( f <= zero )then
2918329182
lbd = tau
2918429183
else
@@ -35315,8 +35314,7 @@ module stdlib_linalg_lapack_d
3531535314
nn = 4*n0 + pp
3531635315
if( n0==( i0+1 ) )go to 40
3531735316
! check whether e(n0-1) is negligible, 1 eigenvalue.
35318-
if( z( nn-5 )>tol2*( sigma+z( nn-3 ) ) .and.z( nn-2*pp-4 )>tol2*z( nn-7 ) )go to &
35319-
30
35317+
if( z( nn-5 )>tol2*( sigma+z( nn-3 ) ) .and.z( nn-2*pp-4 )>tol2*z( nn-7 ) ) go to 30
3532035318
20 continue
3532135319
z( 4*n0-3 ) = z( 4*n0+pp-3 ) + sigma
3532235320
n0 = n0 - 1
@@ -66034,8 +66032,7 @@ module stdlib_linalg_lapack_d
6603466032
call stdlib_dlarfx( 'L', 3, 3, u, tau, d, ldd, work )
6603566033
call stdlib_dlarfx( 'R', 3, 3, u, tau, d, ldd, work )
6603666034
! test whether to reject swap.
66037-
if( max( abs( d( 3, 1 ) ), abs( d( 3, 2 ) ), abs( d( 3,3 )-t11 ) )>thresh )go to &
66038-
50
66035+
if( max( abs( d( 3, 1 ) ), abs( d( 3, 2 ) ), abs( d( 3,3 )-t11 ) )>thresh ) go to 50
6603966036
! accept swap: apply transformation to the entire matrix t.
6604066037
call stdlib_dlarfx( 'L', 3, n-j1+1, u, tau, t( j1, j1 ), ldt, work )
6604166038
call stdlib_dlarfx( 'R', j2, 3, u, tau, t( 1, j1 ), ldt, work )
@@ -66062,8 +66059,7 @@ module stdlib_linalg_lapack_d
6606266059
call stdlib_dlarfx( 'L', 3, 3, u, tau, d, ldd, work )
6606366060
call stdlib_dlarfx( 'R', 3, 3, u, tau, d, ldd, work )
6606466061
! test whether to reject swap.
66065-
if( max( abs( d( 2, 1 ) ), abs( d( 3, 1 ) ), abs( d( 1,1 )-t33 ) )>thresh )go to &
66066-
50
66062+
if( max( abs( d( 2, 1 ) ), abs( d( 3, 1 ) ), abs( d( 1,1 )-t33 ) )>thresh ) go to 50
6606766063
! accept swap: apply transformation to the entire matrix t.
6606866064
call stdlib_dlarfx( 'R', j3, 3, u, tau, t( 1, j1 ), ldt, work )
6606966065
call stdlib_dlarfx( 'L', 3, n-j1, u, tau, t( j1, j2 ), ldt, work )
@@ -68845,25 +68841,23 @@ module stdlib_linalg_lapack_d
6884568841
! aggressive enforcement of lower numerical rank by introducing a
6884668842
! backward error of the order of n*epsln*||a||.
6884768843
temp1 = sqrt(real(n,KIND=dp))*epsln
68848-
do p = 2, n
68844+
loop_3002: do p = 2, n
6884968845
if ( abs(a(p,p)) >= (temp1*abs(a(1,1))) ) then
6885068846
nr = nr + 1
6885168847
else
68852-
go to 3002
68848+
exit loop_3002
6885368849
end if
68854-
end do
68855-
3002 continue
68850+
end do loop_3002
6885668851
else if ( l2rank ) then
6885768852
! .. similarly as above, only slightly more gentle (less aggressive).
6885868853
! sudden drop on the diagonal of r1 is used as the criterion for
6885968854
! close-to-rank-deficient.
6886068855
temp1 = sqrt(sfmin)
68861-
do p = 2, n
68856+
loop_3402: do p = 2, n
6886268857
if ( ( abs(a(p,p)) < (epsln*abs(a(p-1,p-1))) ) .or.( abs(a(p,p)) < small ) .or.( &
68863-
l2kill .and. (abs(a(p,p)) < temp1) ) ) go to 3402
68858+
l2kill .and. (abs(a(p,p)) < temp1) ) ) exit loop_3402
6886468859
nr = nr + 1
68865-
end do
68866-
3402 continue
68860+
end do loop_3402
6886768861
else
6886868862
! the goal is high relative accuracy. however, if the matrix
6886968863
! has high scaled condition number the relative accuracy is in
@@ -68873,12 +68867,10 @@ module stdlib_linalg_lapack_d
6887368867
! factor. this prevents the situation in which the code is
6887468868
! working hard to get the accuracy not warranted by the data.
6887568869
temp1 = sqrt(sfmin)
68876-
do p = 2, n
68877-
if ( ( abs(a(p,p)) < small ) .or.( l2kill .and. (abs(a(p,p)) < temp1) ) ) go to &
68878-
3302
68870+
loop_3302: do p = 2, n
68871+
if ( ( abs(a(p,p)) < small ) .or.( l2kill .and. (abs(a(p,p)) < temp1) ) ) exit loop_3302
6887968872
nr = nr + 1
68880-
end do
68881-
3302 continue
68873+
end do loop_3302
6888268874
end if
6888368875
almort = .false.
6888468876
if ( nr == n ) then
@@ -78664,11 +78656,10 @@ module stdlib_linalg_lapack_d
7866478656
! backward error of the order of n*eps*||a||_f.
7866578657
nr = 1
7866678658
rtmp = sqrt(real(n,KIND=dp))*epsln
78667-
do p = 2, n
78668-
if ( abs(a(p,p)) < (rtmp*abs(a(1,1))) ) go to 3002
78659+
loop_3002: do p = 2, n
78660+
if ( abs(a(p,p)) < (rtmp*abs(a(1,1))) ) exit loop_3002
7866978661
nr = nr + 1
78670-
end do
78671-
3002 continue
78662+
end do loop_3002
7867278663
elseif ( acclm ) then
7867378664
! .. similarly as above, only slightly more gentle (less aggressive).
7867478665
! sudden drop on the diagonal of r is used as the criterion for being
@@ -78677,23 +78668,20 @@ module stdlib_linalg_lapack_d
7867778668
! with a user specified threshold.]] also, the values that underflow
7867878669
! will be truncated.
7867978670
nr = 1
78680-
do p = 2, n
78681-
if ( ( abs(a(p,p)) < (epsln*abs(a(p-1,p-1))) ) .or.( abs(a(p,p)) < sfmin ) ) go &
78682-
to 3402
78671+
loop_3402: do p = 2, n
78672+
if ( ( abs(a(p,p)) < (epsln*abs(a(p-1,p-1))) ) .or.( abs(a(p,p)) < sfmin ) ) exit loop_3402
7868378673
nr = nr + 1
78684-
end do
78685-
3402 continue
78674+
end do loop_3402
7868678675
else
7868778676
! Rrqr Not Authorized To Determine Numerical Rank Except In The
7868878677
! obvious case of zero pivots.
7868978678
! .. inspect r for exact zeros on the diagonal;
7869078679
! r(i,i)=0 => r(i:n,i:n)=0.
7869178680
nr = 1
78692-
do p = 2, n
78693-
if ( abs(a(p,p)) == zero ) go to 3502
78694-
nr = nr + 1
78695-
end do
78696-
3502 continue
78681+
loop_3502: do p = 2, n
78682+
if ( abs(a(p,p)) == zero ) exit loop_3502
78683+
nr = nr + 1
78684+
end do loop_3502
7869778685
if ( conda ) then
7869878686
! estimate the scaled condition number of a. use the fact that it is
7869978687
! the same as the scaled condition number of r.
@@ -80397,7 +80385,7 @@ module stdlib_linalg_lapack_d
8039780385
kwtop, kwv, ld, ls, lwkopt, ndec, ndfl, nh, nho, nibble, nmin, ns, nsmax, nsr, nve, nw,&
8039880386
nwmax, nwr, nwupbd
8039980387
logical(lk) :: sorted
80400-
character :: jbcmpz*2
80388+
character(len=2) :: jbcmpz
8040180389
! Local Arrays
8040280390
real(dp) :: zdum(1,1)
8040380391
! Intrinsic Functions
@@ -81084,7 +81072,7 @@ module stdlib_linalg_lapack_d
8108481072
kwtop, kwv, ld, ls, lwkopt, ndec, ndfl, nh, nho, nibble, nmin, ns, nsmax, nsr, nve, nw,&
8108581073
nwmax, nwr, nwupbd
8108681074
logical(lk) :: sorted
81087-
character :: jbcmpz*2
81075+
character(len=2) :: jbcmpz
8108881076
! Local Arrays
8108981077
real(dp) :: zdum(1,1)
8109081078
! Intrinsic Functions
@@ -81464,7 +81452,7 @@ module stdlib_linalg_lapack_d
8146481452
istopm, iwants, iwantq, iwantz, norm_info, aed_info, nwr, nbr, nsr, itemp1, itemp2, &
8146581453
rcost, i
8146681454
logical(lk) :: ilschur, ilq, ilz
81467-
character :: jbcmpz*3
81455+
character(len=3) :: jbcmpz
8146881456
if( stdlib_lsame( wants, 'E' ) ) then
8146981457
ilschur = .false.
8147081458
iwants = 1

0 commit comments

Comments
 (0)