Index Page
cspice_insrti
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_INSRTI inserts an item into an integer set.

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

I/O

   
   Given:

      item   is an integer item or N-vector of items to insert into the 
             specified set. 

             Note: when adding multiple items to s 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_celli. 

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

   the call:
   
      cspice_insrti, item, set
   
   returns:
   
      set   on output contains the union of the input 'set' and 
            the input 'item'.

   

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_celli( SIZE )

      ;;
      ;; Add an item to the new set
      ;;
      cspice_insrti, 34, set

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

      cspice_insrti, 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
           1
           2
           3
           5
           8
          13
          21
          34

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 an integer set 
 



Wed Apr  5 17:58:02 2017