1TDSORT(3NCARG) NCAR GRAPHICS TDSORT(3NCARG)
2
3
4
6 TDSORT - A generic sorting routine, normally used indirectly (by
7 calling the routine TDOTRI).
8
10 CALL TDSORT (RWRK, NRWK, IORD, IWRK)
11
13 #include <ncarg/ncargC.h>
14
15 void c_tdsort(float *rwrk, int nwrk, int iord, int *iwrk)
16
18 This is an internal routine used for sorting. Originally, it was not
19 intended that a user should call this routine directly, but doing so
20 will do no harm. Given an array of NRWK reals in an array RWRK and an
21 "ordering flag" IORD, TDSORT returns a permutation vector IWRK such
22 that, for every I and J such that 1.LE.I.LE.J.LE.NWRK, if IORD is zero,
23 then RWRK(IWRK(I)).LE.RWRK(IWRK(J)), else
24 RWRK(IWRK(I)).GE.RWRK(IWRK(J)).
25
26 The arguments of TDSORT are as follows:
27
28 RWRK (an input array, of type REAL, dimensioned NWRK) - an array of
29 NWRK real numbers that are to be sorted. The contents of RWRK
30 are returned unchanged; the ordering is as specified by the
31 contents of the array IWRK.
32
33 NWRK (an input expression of type INTEGER) - the dimension of RWRK
34 (and of IWRK).
35
36 IORD (an input expression of type INTEGER) - if IORD is zero, the
37 desired ordering is from smallest numeric value to largest;
38 otherwise, the desired ordering is from largest value to
39 smallest.
40
41 IWRK (an output array of type INTEGER, dimensioned at least NWRK) -
42 returned containing a permutation of the integers from 1 to
43 NWRK.
44
46 The C-binding argument descriptions are the same as the FORTRAN
47 argument descriptions.
48
50 To use TDSORT or c_tdsort, load the NCAR Graphics libraries ncarg,
51 ncarg_gks, and ncarg_c, preferably in that order.
52
54 Online: tdclrs, tdctri, tddtri, tdgeti, tdgetr, tdgrds, tdgrid, tdgtrs,
55 tdinit, tditri, tdlbla, tdlbls, tdline, tdlnpa, tdmtri, tdotri, tdpack,
56 tdpack_params, tdpara, tdplch, tdprpa, tdprpi, tdprpt, tdseti, tdsetr,
57 tdstri, tdstrs
58
60 Copyright (C) 1987-2007
61 University Corporation for Atmospheric Research
62
63 This documentation is free software; you can redistribute it and/or
64 modify it under the terms of the GNU General Public License as
65 published by the Free Software Foundation; either version 2 of the
66 License, or (at your option) any later version.
67
68 This software is distributed in the hope that it will be useful, but
69 WITHOUT ANY WARRANTY; without even the implied warranty of
70 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
71 General Public License for more details.
72
73 You should have received a copy of the GNU General Public License along
74 with this software; if not, write to the Free Software Foundation,
75 Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
76
77
78
79
80UNIX July 1997 TDSORT(3NCARG)