1 SUBROUTINE dlasrt( ID, N, D, INFO )
13 DOUBLE PRECISION D( * )
49 parameter(
SELECT = 20 )
52 INTEGER DIR, ENDD, I, J, START, STKPNT
53 DOUBLE PRECISION D1, D2, D3, DMNMX, TMP
56 INTEGER STACK( 2, 32 )
71 IF( lsame( id,
'D' ) )
THEN
73 ELSE IF( lsame( id,
'I' ) )
THEN
78 ELSE IF( n.LT.0 )
THEN
82 CALL xerbla(
'DLASRT', -info )
95 start = stack( 1, stkpnt )
96 endd = stack( 2, stkpnt )
98 IF( endd-start.LE.
SELECT .AND. endd-start.GT.0 )
THEN
106 DO 30 i = start + 1, endd
107 DO 20 j = i, start + 1, -1
108 IF( d( j ).GT.d( j-1 ) )
THEN
122 DO 50 i = start + 1, endd
123 DO 40 j = i, start + 1, -1
124 IF( d( j ).LT.d( j-1 ) )
THEN
136 ELSE IF( endd-start.GT.
SELECT )
THEN
144 i = ( start+endd ) / 2
149 ELSE IF( d3.LT.d2 )
THEN
157 ELSE IF( d3.LT.d1 )
THEN
173 IF( d( j ).LT.dmnmx )
177 IF( d( i ).GT.dmnmx )
185 IF( j-start.GT.endd-j-1 )
THEN
187 stack( 1, stkpnt ) = start
188 stack( 2, stkpnt ) = j
190 stack( 1, stkpnt ) = j + 1
191 stack( 2, stkpnt ) = endd
194 stack( 1, stkpnt ) = j + 1
195 stack( 2, stkpnt ) = endd
197 stack( 1, stkpnt ) = start
198 stack( 2, stkpnt ) = j
209 IF( d( j ).GT.dmnmx )
213 IF( d( i ).LT.dmnmx )
221 IF( j-start.GT.endd-j-1 )
THEN
223 stack( 1, stkpnt ) = start
224 stack( 2, stkpnt ) = j
226 stack( 1, stkpnt ) = j + 1
227 stack( 2, stkpnt ) = endd
230 stack( 1, stkpnt ) = j + 1
231 stack( 2, stkpnt ) = endd
233 stack( 1, stkpnt ) = start
234 stack( 2, stkpnt ) = j
subroutine dlasrt(ID, N, D, INFO)
subroutine xerbla(SRNAME, INFO)