TDSORT(3NCARG)

πŸ“¦ version 6.6.2, in epel 9, fedora 43, fedora 44

✨ 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 type REAL, dimensioned NWRK. It's an array of NWRK real numbers that are to be sorted. Here's the thing though: the contents of RWRK are returned unchanged 😌. The ordering is as specified by the contents of the array IWRK. She does not touch your data, she just tells you where it goes. Iconic behaviour honestly.
  • NWRK β€” an input expression of type INTEGER, and it's the dimension of RWRK (and of IWRK). Yes, both. They match. Slay.
  • IORD β€” an input expression of type INTEGER. If IORD is 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 type INTEGER, dimensioned at least NWRK. She comes back containing a permutation of the integers from 1 to NWRK. 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 (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