TDSORT(3NCARG)
β¨ TDSORT β¨ (that's TDSORT(3NCARG) bestie, from the NCAR GRAPHICS fam π)
πΈ NAME πΈ
TDSORT β it's a generic sorting routine, and ngl it's normally used indirectly, by calling the routine TDOTRI. She's a background queen, she doesn't need the spotlight π
π SYNOPSIS π
CALL TDSORT (RWRK, NRWK, IORD, IWRK)
π¦ C-BINDING SYNOPSIS π¦
#include <ncarg/ncargC.h>
void c_tdsort(float *rwrk, int nwrk, int iord, int *iwrk)
π DESCRIPTION π
Okay so, real talk: this is an internal routine used for sorting. Originally it was not intended that a user should call this routine directly β but bestie, doing so will do no harm π. She's chill like that.
So here's the vibe: you hand her an array of NRWK reals sitting in an array RWRK, plus an "ordering flag" IORD, and TDSORT returns a permutation vector IWRK such that, for every I and J such that 1.LE.I.LE.J.LE.NWRK, if IORD is zero, then RWRK(IWRK(I)).LE.RWRK(IWRK(J)), else RWRK(IWRK(I)).GE.RWRK(IWRK(J)). Periodt β¨.
The arguments of TDSORT are as follows β pay attention, this is the important part π«Ά:
RWRKβ an input array, of typeREAL, dimensionedNWRK. It's an array ofNWRKreal numbers that are to be sorted. Here's the thing though: the contents ofRWRKare returned unchanged π. The ordering is as specified by the contents of the arrayIWRK. She does not touch your data, she just tells you where it goes. Iconic behaviour honestly.NWRKβ an input expression of typeINTEGER, and it's the dimension ofRWRK(and ofIWRK). Yes, both. They match. Slay.IORDβ an input expression of typeINTEGER. IfIORDis zero, the desired ordering is from smallest numeric value to largest. Otherwise, the desired ordering is from largest value to smallest. So like,0= ascending, not-0= descending, that's the whole plot π.IWRKβ an output array of typeINTEGER, dimensioned at leastNWRK. She comes back containing a permutation of the integers from1toNWRK. That's it, that's the whole job π.
π§ C-BINDING DESCRIPTION π§
The C-binding argument descriptions are the same as the FORTRAN argument descriptions. No notes. Same energy, different syntax π.
π₯ ACCESS π₯
To use TDSORT or c_tdsort, load the NCAR Graphics libraries ncarg, ncarg_gks, and ncarg_c β preferably in that order. Order matters bestie, don't be chaotic π.
β SEE ALSO β
Online: tdclrs, tdctri, tddtri, tdgeti, tdgetr, tdgrds, tdgrid, tdgtrs, tdinit, tditri, tdlbla, tdlbls, tdline, tdlnpa, tdmtri, tdotri, tdpack, tdpack_params, tdpara, tdplch, tdprpa, tdprpi, tdprpt, tdseti, tdsetr, tdstri, tdstrs
(the whole td* friend group showed up, we love a supportive squad π«Ά)
π COPYRIGHT π
Copyright (C) 1987-2009 University Corporation for Atmospheric Research
The use of this Software is governed by a License Agreement.
Okay that's the whole page, you ate it, you understood it, main character energy all around π
β¨ This was TDSORT(3NCARG) from the UNIX manual, dated July 1997 β yeah she's an elder but she's still thriving. Byeee, go sort something π¦π
π¦ where this page comes from
- debian bookworm: libncarg-dev 6.6.2.dfsg.1-1
- debian trixie: libncarg-dev 6.6.2.dfsg.1-10+b2
- ubuntu jammy: libncarg-dev 6.6.2-10build2
- ubuntu questing: libncarg-dev 6.6.2.dfsg.1-10build2
- ubuntu resolute: libncarg-dev 6.6.2.dfsg.1-12
- ubuntu stonking: libncarg-dev 6.6.2.dfsg.1-12build2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms