コード例 #1
0
   int zzadrefn_c ( doublereal  * t1, 
                    doublereal  * t2, 
                    logical     * s1, 
                    logical     * s2, 
                    doublereal  * t   )

/*

-Brief_I/O
 
   VARIABLE  I/O  DESCRIPTION 
   --------  ---  -------------------------------------------------- 
   t1         I   One of two times bracketing a state change. 
   t2         I   The other time that brackets a state change. 
   s1         I   State at t1.
   s2         I   State at t2.
   t          O   New time at which to check for transition.
 
-Detailed_Input
 
   t1         One of two times bracketing a state change. 
              `t1' is expressed as seconds past J2000 TDB.  

   t2         The other time that brackets a state change. 
              `t2' is expressed as seconds past J2000 TDB.  
 
   n1         Number of times state state of interest 
              matched the value at t1.
 
   n2         Number of times state state of interest 
              matched the value at t2.
 
-Detailed_Output
 
   t          is the value returned by the stored, passed-in
              refinement function. 
 
-Parameters
 
   None. 
 
-Exceptions

   1) A run-time error will result if this routine is called before
      a valid pointer to a CSPICE-style GF refinement function has
      been stored via a call to zzadsave_c.

      The argument list of the stored function must match that of
      gfrefn_c.
  
-Files
 
   None. 
 
-Particulars
 
   This routine is meant to be passed to f2c'd Fortran GF code
   that requires a refinement function input argument. The argument
   list of this routine matches that of the f2c'd routine

      gfrefn_

   This routine calls the CSPICE-style refinement function passed
   into a CSPICE wrapper for an intermediate-level GF function.
   A pointer to this refinement function must be stored via
   a call to zzadsave_c before this routine is called.
 
-Examples
 
    None. 
 
-Restrictions
 
    No errors are returned by this routine. 
 
-Literature_References
 
   None. 
 
-Author_and_Institution
 
   N.J. Bachman   (JPL)
 
-Version
    
   -CSPICE Version 1.0.0, 09-MAR-2009 (NJB)

-Index_Entries
 
   adapter for gf refinement function
 
-&
*/

{ /* Begin zzadrefn_c */

   
   /*
   Local variables 
   */
   SpiceBoolean            bs1;
   SpiceBoolean            bs2;

   void                ( * fPtr ) ( SpiceDouble,
                                    SpiceDouble,
                                    SpiceBoolean,
                                    SpiceBoolean,
                                    SpiceDouble * );

   /*
   Participate in error tracing.
   */
   if ( return_c() )
   {
      return ( 0 );
   }
   chkin_c ( "zzadrefn_c" );


   /*
   Retrieve the stored pointer for the passed-in function; cast
   the pointer from (void *) to that of a function whose argument
   list matches that of gfrefn_c.
   */

   fPtr = (  void (*) ( SpiceDouble, 
                        SpiceDouble,
                        SpiceBoolean,
                        SpiceBoolean,
                        SpiceDouble * )  )   zzadget_c ( UDREFN );

   /*
   Call the stored function. 
   */
   
   bs1 = (SpiceBoolean) (*s1);
   bs2 = (SpiceBoolean) (*s2);

   (*fPtr) ( (SpiceDouble  ) (*t1),
             (SpiceDouble  ) (*t2),
             bs1,
             bs2,
             (SpiceDouble *) t       );


   chkout_c ( "zzadrefn_c" );

   return ( 0 );


} /* End zzadrefn_c */
コード例 #2
0
ファイル: zzadstep_c.c プロジェクト: Dbelsa/coft
   int zzadstep_c ( doublereal  * time,
                    doublereal  * step  ) 

/*

-Brief_I/O
 
   VARIABLE  I/O  DESCRIPTION 
   --------  ---  -------------------------------------------------- 
   time       I   Time from which the next step will be taken. 
   step       O   Time step to take. 
 
-Detailed_Input
  
   time     is the input start time from which the algorithm is to
            search forward for a state transition. `time' is expressed
            as seconds past J2000 TDB.  
 

-Detailed_Output  
 
   step     is the output step size. `step' is the value stored via the
            last call to gfsstp_c. Units are TDB seconds.
 
-Parameters
 
   None. 
 
-Exceptions
 
   1) A run-time error will result if this routine is called before
      a valid pointer to a CSPICE-style GF step size function has
      been stored via a call to zzadsave_c.

      The argument list of the stored function must match that of
      gfstep_c.
 
-Files
 
   None. 
 
-Particulars
 
   This routine is meant to be passed to f2c'd Fortran GF code
   that requires a step size function input argument. The argument
   list of this routine matches that of the f2c'd routine

      gfstep_

   This routine calls the CSPICE-style stepsize function passed
   into a CSPICE wrapper for an intermediate-level GF function.
   A pointer to this step size function must be stored via
   a call to zzadsave_c before this routine is called.

   When set properly, `step' indicates how far to advance `time' so
   that `time' and `time+step' may bracket a state transition and
   definitely do not bracket more than one state transition.

   The calling application can change the step size value via the entry
   point gfsstp_c.
 
-Examples
 
   None. 
 
-Restrictions
 
   1) This function is intended only for internal use by GF routines.   
 
-Literature_References
 
   None. 
 
-Author_and_Institution
 
   N.J. Bachman   (JPL)
   L.S. Elson     (JPL)
   W.L. Taber     (JPL) 
   I.M. Underwood (JPL) 
   E.D. Wright    (JPL)  
 
-Version
 
   -CSPICE Version 1.0.0, 24-MAR-2008 (NJB)

-Index_Entries
 
   adapter for gf step size function
 

-&
*/

