~ubuntu-branches/ubuntu/feisty/petsc/feisty

« back to all changes in this revision

Viewing changes to src/sys/src/adic/adintrinsics/adintr_frexp.c

  • Committer: Bazaar Package Importer
  • Author(s): Adam C. Powell, IV
  • Date: 2005-03-24 09:46:23 UTC
  • mfrom: (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050324094623-dfcxn8bltjms2cqq
Tags: 2.2.0-4
* Update for new mpich >> 1.2.5.3-2.
* Fixed src/inline/axpy.h for complex and UNROLL (closes: #284023, #293011).
* Added -fno-strict-aliasing to compile flags (closes: #274009).
* Switched SLES stuff to KSP in petsc.m4 (closes: 267796).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
  macro expansion:
 
3
  function_driver -> adintr_frexp
 
4
  exception number -> ADINTR_FREXP
 
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
/* The fy must be on a line by itself to be removed for funcs like sin(x). */
 
21
void
 
22
adintr_frexp (int deriv_order, int file_number, int line_number,
 
23
                 double*fx, double*fy,...)
 
24
{
 
25
     /* Hack to make assignments to (*fxx) et alia OK, regardless */
 
26
     double scratch;
 
27
     double *fxx = &scratch;
 
28
     double *fxy = &scratch;
 
29
     double *fyy = &scratch;
 
30
 
 
31
     const int exception = ADINTR_FREXP;
 
32
 
 
33
     va_list argptr;
 
34
     va_start(argptr,fy);
 
35
 
 
36
     if (deriv_order == 2)
 
37
     {
 
38
          fxx = va_arg(argptr, double *);
 
39
          fxy = va_arg(argptr, double *);
 
40
          fyy = va_arg(argptr, double *);
 
41
     }
 
42
 
 
43
     /* Here is where exceptional partials should be set. */
 
44
     *fxx = ADIntr_Partials[ADINTR_FREXP][ADINTR_FXX];
 
45
     *fxy = ADIntr_Partials[ADINTR_FREXP][ADINTR_FXY];
 
46
     *fyy = ADIntr_Partials[ADINTR_FREXP][ADINTR_FYY];
 
47
 
 
48
 
 
49
     /* Here is where we perform the action appropriate to the current mode. */
 
50
     if (ADIntr_Mode == ADINTR_REPORTONCE)
 
51
     {
 
52
          reportonce_accumulate(file_number, line_number, exception);
 
53
     }
 
54
     
 
55
     va_end(argptr);
 
56
}
 
57
#if defined(__cplusplus)
 
58
}
 
59
#endif
 
60