3 /* Subroutine */ int dlamrg_(integer *n1, integer *n2, doublereal *a, integer
4 *dtrd1, integer *dtrd2, integer *index)
6 /* System generated locals */
10 integer i__, ind1, ind2, n1sv, n2sv;
13 /* -- LAPACK routine (version 3.1) -- */
14 /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
17 /* .. Scalar Arguments .. */
19 /* .. Array Arguments .. */
25 /* DLAMRG will create a permutation list which will merge the elements */
26 /* of A (which is composed of two independently sorted sets) into a */
27 /* single set which is sorted in ascending order. */
32 /* N1 (input) INTEGER */
33 /* N2 (input) INTEGER */
34 /* These arguements contain the respective lengths of the two */
35 /* sorted lists to be merged. */
37 /* A (input) DOUBLE PRECISION array, dimension (N1+N2) */
38 /* The first N1 elements of A contain a list of numbers which */
39 /* are sorted in either ascending or descending order. Likewise */
40 /* for the final N2 elements. */
42 /* DTRD1 (input) INTEGER */
43 /* DTRD2 (input) INTEGER */
44 /* These are the strides to be taken through the array A. */
45 /* Allowable strides are 1 and -1. They indicate whether a */
46 /* subset of A is sorted in ascending (DTRDx = 1) or descending */
47 /* (DTRDx = -1) order. */
49 /* INDEX (output) INTEGER array, dimension (N1+N2) */
50 /* On exit this array will contain a permutation such that */
51 /* if B( I ) = A( INDEX( I ) ) for I=1,N1+N2, then B will be */
52 /* sorted in ascending order. */
54 /* ===================================================================== */
56 /* .. Local Scalars .. */
58 /* .. Executable Statements .. */
60 /* Parameter adjustments */
78 /* while ( (N1SV > 0) & (N2SV > 0) ) */
80 if (n1sv > 0 && n2sv > 0) {
81 if (a[ind1] <= a[ind2]) {
97 for (n1sv = 1; n1sv <= i__1; ++n1sv) {
106 for (n2sv = 1; n2sv <= i__1; ++n2sv) {