1SLAMRG(1) LAPACK routine (version 3.1) SLAMRG(1)
2
3
4
6 SLAMRG - create a permutation list which will merge the elements of A
7 (which is composed of two independently sorted sets) into a single set
8 which is sorted in ascending order
9
11 SUBROUTINE SLAMRG( N1, N2, A, STRD1, STRD2, INDEX )
12
13 INTEGER N1, N2, STRD1, STRD2
14
15 INTEGER INDEX( * )
16
17 REAL A( * )
18
20 SLAMRG will create a permutation list which will merge the elements of
21 A (which is composed of two independently sorted sets) into a single
22 set which is sorted in ascending order.
23
24
26 N1 (input) INTEGER
27 N2 (input) INTEGER These arguements contain the respective
28 lengths of the two sorted lists to be merged.
29
30 A (input) REAL array, dimension (N1+N2)
31 The first N1 elements of A contain a list of numbers which are
32 sorted in either ascending or descending order. Likewise for
33 the final N2 elements.
34
35 STRD1 (input) INTEGER
36 STRD2 (input) INTEGER These are the strides to be taken through
37 the array A. Allowable strides are 1 and -1. They indicate
38 whether a subset of A is sorted in ascending (STRDx = 1) or
39 descending (STRDx = -1) order.
40
41 INDEX (output) INTEGER array, dimension (N1+N2)
42 On exit this array will contain a permutation such that if B( I
43 ) = A( INDEX( I ) ) for I=1,N1+N2, then B will be sorted in
44 ascending order.
45
46
47
48 LAPACK routine (version 3.1) November 2006 SLAMRG(1)