Table of contents
CSPICE_INSRTI inserts an item into an integer set.
Given:
item an item which is to be inserted into the specified set.
help, item
LONG = Scalar or LONG = Array[N]
`item' may or may not already be an element of the set.
a a SPICE set.
help, a
STRUCT = cspice_celli(N)
The user must create `a' using cspice_celli.
On input, `a' may or may not contain the input item as an
element.
the call:
cspice_insrti, item, a
returns:
a on output, contains the union of the input set and the singleton
set containing the input item, unless there was not sufficient
room in the set for the item to be included, in which case the
set is not changed and an error is returned.
help, a
STRUCT = cspice_celli(N)
None.
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.
1) Create an integer set for ten elements and insert items
to it.
Example code begins here.
PRO insrti_ex1
;;
;; Create a cell for ten elements.
;;
SIZE = 10
a = cspice_celli( SIZE )
;;
;; Add an item to the new set
;;
cspice_insrti, 34, a
;;
;; Now insert a list of items.
;;
items = [ 0, 1, 1, 2, 3, 5, 8, 13, 21 ]
cspice_insrti, items, a
;;
;; Output the contents of `a'. Recall
;; set data begins at `a.base[ a.data + 0 ]'.
;;
print, 'Items in the set:'
for i=0, cspice_card(a)-1 do begin
print, FORMAT='(I6,$)', a.base[ a.data + i]
endfor
print, ' '
END
When this program was executed on a Mac/Intel/IDL8.x/64-bit
platform, the output was:
Items in the set:
0 1 2 3 5 8 13 21 34
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.
1) If the insertion of the element into the set causes an excess
of elements, the error SPICE(SETEXCESS) is signaled by a
routine in the call tree of this routine.
2) If any of the input arguments, `item' or `a', is undefined, an
error is signaled by the IDL error handling system.
3) If any of the input arguments, `item' or `a', is not of the
expected type, or it does not have the expected dimensions and
size, an error is signaled by the Icy interface.
None.
None.
ICY.REQ
SETS.REQ
None.
J. Diaz del Rio (ODC Space)
E.D. Wright (JPL)
-Icy Version 1.1.0, 24-AUG-2021 (JDR)
Added arguments' type and size information in the -I/O section.
Changed the argument name "set" to "a" for consistency with
other routines.
Edited the header to comply with NAIF standard. Added example's
problem statement and reformatted example's output.
Added -Parameters, -Exceptions, -Files, -Restrictions,
-Literature_References and -Author_and_Institution sections.
Removed reference to the routine's corresponding CSPICE header from
-Abstract section.
-Icy Version 1.0.1, 28-SEP-2006 (EDW)
Corrections to English.
-Icy Version 1.0.0, 12-AUG-2005 (EDW)
insert an item into an integer set
|