- ←Prev
- KAPLIBS – Internal subroutines used within the KAPPA package.
- Next→
- TOC ↑
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:
- ←Prev
- KAPLIBS – Internal subroutines used within the KAPPA package.
- Next→
- TOC ↑