/[ascend]/trunk/base/generic/compiler/btprolog.h
ViewVC logotype

Diff of /trunk/base/generic/compiler/btprolog.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 53 by aw0a, Sat Nov 13 16:45:56 2004 UTC revision 54 by jds, Tue Aug 2 11:20:09 2005 UTC
# Line 29  Line 29 
29   *  the file named COPYING.   *  the file named COPYING.
30   */   */
31    
32  /*  /** @file
33   * prolog for C to be compiled and dynamically loaded to provide   *  Prolog for C to be compiled and dynamically loaded to provide
34   * residuals and gradients to token relations. This defines the   *  residuals and gradients to token relations. This defines the
35   * math functions ascend will provide after loading the   *  math functions ascend will provide after loading the
36   * necessary system headers.   *  necessary system headers.<br><br>
37   * Don't put anything in this prolog which requires access to   *
38   * other ascend sources. This header must be shipped with the   *  Don't put anything in this prolog which requires access to
39   * binary distribution in some lib directory.   *  other ASCEND sources. This header must be shipped with the
40     *  binary distribution in some lib directory.<br><br>
41   *   *
42   * bintoken.c also includes this so we maintain 1 definition   *  bintoken.c also includes this so we maintain 1 definition
43   * of our structs. bintoken.h must include it AFTER func.h   *  of our structs. bintoken.h must include it AFTER func.h
44   * in bintoken.c.   *  in bintoken.c.
45     *  <pre>
46     *  When #including btprolog.h, make sure these files are #included first:
47     *         #include "utilities/ascConfig.h"
48     *         #include "instance_enum.h"
49     *  <pre>
50     *
51     *  @todo Complete documentation of btprolog.h.
52   */   */
53    
54  #ifndef __BTPROLOG_H_SEEN__  #ifndef __BTPROLOG_H_SEEN__
55  #define __BTPROLOG_H_SEEN__  #define __BTPROLOG_H_SEEN__
56    
 #ifndef _ASCCONFIG_H /* then this is being used to build a dynamic library,  
                       * so we reverse the import/export definitions.  
                       */  
 #ifdef WIN32  
 /* two for use in this file */  
 #define DLEXPORT __declspec(dllimport)  
 #define DLIMPORT __declspec(dllexport)  
 /* two for use in the generated file */  
 #define IMPORT __declspec(dllimport)  
 #define EXPORT __declspec(dllexport)  
 #else /* not win32 */  
 /* four for use in either file when the operating system is not brain dead */  
 #define DLEXPORT  
 #define DLIMPORT  
 #define EXPORT  
 #define IMPORT  
 #endif /* WIN32 */  
 #endif /* _ASCCONFIG_H */  
   
57  #include <math.h>  #include <math.h>
58  #ifndef NULL  #ifndef NULL
59  #ifdef __alpha  #ifdef __alpha
# Line 76  Line 66 
66  #define BinTokenGRADIENT 0  #define BinTokenGRADIENT 0
67  #define BinTokenRESIDUAL 1  #define BinTokenRESIDUAL 1
68    
 /*  
  * residual evaluation function pointer.  
  * F(vars,resid);  
  * gradient evaluation function pointer.  
  * G(vars,grad,resid);  
  * F77 style interface code (if and big goto required inside)  
  * S(vars,grad,resid,ForG,bindex,status);  
  */  
