~ubuntu-branches/ubuntu/warty/petsc/warty

« back to all changes in this revision

Viewing changes to src/contrib/adic/adintrinsics/adintr_exp.c

  • Committer: Bazaar Package Importer
  • Author(s): Adam C. Powell, IV
  • Date: 2004-06-07 13:41:43 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040607134143-92p586zrauvie0le
Tags: 2.2.0-2
* Upstream patch level 2.
* New PETSC_BOPT_EXTRA option for different BOPT and lib names, with _c++
  symlinks only for plain and single (closes: #249617).
* New DEBIAN_DIST=contrib option to link with hypre, parmetis (closes:
  #249619).
* Combined petsc-c and petsc-fortran substvars into petsc-compilers.
* Extra quote in -dev prerm eliminates "too many arguments" problem.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
  macro expansion:
3
 
  function_driver -> adintr_exp
4
 
  exception number -> ADINTR_EXP
5
 
  exceptional code -> 
6
 
 
7
 
  */
8
 
 
9
 
#include <stdarg.h>
10
 
#include "adintrinsics.h"
11
 
#include "knr-compat.h"
12
 
#if defined(__cplusplus)
13
 
extern "C" {
14
 
#endif
15
 
 
16
 
/* #include "report-once.h" */
17
 
void reportonce_accumulate Proto((int,int,int));
18
 
 
19
 
 
20
 
void
21
 
adintr_exp (int deriv_order, int file_number, int line_number,
22
 
                 double*fx,...)
23
 
{
24
 
     /* Hack to make assignments to (*fxx) et alia OK, regardless */
25
 
     double scratch;
26
 
     double *fxx = &scratch;
27
 
 
28
 
     const int exception = ADINTR_EXP;
29
 
 
30
 
     va_list argptr;
31
 
     va_start(argptr,fx);
32
 
 
33
 
     if (deriv_order == 2)
34
 
     {
35
 
          fxx = va_arg(argptr, double *);
36
 
     }
37
 
 
38
 
     /* Here is where exceptional partials should be set. */
39
 
     *fxx = ADIntr_Partials[ADINTR_EXP][ADINTR_FXX];
40
 
 
41
 
     /* Here is where we perform the action appropriate to the current mode. */
42
 
     if (ADIntr_Mode == ADINTR_REPORTONCE)
43
 
     {
44
 
          reportonce_accumulate(file_number, line_number, exception);
45
 
     }
46
 
     
47
 
     va_end(argptr);
48
 
}
49
 
#if defined(__cplusplus)
50
 
}
51
 
#endif
52