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

Table of contents
Abstract
I/O
Parameters
Examples
Particulars
Exceptions
Files
Restrictions
Required_Reading
Literature_References
Author_and_Institution
Version
Index_Entries


Abstract


   CSPICE_WNRELD compares two double precision windows.

I/O


   Given:

      a,
      b        two SPICE windows, each of which contains zero or more
               intervals.

               help, a
                  STRUCT = cspice_celld(2*N)
               help, b
                  STRUCT = cspice_celld(2*M)

               The user must create `a' and `b' using cspice_celld.

      op       a comparison operator, indicating the way in which the input
               sets are to be compared.

               help, op
                  STRING = Scalar

               `op' may be any of the following:

                  Operator             Meaning
                  --------  -------------------------------------------
                    '='     a = b is True if `a' and `b' are equal
                            (contain the same intervals).

                    '<>'    a <> b is True if `a' and `b' are not equal.

                    '<='    a <= b is True if `a' is a subset of `b'.

                    '<'     a < b is True if `a' is a proper subset
                            of `b'.

                    '>='    a >= b is True if `b' is a subset of `a'.

                    '>'     a > b is True if `b' is a proper subset
                            of `a'.

   the call:

      wnreld = cspice_wnreld( a, op, b )

   returns:

      wnreld   the result of the comparison.

               help, wnreld
                  BOOLEAN = Scalar

Parameters


   None.

Examples


   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) Let `a' contain the intervals

         [ 1, 3 ]  [ 7, 11 ]  [ 23, 27 ]

      and `b' contain the intervals

         [ 1, 2 ]  [ 9, 9 ]   [ 24, 27 ]

      Compare `a' and `b' and find out if `a' and `'b are equal or not,
      if `a' is a subset or a proper subset of `b', or if `b' is a
      subset or a proper subset of `a'.

      Example code begins here.


      PRO wnreld_ex1

         ;;
         ;; Create a cell containing a double precision
         ;; 8-vector.
         ;;
         win1 = cspice_celld( 8 )
         win2 = cspice_celld( 8 )

         ;;
         ;; Define two window with three intervals.
         ;;
         darray = [ [ 1.d, 3.0], [ 7.0, 11.0], [23.0, 27.0] ]

         ;;
         ;; Add the window data to the cell.
         ;;
         for i=0, 2 do begin

            cspice_wninsd, darray[0,i], darray[1,i], win1

         endfor

        darray = [ [ 1.d, 2.0], [ 9.0, 9.0], [24.0, 27.0] ]

         ;;
         ;; Add the window data to the cell.
         ;;
         for i=0, 2 do begin

            cspice_wninsd, darray[0,i], darray[1,i], win2

         endfor

         ops = [ '=', '<>', '<=', '<', '>=', '>' ]

         ;;
         ;; Loop over each operation token in 'ops', apply that
         ;; operation to 'win1' and 'win2'.
         ;;
         for i=0, n_elements(ops) -1 do begin

           if( cspice_wnreld( win1, ops[i], win2 ) ) then begin

               print, "`a' ", ops[i], " `b' is True"

            endif else begin

               print, "`a' ", ops[i], " `b' is False"

            endelse

         endfor

      END


      When this program was executed on a Mac/Intel/IDL8.x/64-bit
      platform, the output was:


      `a' = `b' is False
      `a' <> `b' is True
      `a' <= `b' is False
      `a' < `b' is False
      `a' >= `b' is True
      `a' > `b' is True


Particulars


   The user must create any needed window structures with
   cspice_celld prior to use regardless of whether the routine
   uses the window as input or returns it as output.

   This function returns True whenever the specified relationship
   between the input windows `a' and `b' is satisfied. For example,
   the expression

      cspice_wnreld ( needed, '<=', avail )

   is True whenever the window `needed' is a subset of the window
   `avail'. One window is a subset of another window if each of
   the intervals in the first window is included in one of the
   intervals in the second window. In addition, the first window
   is a proper subset of the second if the second window contains
   at least one point not contained in the first window. (Thus,
   '<' implies '<=', and '>' implies '>='.)

   The following pairs of expressions are equivalent.

      cspice_wnreld ( a, '>',  b )
      cspice_wnreld ( b, '<',  a )

      cspice_wnreld ( a, '>=', b )
      cspice_wnreld ( b, '<=', a )

Exceptions


   1)  If the relational operator is not recognized, the error
       SPICE(INVALIDOPERATION) is signaled by a routine in the call
       tree of this routine.

   2)  The cardinality of the input windows must be even. Left
       endpoints of stored intervals must be strictly greater than
       preceding right endpoints. Right endpoints must be greater
       than or equal to corresponding left endpoints. Invalid window
       data are not diagnosed by this routine and may lead to
       unpredictable results.

   3)  If any of the input arguments, `a', `op' or `b', is undefined,
       an error is signaled by the IDL error handling system.

   4)  If any of the input arguments, `a', `op' or `b', is not of the
       expected type, or it does not have the expected dimensions and
       size, an error is signaled by the Icy interface.

Files


   None.

Restrictions


   None.

Required_Reading


   ICY.REQ
   CELLS.REQ
   WINDOWS.REQ

Literature_References


   None.

Author_and_Institution


   J. Diaz del Rio     (ODC Space)
   E.D. Wright         (JPL)

Version


   -Icy Version 1.0.2, 24-AUG-2021 (JDR)

       Added arguments' type and size information in the -I/O section.

       Edited the header to comply with NAIF standard. Added
       example's problem statement and reformatted example's output.

       Extended -Particulars section.

       Added -Parameters, -Exceptions, -Files, -Restrictions,
       -Literature_References and -Author_and_Institution sections.

       Removed reference to the routine's corresponding CSPICE header from
       -Abstract section.

   -Icy Version 1.0.1, 12-SEP-2006 (EDW)

      Correct Required Reading citation cell.req to cells.req.

   -Icy Version 1.0.0, 08-AUG-2004 (EDW)

Index_Entries


   compare two d.p. windows



Fri Dec 31 18:43:09 2021