Index Page
cspice_insrtd
A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X 

Abstract
I/O
Examples
Particulars
Required Reading
Version
Index_Entries

Abstract


   CSPICE_INSRTD inserts an item into a double precision set.

   For important details concerning this module's function, please refer to
   the CSPICE routine insrtd_c.

I/O

   
   Given:

      item   is a double precision item or N-vector of items to insert  
             into the specified set.

             Note: when adding multiple items to 'set', pass the routine
             a vector instead of using a loop to insert one element 
             at a time.

      set    is an Icy set. The user must create 'set' using
             cspice_celld. 

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

   the call:
   
      cspice_insrtd, item, set
   
   returns:
   
      set   on output contains the union of the input 'set' and
            input 'item'. If the 'item' is not an element of
            'set', the set is not changed.
   

Examples


   Any numerical results shown for this example may differ between
   platforms as the results depend on the SPICE kernels used as input
   and the machine specific arithmetic implementation.

      ;;
      ;; Create a cell for ten elements.
      ;;
      SIZE = 10

      set = cspice_celld( SIZE )

      ;;
      ;; Add an item to the new set
      ;;
      cspice_insrtd, 34.d, set

      ;;
      ;; Now insert a list of items.
      ;;
      items = [ 0.d, 1.d, 1.d, 2.d, 3.d, 5.d, 8.d, 13.d, 21.d ]

      cspice_insrtd, items, set

      ;;
      ;; Output the contents of 'set'. Recall
      ;; set data begins at 'set.base[ set.data + 0 ]'.
      ;;
      for i=0, cspice_card(set)-1 do begin
         print, set.base[ set.data + i]
      endfor 

   IDL outputs:
   
       0.0000000
       1.0000000
       2.0000000
       3.0000000
       5.0000000
       8.0000000
       13.000000
       21.000000
       34.000000

Particulars


   The user must create any needed cell structures with cspice_celld
   or cspice_celli prior to use regardless of whether the routine 
   uses the cell as input or returns it as output.

Required Reading


   ICY.REQ
   SETS.REQ

Version


   -Icy Version 1.0.1, 28-SEP-2006, EDW (JPL)

      Corrections to English.

   -Icy Version 1.0.0, 12-AUG-2005, EDW (JPL)


Index_Entries

 
   insert an item into a d.p. set 
 



Wed Apr  5 17:58:02 2017