Index Page
insrtd_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 insrtd_c ( SpiceDouble     item,
                   SpiceCell     * set  )

Abstract

 
   Insert an item into a double precision set. 
 

Required_Reading

 
   SETS 
 

Keywords

 
   CELLS, SETS 
 

Brief_I/O

 
   VARIABLE  I/O  DESCRIPTION 
   --------  ---  -------------------------------------------------- 
   item       I   Item to be inserted. 
   set       I/O  Insertion set. 
 

Detailed_Input

 
   item        is an item which is to be inserted into the 
               specified set. item may or may not already 
               be an element of the set. 


   set         is a CSPICE set.  set must be declared as a double
               precision SpiceCell. 

               On input, set  may or may not contain the input item 
               as an element. 
 

Detailed_Output

   set         on output contains the union of the input set and 
               the singleton set containing the input item.
 

Parameters

 
   None. 
 

Exceptions

 
   1) If the input set argument is a SpiceCell of type other than
      double precision, the error SPICE(TYPEMISMATCH) is signaled.

   2) If the insertion of the element into the set causes an excess 
      of elements, the error SPICE(SETEXCESS) is signaled. 
 
   3) If the input set argument does not qualify as a CSPICE set, 
      the error SPICE(NOTASET) will be signaled.  CSPICE sets have
      their data elements sorted in increasing order and contain
      no duplicate data elements.

Files

 
   None. 
 

Particulars

 
   None. 
 

Examples

 
   1) In the following code fragment, a list of camera exposure
      durations are taken from the array expList and inserted into the
      set expDur.


         #include "SpiceUsr.h"
                .
                .
                .
         /.
         The number of list items is NLIST.
         ./
         SpiceDouble        expList[NLIST] = 
                            { 
                               0.5, 2.0, 0.5, 30.0, 0.01, 30.0 
                            };

         /.
         Declare the set with maximum number of elements MAXSIZ.
         ./
         SPICEDOUBLE_CELL ( expDur,   MAXSIZ );
                .
                .
                .
         for ( i = 0;  i < NLIST;  i++ )
         {
            insrtd_c ( expList[i], &expDur );
         }
        
         /.
         At this point expDur contains the set

           { 0.01, 0.5, 2.0, 30.0 }

         ./

Restrictions

 
   None. 

Literature_References

 
   None. 
 

Author_and_Institution

 
   N.J. Bachman    (JPL) 
   C.A. Curzon     (JPL) 
   W.L. Taber      (JPL) 
   I.M. Underwood  (JPL) 
 

Version

 
   -CSPICE Version 2.0.0, 01-NOV-2005 (NJB)

       Long error message was updated to include size of
       set into which insertion was attempted.

   -CSPICE Version 1.0.0, 07-AUG-2002 (NJB) (CAC) (WLT) (IMU)

Index_Entries

 
   insert an item into a d.p. set 
 
Wed Apr  5 17:54:37 2017