Actual source code: adintr_ceil.c

petsc-3.3-p7 2013-05-11
  1: /*
  2:   macro expansion:
  3:   function_driver -> adintr_ceil
  4:   exception number -> ADINTR_CEIL
  5:   exceptional code -> 
  6: *fx = ADIntr_Partials[ADINTR_CEIL][ADINTR_FX];

  8:   */

 10: #include <stdarg.h>
 11: #include <adintrinsics.h>
 12: #include <knr-compat.h>
 13: #if defined(__cplusplus)
 14: extern "C" {
 15: #endif

 17: /* #include "report-once.h" */
 18: void reportonce_accumulate Proto((int,int,int));


 21: void
 22: adintr_ceil (int deriv_order, int file_number, int line_number,
 23:                  double*fx,...)
 24: {
 25:      /* Hack to make assignments to (*fxx) et alia OK, regardless */
 26:      double scratch;
 27:      double *fxx = &scratch;

 29:      const int exception = ADINTR_CEIL;

 31:      va_list argptr;
 32:      va_start(argptr,fx);

 34:      if (deriv_order == 2)
 35:      {
 36:           fxx = va_arg(argptr, double *);
 37:      }

 39:      /* Here is where exceptional partials should be set. */
 40:      *fx = ADIntr_Partials[ADINTR_CEIL][ADINTR_FX];
 41:      *fxx = ADIntr_Partials[ADINTR_CEIL][ADINTR_FXX];


 44:      /* Here is where we perform the action appropriate to the current mode. */
 45:      if (ADIntr_Mode == ADINTR_REPORTONCE)
 46:      {
 47:           reportonce_accumulate(file_number, line_number, exception);
 48:      }
 49: 
 50:      va_end(argptr);
 51: }
 52: #if defined(__cplusplus)
 53: }
 54: #endif