69  #ifdef __STDC__  #ifdef __STDC__
70    /**  Residual evaluation function pointer.  F(vars,resid); */
71  typedef void (*BinTokenFPtr)(double *, double *);  typedef void (*BinTokenFPtr)(double *, double *);
72    /**  Gradient evaluation function pointer.  G(vars,grad,resid); */
73  typedef void (*BinTokenGPtr)(double *, double *, double *);  typedef void (*BinTokenGPtr)(double *, double *, double *);
74    /**
75     * F77 style interface code (if and big goto required inside).
76     * S(vars,grad,resid,ForG,bindex,status);
77     */
78  typedef void (*BinTokenSPtr)(double *, double *, double *, int *, int *, int *);  typedef void (*BinTokenSPtr)(double *, double *, double *, int *, int *, int *);
79  #else  #else
80    /**  Residual evaluation function pointer.  F(vars,resid); */
81  typedef void (*BinTokenFPtr)();  typedef void (*BinTokenFPtr)();
82    /**  Gradient evaluation function pointer.  G(vars,grad,resid); */
83  typedef void (*BinTokenGPtr)();  typedef void (*BinTokenGPtr)();
84    /**
85     * F77 style interface code (if and big goto required inside).
86     * S(vars,grad,resid,ForG,bindex,status);
87     */
88  typedef void (*BinTokenSPtr)();  typedef void (*BinTokenSPtr)();
89  #endif /* __STDC__ */  #endif /* __STDC__ */
90    
# Line 109  union TableUnion { Line 103  union TableUnion {
103  };  };
104    
105  #ifdef __STDC__  #ifdef __STDC__
106  extern int DLEXPORT ExportBinTokenCTable(struct TableC *, int);  extern int DLEXPORT ExportBinTokenCTable(struct TableC *t, int size);
107  #else  #else
108  extern int DLEXPORT ExportBinTokenCTable();  extern int DLEXPORT ExportBinTokenCTable();
109  #endif /* __STDC__ */  #endif /* __STDC__ */
# Line 127  extern int DLEXPORT ExportBinTokenCTable Line 121  extern int DLEXPORT ExportBinTokenCTable
121   * code: we aren't going to waste time reimplementing these basic   * code: we aren't going to waste time reimplementing these basic
122   * functions.   * functions.
123   */   */
124  extern double DLEXPORT cbrt(double);  extern double DLEXPORT cbrt(double x);
125  #ifdef HAVE_ERF  #ifdef HAVE_ERF
126  extern double DLEXPORT erf(double);  extern double DLEXPORT erf(double x);
127  #endif /* HAVE_ERF */  #endif /* HAVE_ERF */
128  #endif /* __STDC__ == 1 */  #endif /* __STDC__ == 1 */
129  /*  /*
130   * in the case where __STDC__ is defined but == 0, system headers   * in the case where __STDC__ is defined but == 0, system headers
131   * should provide cbrt, erf.   * should provide cbrt, erf.
132   */   */
133  extern int DLEXPORT ascnintF(double);  extern int DLEXPORT ascnintF(double x);
134  extern double DLEXPORT dln(double);  extern double DLEXPORT dln(double x);
135  extern double DLEXPORT dln2(double);  extern double DLEXPORT dln2(double x);
136  extern double DLEXPORT dlog(double);  extern double DLEXPORT dlog(double x);
137  extern double DLEXPORT dlog2(double);  extern double DLEXPORT dlog2(double x);
138  extern double DLEXPORT lnm(double);  extern double DLEXPORT lnm(double x);
139  extern double DLEXPORT dlnm(double);  extern double DLEXPORT dlnm(double x);
140  extern double DLEXPORT dlnm2(double);  extern double DLEXPORT dlnm2(double x);
141  extern double DLEXPORT dtanh(double);  extern double DLEXPORT dtanh(double x);
142  extern double DLEXPORT dtanh2(double);  extern double DLEXPORT dtanh2(double x);
143  extern double DLEXPORT arcsinh(double);  extern double DLEXPORT arcsinh(double x);
144  extern double DLEXPORT arccosh(double);  extern double DLEXPORT arccosh(double x);
145  extern double DLEXPORT arctanh(double);  extern double DLEXPORT arctanh(double x);
146  extern double DLEXPORT darcsinh(double);  extern double DLEXPORT darcsinh(double x);
147  extern double DLEXPORT darcsinh2(double);  extern double DLEXPORT darcsinh2(double x);
148  extern double DLEXPORT darccosh(double);  extern double DLEXPORT darccosh(double x);
149  extern double DLEXPORT darccosh2(double);  extern double DLEXPORT darccosh2(double x);
150  extern double DLEXPORT darctanh(double);  extern double DLEXPORT darctanh(double x);
151  extern double DLEXPORT darctanh2(double);  extern double DLEXPORT darctanh2(double x);
152  extern double DLEXPORT sqr(double);  extern double DLEXPORT sqr(double x);
153  extern double DLEXPORT dsqr(double);  extern double DLEXPORT dsqr(double x);
154  extern double DLEXPORT dsqr2(double);  extern double DLEXPORT dsqr2(double x);
155  extern double DLEXPORT cube(double);  extern double DLEXPORT cube(double x);
156  extern double DLEXPORT dcube(double);  extern double DLEXPORT dcube(double x);
157  extern double DLEXPORT dcube2(double);  extern double DLEXPORT dcube2(double x);
158  extern double DLEXPORT asc_ipow(double,int);  extern double DLEXPORT asc_ipow(double x, int y);
159  extern double DLEXPORT asc_d1ipow(double,int);  extern double DLEXPORT asc_d1ipow(double x, int y);
160  extern double DLEXPORT asc_d2ipow(double,int);  extern double DLEXPORT asc_d2ipow(double x, int y);
161  extern double DLEXPORT hold(double);  extern double DLEXPORT hold(double x);
162  extern double DLEXPORT dsqrt(double);  extern double DLEXPORT dsqrt(double x);
163  extern double DLEXPORT dsqrt2(double);  extern double DLEXPORT dsqrt2(double x);
164  extern double DLEXPORT dcbrt(double);  extern double DLEXPORT dcbrt(double x);
165  extern double DLEXPORT dcbrt2(double);  extern double DLEXPORT dcbrt2(double x);
166  extern double DLEXPORT dfabs(double);  extern double DLEXPORT dfabs(double x);
167  extern double DLEXPORT dfabs2(double);  extern double DLEXPORT dfabs2(double x);
168  extern double DLEXPORT dhold(double);  extern double DLEXPORT dhold(double x);
169  extern double DLEXPORT dasin(double);  extern double DLEXPORT dasin(double x);
170  extern double DLEXPORT dasin2(double);  extern double DLEXPORT dasin2(double x);
171  extern double DLEXPORT dcos(double);  extern double DLEXPORT dcos(double x);
172  extern double DLEXPORT dcos2(double);  extern double DLEXPORT dcos2(double x);
173  extern double DLEXPORT dacos(double);  extern double DLEXPORT dacos(double x);
174  extern double DLEXPORT dacos2(double);  extern double DLEXPORT dacos2(double x);
175  extern double DLEXPORT dtan(double);  extern double DLEXPORT dtan(double x);
176  extern double DLEXPORT dtan2(double);  extern double DLEXPORT dtan2(double x);
177  extern double DLEXPORT datan(double);  extern double DLEXPORT datan(double x);
178  extern double DLEXPORT datan2(double);  extern double DLEXPORT datan2(double x);
179  extern double DLEXPORT derf(double);  extern double DLEXPORT derf(double x);
180  extern double DLEXPORT derf2(double);  extern double DLEXPORT derf2(double x);
181    
182  #else /* no stdc */  #else /* no stdc */
183    
# Line 240  extern double DLEXPORT datan2(); Line 234  extern double DLEXPORT datan2();
234  extern double DLEXPORT derf();  extern double DLEXPORT derf();
235  extern double DLEXPORT derf2();  extern double DLEXPORT derf2();
236    
237  #endif /* no stdc */  #endif  /* no stdc */
238  #endif /* fake__FUNC_H_SEEN__ */  #endif  /* fake__FUNC_H_SEEN__ */
239  #endif /* __BTPROLOG_H_SEEN__ */  #endif  /* __BTPROLOG_H_SEEN__ */
240    

Legend:
Removed from v.53  
changed lines
  Added in v.54

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22