89 SUBROUTINE slasrt( ID, N, D, INFO )
108 parameter (
SELECT = 20 )
111 INTEGER DIR, ENDD, I, J, START, STKPNT
112 REAL D1, D2, D3, DMNMX, TMP
115 INTEGER STACK( 2, 32 )
130 IF( lsame( id,
'D' ) )
THEN
132 ELSE IF( lsame( id,
'I' ) )
THEN
137 ELSE IF( n.LT.0 )
THEN
141 CALL xerbla(
'SLASRT', -info )
154 start = stack( 1, stkpnt )
155 ENDD = STACK( 2, STKPNT )
157 IF( endd-start.LE.
SELECT .AND. endd-start.GT.0 )
THEN
165 DO 30 i = start + 1, endd
166 DO 20 j = i, start + 1, -1
167 IF( d( j ).GT.d( j-1 ) )
THEN
181 DO 50 i = start + 1, endd
182 DO 40 j = i, start + 1, -1
183 IF( d( j ).LT.d( j-1 ) )
THEN
195 ELSE IF( endd-start.GT.
SELECT )
THEN
203 i = ( start+endd ) / 2
208 ELSE IF( d3.LT.d2 )
THEN
216 ELSE IF( d3.LT.d1 )
THEN
232 IF( d( j ).LT.dmnmx )
236 IF( d( i ).GT.dmnmx )
244 IF( j-start.GT.endd-j-1 )
THEN
246 stack( 1, stkpnt ) = start
247 stack( 2, stkpnt ) = j
249 stack( 1, stkpnt ) = j + 1
250 stack( 2, stkpnt ) = endd
253 stack( 1, stkpnt ) = j + 1
254 stack( 2, stkpnt ) = endd
256 stack( 1, stkpnt ) = start
257 stack( 2, stkpnt ) = j
268 IF( d( j ).GT.dmnmx )
272 IF( d( i ).LT.dmnmx )
280 IF( j-start.GT.endd-j-1 )
THEN
282 stack( 1, stkpnt ) = start
283 stack( 2, stkpnt ) = j
285 stack( 1, stkpnt ) = j + 1
286 stack( 2, stkpnt ) = endd
289 stack( 1, stkpnt ) = j + 1
290 stack( 2, stkpnt ) = endd
292 stack( 1, stkpnt ) = start
293 stack( 2, stkpnt ) = j
subroutine xerbla(SRNAME, INFO)
XERBLA
subroutine slasrt(ID, N, D, INFO)
SLASRT sorts numbers in increasing or decreasing order.