Table of contents
CSPICE_REMOVD removes an item from a double precision set.
Given:
item a double precision item or N-vector of items to remove from the
specified set.
help, item
DOUBLE = Scalar or DOUBLE = Array[N]
`item' may or may not already be an element of the set.
Note: when deleting multiple items from `a', pass the routine
a vector instead of using a loop to delete one element
at a time.
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_removd, items, a
returns:
a on output, contains the difference of input `a' and input
`item'.
help, a
STRUCT = cspice_celld(N)
If the item is not an element of `a', the set is not changed.
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, insert items
to it and then remove the even values.
Example code begins here.
PRO removd_ex1
;;
;; Create a cell for ten elements.
;;
SIZE = 10
a = cspice_celld( SIZE )
;;
;; 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 ]
cspice_insrtd, items, a
;;
;; Output the original contents of `a'. Recall
;; set data begins at `a.base[ a.data + 0 ]'.
;;
print, 'Items in original set A:'
for i=0, cspice_card(a)-1 do begin
print, FORMAT='(F6.1,$)', a.base[ a.data + i]
endfor
print, ' '
;;
;; Remove the even values. If the item is not an element of
;; the set, the set is not changed.
;;
items = [ 0.d, 2.d, 4.d, 6.d, 8.d, 12.d ]
cspice_removd, items, a
;;
;; Output the contents of `a'. Recall
;; set data begins at `a.base[ a.data + 0 ]'.
;;
print, 'Odd numbers in set A:'
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 original set A:
0.0 1.0 2.0 3.0 5.0 8.0 13.0 21.0
Odd numbers in set A:
1.0 3.0 5.0 13.0 21.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 input set `a' has invalid cardinality, an error is
signaled by a routine in the call tree of this routine.
2) If the input set `a' has invalid size, an error is signaled by a
routine in the call tree of this routine.
3) The data values in set `a' must be monotone strictly increasing.
This is not checked. If this condition is not met, the results
are unpredictable.
4) If any of the input arguments, `item' or `a', is undefined, an
error is signaled by the IDL error handling system.
5) 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
CELLS.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 -Examples section 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.
Correct Required Reading citation cell.req to cells.req.
-Icy Version 1.0.0, 21-FEB-2005 (EDW)
remove an item from a d.p. set
|