orderd_c

Index Page orderd_c
A B C D E F G H I J K L M N O P Q R S T U V W X
Procedure Abstract Required_Reading Keywords Brief_I/O Detailed_Input | Detailed_Output Parameters Exceptions Files Particulars Examples | Restrictions Literature_References Author_and_Institution Version Index_Entries
#### Procedure
       void orderd_c ( ConstSpiceDouble  * array,
                       SpiceInt            ndim,
                       SpiceInt          * iorder )
#### Abstract
       Determine the order of elements in a double precision array.
#### Required_Reading
       None.
#### Keywords
        ARRAY,  SORT
#### Brief_I/O
       VARIABLE  I/O  DESCRIPTION
       --------  ---  --------------------------------------------------
       array      I   Input array.
       ndim       I   Dimension of array.
       iorder     O   Order vector for array.
#### Detailed_Input
       array       is the input array.

       ndim        is the number of elements in the input array.
#### Detailed_Output
       iorder      is the order vector for the input array.
                   iorder[0] is the index of the smallest element
                   of array; iorder[1] is the index of the next
                   smallest; and so on.

                   The elements of iorder range from zero to ndim-1.
#### Parameters
       None.
#### Exceptions
       Error free.
#### Files
       None.
#### Particulars
       orderd_c finds the index of the smallest element of the input
       array. This becomes the first element of the order vector.
       The process is repeated for the rest of the elements.

       The order vector returned by orderd_c may be used by any of
       the reord* routines to sort sets of related arrays, as shown
       in the example below.
#### Examples
       In the following example, the order* and reord* routines are
       used to sort four related arrays (containing the names,
       masses, integer ID codes, and visual magnitudes for a group
       of satellites). This is representative of the typical use of
       these routines.

          #include "SpiceUsr.h"
               .
               .
               .
          /.
          Sort the object arrays by name.
          ./

          orderc_c ( namlen, names, n,  iorder );

          reordc_c ( iorder, n, namlen, names  );
          reordd_c ( iorder, n,         masses );
          reordi_c ( iorder, n,         codes  );
          reordd_c ( iorder, n,         vmags  );
#### Restrictions
       None.
#### Literature_References
       None.
#### Author_and_Institution
       N.J. Bachman    (JPL)
       I.M. Underwood  (JPL)
#### Version
       -CSPICE Version 1.0.0, 08-JUL-2002 (NJB) (IMU)
#### Index_Entries
       order of a d.p. array
#### Link to routine orderd_c source file orderd_c.c

    Thu Apr 16 08:58:45 2009