{ /* Begin zzadstep_c */


   /*
   Local variables 
   */
   void           ( * fPtr ) ( SpiceDouble,
                               SpiceDouble * );


   /*
   Participate in error tracing.
   */

   if ( return_c() )
   {
      return ( 0 );
   }
   chkin_c ( "zzadstep_c" );

   /*
   Retrieve the stored pointer for the passed-in function; cast
   the pointer from (void *) to that of a function whose argument
   list matches that of gfstep_c.
   */

   fPtr = (  void (*) (SpiceDouble, SpiceDouble*)  )  zzadget_c ( UDSTEP );

   /*
   Call the stored function. 
   */
   
   (*fPtr) ( (SpiceDouble)(*time), (SpiceDouble *)step );


   chkout_c ( "zzadstep_c" );

   return ( 0 );

} /* End zzadstep_c */
コード例 #3
0
   int zzadqdec_c ( U_fp           udfunc,
                    doublereal   * et,
                    logical      * xbool )

/*

-Brief_I/O
 
   VARIABLE  I/O  DESCRIPTION 
   --------  ---  -------------------------------------------------- 
   udfunc     I   Name of scalar function of interest.
   et         I   Epoch of interest in TDB seconds. 
   xbool      O   Boolean value at `et'.
 
-Detailed_Input

   udfunc     the name of the external routine that returns the
              value of the scalar quantity of interest at time `et'.

   et         a double precision value representing
              ephemeris time, expressed as seconds past
              J2000 TDB, at which to evaluate "udfunb."

-Detailed_Output  

   xbool      the value of the boolean quantity function at `et'.

-Parameters
 
   None. 
 
-Exceptions
 
   1) A run-time error will result if this routine is called before
      a valid pointer to a CSPICE-style function has been stored via
      a call to zzadqdec_c.

      The argument list of the stored function must match that of
      udqdec (refer to gfuds_c.c).
 
-Files
 
   None. 
 
-Particulars
 
   This routine is meant to be passed to f2c'd Fortran GF code that
   requires a derivative sign test function as an argument.

   This routine calls the CSPICE-style derivative test function
   passed to a CSPICE wrapper for use by an intermediate-level GF
   function. A pointer to this function must be stored via a call 
   to zzadsave_c before this routine is called.
 
-Examples
 
   None. 
 
-Restrictions
 
   1) This function is intended only for internal use by GF routines.   
 
-Literature_References
 
   None. 
 
-Author_and_Institution
 
   N.J. Bachman   (JPL)
   L.S. Elson     (JPL)
   W.L. Taber     (JPL) 
   I.M. Underwood (JPL) 
   E.D. Wright    (JPL)  
 
-Version

   -CSPICE Version 2.0.0, 23-OCT-2013 (EDW)

 
   -CSPICE Version 1.0.0, 21-DEC-2008 (EDW)

-Index_Entries
 
   adapter for gf user defined boolean quantity

-&
*/

   { /* Begin zzadqdec_c */

   /*
   Local variables 
   */
   void           ( * fPtr ) ( void ( * ) ( SpiceDouble,
                                            SpiceDouble  *),
                               SpiceDouble,
                               SpiceBoolean * );

   void           ( * fPtr2) ( SpiceDouble,
                               SpiceDouble * );

   SpiceBoolean       bool_loc;

   /*
   Participate in error tracing.
   */

   if ( return_c() )
      {
      return ( 0 );
      }
   chkin_c ( "zzadqdec_c" );

   /*
   Retrieve the stored pointer for the passed-in function; cast
   the pointer from (void *) to that of a function whose argument
   list matches that of "udqdec."
   */
   fPtr = ( void (*) ( void ( * ) ( SpiceDouble, SpiceDouble  *),
                       SpiceDouble, 
                       SpiceBoolean*) ) zzadget_c ( UDQDEC );

   /*
   Retrieve the stored pointer for the user defined scalar function. The
   'udfunc' pointer passed to zzadqdec_c as an argument corresponds to 
   the adapter for the scalar function, but the function pointer 
   argument in 'fPtr' requires the non-adapter pointer. Ignore 'udfunc'.
   */
   fPtr2= ( void (*) (SpiceDouble, SpiceDouble*) ) zzadget_c ( UDFUNC );

   /*
   Call the stored function. 
   */
   (*fPtr) ( fPtr2, (SpiceDouble)(*et), (SpiceBoolean *) &bool_loc );

   /*
   Cast the "SpiceBoolean" to "logical" to prevent any future size mismatches
   or compiler warnings.
   */
   *xbool = (logical) bool_loc;

   chkout_c ( "zzadqdec_c" );

   return ( 0 );

   } /* End zzadqdec_c */