?lasrt2
?lasrt2
Sorts numbers in increasing or decreasing order.
Syntax
void
slasrt2
(
char
*id
,
MKL_INT
*n
,
float
*d
,
MKL_INT
*key
,
MKL_INT
*info
);
void
dlasrt2
(
char
*id
,
MKL_INT
*n
,
double
*d
,
MKL_INT
*key
,
MKL_INT
*info
);
Include Files
- mkl_scalapack.h
Description
The ) or in decreasing order (if ). It uses Quick Sort, reverting to Insertion Sort on arrays of size
?lasrt2
function
is modified LAPACK function
?lasrt
, which sorts the numbers in d
in increasing order (if id
= 'I'
id
= 'D'
≤
20. The size of STACK
limits n
to about 232
.Input Parameters
- id
- ='I': sortdin increasing order;='D': sortdin decreasing order.
- n
- The length of the arrayd.
- d
- Array of sizen.On entry, the array to be sorted.
- key
- Array of sizen.On entry,keycontains a key to each of the entries in.dTypically,.key[i]=i+1 for alli= 0, ...,n-1
Output Parameters
- d
- On exit,dhas been sorted into increasing order(d[0]≤...≤d[n- 1] )or into decreasing order(,d[0]≥...≥d[n- 1] )depending onid.
- info
- = 0: successful exit< 0: if, theinfo= -ii-th argument had an illegal value.
- key
- On exit,keyis permuted in exactly the same manner asdwas permuted from input to output. Therefore, ifon input,key[i] =i+1 for alli=0, ..., n-1.d[i] on output equalsd[key[i]-1] on input