98 DOUBLE PRECISION D( * )
105 parameter(
SELECT = 20 )
108 INTEGER DIR, ENDD, I, J, START, STKPNT
109 DOUBLE PRECISION D1, D2, D3, DMNMX, TMP
112 INTEGER STACK( 2, 32 )
127 IF( lsame( id,
'D' ) )
THEN
129 ELSE IF( lsame( id,
'I' ) )
THEN
134 ELSE IF( n.LT.0 )
THEN
138 CALL xerbla(
'DLASRT', -info )
151 start = stack( 1, stkpnt )
152 endd = stack( 2, stkpnt )
154 IF( endd-start.LE.
SELECT .AND. endd-start.GT.0 )
THEN
162 DO 30 i = start + 1, endd
163 DO 20 j = i, start + 1, -1
164 IF( d( j ).GT.d( j-1 ) )
THEN
178 DO 50 i = start + 1, endd
179 DO 40 j = i, start + 1, -1
180 IF( d( j ).LT.d( j-1 ) )
THEN
192 ELSE IF( endd-start.GT.
SELECT )
THEN
200 i = ( start+endd ) / 2
205 ELSE IF( d3.LT.d2 )
THEN
213 ELSE IF( d3.LT.d1 )
THEN
229 IF( d( j ).LT.dmnmx )
233 IF( d( i ).GT.dmnmx )
241 IF( j-start.GT.endd-j-1 )
THEN
243 stack( 1, stkpnt ) = start
244 stack( 2, stkpnt ) = j
246 stack( 1, stkpnt ) = j + 1
247 stack( 2, stkpnt ) = endd
250 stack( 1, stkpnt ) = j + 1
251 stack( 2, stkpnt ) = endd
253 stack( 1, stkpnt ) = start
254 stack( 2, stkpnt ) = j
265 IF( d( j ).GT.dmnmx )
269 IF( d( i ).LT.dmnmx )
277 IF( j-start.GT.endd-j-1 )
THEN
279 stack( 1, stkpnt ) = start
280 stack( 2, stkpnt ) = j
282 stack( 1, stkpnt ) = j + 1
283 stack( 2, stkpnt ) = endd
286 stack( 1, stkpnt ) = j + 1
287 stack( 2, stkpnt ) = endd
289 stack( 1, stkpnt ) = start
290 stack( 2, stkpnt ) = j
subroutine xerbla(srname, info)
subroutine dlasrt(id, n, d, info)
DLASRT sorts numbers in increasing or decreasing order.