SpiceBoolean elemi_c ( SpiceInt item,
SpiceCell * set )
Determine whether an item is an element of an integer set.
SETS
CELLS, SETS
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.
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.
The function returns SPICETRUE if item is a member of the set,
and returns SPICEFALSE otherwise.
None.
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.
None.
This routine uses a binary search to check for the presence in the set
of the specified item.
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 )
None.
None.
N.J. Bachman (JPL)
C.A. Curzon (JPL)
H.A. Neilan (JPL)
W.L. Taber (JPL)
I.M. Underwood (JPL)
-CSPICE Version 1.0.0, 07-AUG-2002 (NJB) (CAC) (HAN) (WLT) (IMU)
element of an integer set
Link to routine elemi_c source file elemi_c.c
|