/home/doxygen/libascend/compiler/btprolog.h

Go to the documentation of this file.
00001 /*  ASCEND modelling environment
00002     Copyright (C) 1998 Carnegie Mellon University
00003     Copyright (C) 2006 Carnegie Mellon University
00004 
00005     This program is free software; you can redistribute it and/or modify
00006     it under the terms of the GNU General Public License as published by
00007     the Free Software Foundation; either version 2, or (at your option)
00008     any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013     GNU General Public License for more details.
00014 
00015     You should have received a copy of the GNU General Public License
00016     along with this program; if not, write to the Free Software
00017     Foundation, Inc., 59 Temple Place - Suite 330,
00018     Boston, MA 02111-1307, USA.
00019 *//*
00040     By Benjamin A. Allan
00041     Jan 7, 1998.
00042     Part of ASCEND
00043     Version: $Revision: 1.3 $
00044     Version control file: $RCSfile: btprolog.h,v $
00045     Date last modified: $Date: 1998/06/16 16:38:40 $
00046     Last modified by: $Author: mthomas $
00047 */
00048 
00049 #ifndef ASC_BTPROLOG_H
00050 #define ASC_BTPROLOG_H
00051 
00056 #ifdef ASC_BINTOKEN_H
00057 # include <utilities/ascConfig.h>
00058 # include <compiler/instance_enum.h>
00059 #else
00060 # define IS_BINTOKEN_COMPILE
00061 # include <ascConfig.h>
00062 # include <instance_enum.h>
00063 #endif
00064 
00065 #include <math.h>
00066 
00067 #ifndef NULL
00068 #ifdef __alpha
00069 #define NULL 0L
00070 #else
00071 #define NULL 0
00072 #endif
00073 #endif
00074 
00075 #define BinTokenGRADIENT 0
00076 #define BinTokenRESIDUAL 1
00077 
00078 #ifdef __STDC__
00079 
00080 typedef void (*BinTokenFPtr)(double *, double *);
00082 typedef void (*BinTokenGPtr)(double *, double *, double *);
00087 typedef void (*BinTokenSPtr)(double *, double *, double *, int *, int *, int *);
00088 #else
00089 
00090 typedef void (*BinTokenFPtr)();
00092 typedef void (*BinTokenGPtr)();
00097 typedef void (*BinTokenSPtr)();
00098 #endif /* __STDC__ */
00099 
00100 struct TableC {
00101   BinTokenFPtr F;
00102   BinTokenGPtr G;
00103 };
00104 
00105 struct TableF {
00106   BinTokenSPtr S;
00107 };
00108 
00109 union TableUnion {
00110   struct TableC c;
00111   struct TableF f;
00112 };
00113 
00114 #ifdef __STDC__
00115 ASC_DLLSPEC int ExportBinTokenCTable(struct TableC *t, int size);
00116 #else
00117 ASC_DLLSPEC int ExportBinTokenCTable();
00118 #endif /* __STDC__ */
00119 
00120 /*------------------------------
00121   The following is stripped from compiler func.h.
00122   If a new function is introduced into ASCEND and func.h, fix this.
00123 */
00124 #ifndef ASC_FUNC_H
00125 
00126 #  ifdef __STDC__
00127 #   if __STDC__
00128 /*
00129  * stdc==1 --> erf, cbrt not defined in headers. user should link
00130  * against a library that does provide them. ASCEND is research
00131  * code: we aren't going to waste time reimplementing these basic
00132  * functions.
00133  */
00134 
00135 ASC_DLLSPEC double cbrt(double x);
00136 #    ifdef HAVE_ERF
00137 ASC_DLLSPEC double erf(double x);
00138 #    endif /* HAVE_ERF */
00139 #   endif /* __STDC__ == 1 */
00140 /*
00141  * in the case where __STDC__ is defined but == 0, system headers
00142  * should provide cbrt, erf.
00143  */
00144 ASC_DLLSPEC int ascnintF(double x);
00145 ASC_DLLSPEC double dln(double x);
00146 ASC_DLLSPEC double dln2(double x);
00147 ASC_DLLSPEC double dlog10(double x);
00148 ASC_DLLSPEC double dlog102(double x);
00149 ASC_DLLSPEC double lnm(double x);
00150 ASC_DLLSPEC double dlnm(double x);
00151 ASC_DLLSPEC double dlnm2(double x);
00152 ASC_DLLSPEC double dtanh(double x);
00153 ASC_DLLSPEC double dtanh2(double x);
00154 ASC_DLLSPEC double arcsinh(double x);
00155 ASC_DLLSPEC double arccosh(double x);
00156 ASC_DLLSPEC double arctanh(double x);
00157 ASC_DLLSPEC double darcsinh(double x);
00158 ASC_DLLSPEC double darcsinh2(double x);
00159 ASC_DLLSPEC double darccosh(double x);
00160 ASC_DLLSPEC double darccosh2(double x);
00161 ASC_DLLSPEC double darctanh(double x);
00162 ASC_DLLSPEC double darctanh2(double x);
00163 ASC_DLLSPEC double sqr(double x);
00164 ASC_DLLSPEC double dsqr(double x);
00165 ASC_DLLSPEC double dsqr2(double x);
00166 ASC_DLLSPEC double cube(double x);
00167 ASC_DLLSPEC double dcube(double x);
00168 ASC_DLLSPEC double dcube2(double x);
00169 ASC_DLLSPEC double asc_ipow(double x, int y);
00170 ASC_DLLSPEC double asc_d1ipow(double x, int y);
00171 ASC_DLLSPEC double asc_d2ipow(double x, int y);
00172 ASC_DLLSPEC double hold(double x);
00173 ASC_DLLSPEC double dsqrt(double x);
00174 ASC_DLLSPEC double dsqrt2(double x);
00175 ASC_DLLSPEC double dcbrt(double x);
00176 ASC_DLLSPEC double dcbrt2(double x);
00177 ASC_DLLSPEC double dfabs(double x);
00178 ASC_DLLSPEC double dfabs2(double x);
00179 ASC_DLLSPEC double dhold(double x);
00180 ASC_DLLSPEC double dasin(double x);
00181 ASC_DLLSPEC double dasin2(double x);
00182 ASC_DLLSPEC double dcos(double x);
00183 ASC_DLLSPEC double dcos2(double x);
00184 ASC_DLLSPEC double dacos(double x);
00185 ASC_DLLSPEC double dacos2(double x);
00186 ASC_DLLSPEC double dtan(double x);
00187 ASC_DLLSPEC double dtan2(double x);
00188 ASC_DLLSPEC double datan(double x);
00189 ASC_DLLSPEC double datan2(double x);
00190 ASC_DLLSPEC double derf(double x);
00191 ASC_DLLSPEC double derf2(double x);
00192 
00193 #  else /* no stdc */
00194 
00195 ASC_DLLSPEC double cbrt();
00196 #   ifdef HAVE_ERF
00197 ASC_DLLSPEC double erf();
00198 #   endif /* HAVE_ERF */
00199 ASC_DLLSPEC int ascnintF();
00200 ASC_DLLSPEC double dln();
00201 ASC_DLLSPEC double dln2();
00202 ASC_DLLSPEC double dlog();
00203 ASC_DLLSPEC double dlog2();
00204 ASC_DLLSPEC double lnm();
00205 ASC_DLLSPEC double dlnm();
00206 ASC_DLLSPEC double dlnm2();
00207 ASC_DLLSPEC double dtanh();
00208 ASC_DLLSPEC double dtanh2();
00209 ASC_DLLSPEC double arcsinh();
00210 ASC_DLLSPEC double arccosh();
00211 ASC_DLLSPEC double arctanh();
00212 ASC_DLLSPEC double darcsinh();
00213 ASC_DLLSPEC double darcsinh2();
00214 ASC_DLLSPEC double darccosh();
00215 ASC_DLLSPEC double darccosh2();
00216 ASC_DLLSPEC double darctanh();
00217 ASC_DLLSPEC double darctanh2();
00218 ASC_DLLSPEC double sqr();
00219 ASC_DLLSPEC double dsqr();
00220 ASC_DLLSPEC double dsqr2();
00221 ASC_DLLSPEC double cube();
00222 ASC_DLLSPEC double dcube();
00223 ASC_DLLSPEC double dcube2();
00224 ASC_DLLSPEC double asc_ipow();
00225 ASC_DLLSPEC double asc_d1ipow();
00226 ASC_DLLSPEC double asc_d2ipow();
00227 ASC_DLLSPEC double hold();
00228 ASC_DLLSPEC double dsqrt();
00229 ASC_DLLSPEC double dsqrt2();
00230 ASC_DLLSPEC double dcbrt();
00231 ASC_DLLSPEC double dcbrt2();
00232 ASC_DLLSPEC double dfabs();
00233 ASC_DLLSPEC double dfabs2();
00234 ASC_DLLSPEC double dhold();
00235 ASC_DLLSPEC double dasin();
00236 ASC_DLLSPEC double dasin2();
00237 ASC_DLLSPEC double dcos();
00238 ASC_DLLSPEC double dcos2();
00239 ASC_DLLSPEC double dacos();
00240 ASC_DLLSPEC double dacos2();
00241 ASC_DLLSPEC double dtan();
00242 ASC_DLLSPEC double dtan2();
00243 ASC_DLLSPEC double datan();
00244 ASC_DLLSPEC double datan2();
00245 ASC_DLLSPEC double derf();
00246 ASC_DLLSPEC double derf2();
00247 
00248 #  endif  /* no stdc */
00249 # endif  /* fake ASC_FUNC_H */
00250 
00251 /* @} */
00252 
00253 #endif  /* ASC_BT_PROLOG */
00254 

Generated on Thu Jul 17 04:00:09 2008 for libascend by  doxygen 1.5.1