Table of contents
CSPICE_INSRTD inserts an item into a double precision set.
Given:
item an item which is to be inserted into the specified set.
help, item
DOUBLE = Scalar or DOUBLE = Array[N]
`item' may or may not already be an element of the set.
a a SPICE set.
help, a
STRUCT = cspice_celld(N)
The user must create `a' using cspice_celld.
On input, `a' may or may not contain the input item as an
element.
the call:
cspice_insrtd, 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 signaled.
help, a
STRUCT = cspice_celld(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 a double precision set for ten elements and insert items
to it.
Example code begins here.
PRO insrtd_ex1
;;
;; Create a cell for ten elements.
;;
SIZE = 10
a = cspice_celld( SIZE )
;;
;; Add an item to the new set
;;
cspice_insrtd, 21.0, a
;;
;; Insert the list of double precision numbers into the
;; set. If the item is an element of the set, the set is
;; not changed.
;;
items = [ 0.d, 1.d, 1.d, 2.d, 3.d, 5.d, 8.d, 13.d, 21.d, 31.d ]
cspice_insrtd, items, a
;;
;; Output the original 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='(F6.1,$)', 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.0 1.0 2.0 3.0 5.0 8.0 13.0 21.0 31.0
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)
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.
Added arguments' type and size information in the -I/O 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 a d.p. set
|