Index Page
elemi_c
A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X 

Procedure
Abstract
Required_Reading
Keywords
Brief_I/O
Detailed_Input
Detailed_Output
Parameters
Exceptions
Files
Particulars
Examples
Restrictions
Literature_References
Author_and_Institution
Version
Index_Entries

Procedure

   SpiceBoolean elemi_c ( SpiceInt        item,
                          SpiceCell     * set   )

Abstract

 
   Determine whether an item is an element of an integer set. 
 

Required_Reading

 
   SETS 
 

Keywords

 
   CELLS, 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. 
 

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. 
 

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. 
 

Literature_References

 
   None. 
 

Author_and_Institution

 
   N.J. Bachman    (JPL) 
   C.A. Curzon     (JPL) 
   H.A. Neilan     (JPL) 
   W.L. Taber      (JPL) 
   I.M. Underwood  (JPL) 
 

Version

 
   -CSPICE Version 1.0.0, 07-AUG-2002 (NJB) (CAC) (HAN) (WLT) (IMU)

Index_Entries

 
   element of an integer set 
 

Link to routine elemi_c source file elemi_c.c

Wed Apr  5 17:54:34 2017