LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine slaord ( character  JOB,
integer  N,
real, dimension( * )  X,
integer  INCX 
)

SLAORD

Purpose:
 SLAORD sorts the elements of a vector x in increasing or decreasing
 order.
Parameters
[in]JOB
          JOB is CHARACTER
          = 'I':  Sort in increasing order
          = 'D':  Sort in decreasing order
[in]N
          N is INTEGER
          The length of the vector X.
[in,out]X
          X is REAL array, dimension
                         (1+(N-1)*INCX)
          On entry, the vector of length n to be sorted.
          On exit, the vector x is sorted in the prescribed order.
[in]INCX
          INCX is INTEGER
          The spacing between successive elements of X.  INCX >= 0.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
November 2011

Definition at line 75 of file slaord.f.

75 *
76 * -- LAPACK test routine (version 3.4.0) --
77 * -- LAPACK is a software package provided by Univ. of Tennessee, --
78 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
79 * November 2011
80 *
81 * .. Scalar Arguments ..
82  CHARACTER job
83  INTEGER incx, n
84 * ..
85 * .. Array Arguments ..
86  REAL x( * )
87 * ..
88 *
89 * =====================================================================
90 *
91 * .. Local Scalars ..
92  INTEGER i, inc, ix, ixnext
93  REAL temp
94 * ..
95 * .. External Functions ..
96  LOGICAL lsame
97  EXTERNAL lsame
98 * ..
99 * .. Intrinsic Functions ..
100  INTRINSIC abs
101 * ..
102 * .. Executable Statements ..
103 *
104  inc = abs( incx )
105  IF( lsame( job, 'I' ) ) THEN
106 *
107 * Sort in increasing order
108 *
109  DO 20 i = 2, n
110  ix = 1 + ( i-1 )*inc
111  10 CONTINUE
112  IF( ix.EQ.1 )
113  $ GO TO 20
114  ixnext = ix - inc
115  IF( x( ix ).GT.x( ixnext ) ) THEN
116  GO TO 20
117  ELSE
118  temp = x( ix )
119  x( ix ) = x( ixnext )
120  x( ixnext ) = temp
121  END IF
122  ix = ixnext
123  GO TO 10
124  20 CONTINUE
125 *
126  ELSE IF( lsame( job, 'D' ) ) THEN
127 *
128 * Sort in decreasing order
129 *
130  DO 40 i = 2, n
131  ix = 1 + ( i-1 )*inc
132  30 CONTINUE
133  IF( ix.EQ.1 )
134  $ GO TO 40
135  ixnext = ix - inc
136  IF( x( ix ).LT.x( ixnext ) ) THEN
137  GO TO 40
138  ELSE
139  temp = x( ix )
140  x( ix ) = x( ixnext )
141  x( ixnext ) = temp
142  END IF
143  ix = ixnext
144  GO TO 30
145  40 CONTINUE
146  END IF
147  RETURN
148 *
149 * End of SLAORD
150 *
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55

Here is the caller graph for this function: