- Abstract
Determine whether an item is an element of an integer set.
- Required_Reading
SETS
- Brief_I/O
VARIABLE I/O DESCRIPTION
-------- --- --------------------------------------------------
item I Item to be tested.
set I Set to be tested.
The function returns SPICETRUE if item is an element of set.
- Detailed_Input
item is an item which may or may not be an element of
the input set.
set is a CSPICE set. set must be declared as an integer
SpiceCell.
- Detailed_Output
The function returns SPICETRUE if item is a member of the set,
and returns SPICEFALSE otherwise.
- Parameters
None.
- Particulars
This routine uses a binary search to check for the presence in the set
of the specified item.
- Examples
Let set contain the elements
{ -1, 0, 1, 3, 5 }
The the following expressions have the value SPICETRUE
elemi_c ( -1, &set )
elemi_c ( 0, &set )
elemi_c ( 3, &set )
and the following expressions have the value SPICEFALSE
elemi_c ( -2, &set )
elemi_c ( 2, &set )
elemi_c ( 6, &set )
- Restrictions
None.
- Exceptions
1) If the input set argument does not qualify as a CSPICE set,
the error SPICE(NOTASET) will be signaled. CSPICE sets have
their data elements sorted in increasing order and contain
no duplicate data elements.
2) If the input set does not have integer data type, the error
SPICE(TYPEMISMATCH will be signaled.
- Files
None.
- Author_and_Institution
N.J. Bachman (JPL)
C.A. Curzon (JPL)
H.A. Neilan (JPL)
W.L. Taber (JPL)
I.M. Underwood (JPL)
- Literature_References
None.
- Version
-CSPICE Version 1.0.0, 07-AUG-2002 (NJB) (CAC) (HAN) (WLT) (IMU)
- Index_Entries
element of an integer set
- Link to routine source