Next: CCG_IS3x - Sorts a list of data into increasing order, and applies the corresponding shuffle to two ancillary lists
Up: Routine Descriptions
Previous: CCG_I2WCx - Assigns world co-ordinates to an output array from an input list of indices
CCG_IS2x
- Sorts a list of data into increasing order, and applies the
corresponding shuffle to an ancillary list
- Description:
- The routine uses an insert-sort method. This has proven itself
the quickest for sorting small sets of data lots of times, as in
image stacking using ordered statistics. The method looks at the
second value, compares this with the first if swaps if necessary,
then it looks at the third, looks at the previous values swaps
with the lowest (or not at all) and so on until all values have
been passed. It is fast (for the case above) simply because of
the very few lines of operation. The sort is extended to the
ancillary data ANCDAT, this maintains its correspondence with the
ORDDAT dataset on exit.
- Invocation:
- CALL CCG_IS2x( EL, ORDDAT, ANCDAT, STATUS )
- Arguments:
-
-
EL = INTEGER (Given)
-
The number of entries in ORDDAT.
-
ORDDAT( EL ) = ? (Given and Returned)
-
The data to order. On output it contains the data in increasing
order.
-
ANCDAT( EL ) = INTEGER (Given and Returned)
-
A list of data associated with ORDDAT which needs to retain its
correspondence with the items in ORDDAT (probably pointers).
-
STATUS = INTEGER (Given and Returned)
-
The global status.
- Notes:
- There is a routine for real and double-precision: replace "x"
in the routine name by D or R as appropriate. The ORDDAT
argument supplied to the routine must have the data type
specified.
Next: CCG_IS3x - Sorts a list of data into increasing order, and applies the corresponding shuffle to two ancillary lists
Up: Routine Descriptions
Previous: CCG_I2WCx - Assigns world co-ordinates to an output array from an input list of indices
KAPLIBS -- Internal subroutines used within the KAPPA package.
Starlink User Note 238
D.S. Berry
Malcolm J. Currie
9th March 2009
E-mail:ussc@star.rl.ac.uk
Copyright © 2010 Science and Technology Facilities Council