/home/doxygen/libascend/compiler/functype.h

Go to the documentation of this file.
00001 /*
00002  *  Functions-of-one-variable module
00003  *  by Tom Epperly
00004  *  Version: $Revision: 1.8 $
00005  *  Version control file: $RCSfile: functype.h,v $
00006  *  Date last modified: $Date: 2001/01/31 22:23:58 $
00007  *  Last modified by: $Author: ballan $
00008  *
00009  *  This file is part of the Ascend Language Interpreter.
00010  *
00011  *  Copyright (C) 1990, 1993, 1994 Thomas Guthrie Epperly
00012  *
00013  *  The Ascend Language Interpreter is free software; you can redistribute
00014  *  it and/or modify it under the terms of the GNU General Public License as
00015  *  published by the Free Software Foundation; either version 2 of the
00016  *  License, or (at your option) any later version.
00017  *
00018  *  The Ascend Language Interpreter is distributed in hope that it will be
00019  *  useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00021  *  General Public License for more details.
00022  *
00023  *  You should have received a copy of the GNU General Public License
00024  *  along with the program; if not, write to the Free Software Foundation,
00025  *  Inc., 675 Mass Ave, Cambridge, MA 02139 USA.  Check the file named
00026  *  COPYING.  Revision notes:
00027  *
00028  *  If CHRIS_FUNC defined, auxillary quantities to func structure.
00029  *  2/96 baa Probably somebody should properly set these evaluation
00030  *  defined below based on math.h when possible.
00031  *  10/96 moved safe_err definition into here.
00032  */
00033 
00042 #ifndef ASC_FUNCTYPE_H
00043 #define ASC_FUNCTYPE_H
00044 
00053 enum safe_err {
00054   safe_problem = -1,
00055   safe_ok = 0,
00056   safe_div_by_zero = 1,
00057   safe_complex_result = 2,
00058   safe_overflow = 3,
00059   safe_underflow = 4,
00060   safe_range_error = 5
00061 };
00062 
00064 enum Func_enum {
00065    F_LOG10, F_LN, F_EXP,
00066    F_SIN, F_COS, F_TAN,
00067    F_ARCSIN, F_ARCCOS, F_ARCTAN,
00068    F_SQR, F_SQRT,
00069  #ifdef HAVE_ERF
00070    F_ERF,
00071  #endif
00072    F_LNM, F_SINH, F_COSH, F_TANH,
00073    F_ARCSINH, F_ARCCOSH, F_ARCTANH,
00074    F_CUBE, F_CBRT, F_ABS, F_HOLD
00075 };
00076 
00078 struct Func {
00079   CONST char *name;         
00080   CONST char *cname;        
00081   CONST char *deriv1cname;  
00082   CONST char *deriv2cname;  
00083   enum Func_enum id;        
00084   double (*value)(double);  
00085   double (*deriv)(double);  
00086   double (*deriv2)(double); 
00087   double (*safevalue)(double,enum safe_err *); 
00088   double (*safederiv)(double,enum safe_err *); 
00089   double (*safederiv2)(double,enum safe_err *); 
00090 #ifdef CHRIS_FUNC
00091   struct Interval (*ivalue)();  
00092   void (*slope)(unsigned long,struct Interval *,struct Interval *,
00093   struct Interval *);           
00094   struct Interval (*ideriv)(struct Interval);
00096   double (*tmin)(double,double); 
00097   double (*tmax)(double,double); 
00098   double (*e)(double,double,double,double (*)(double));   
00099   double (*ed)(double,double,double,double (*)(double));  
00100   double (*E)(double,double,double,double (*)(double));   
00101   double (*Ed)(double,double,double,double (*)(double));  
00102 #endif
00103 };
00104 
00105 /* @} */
00106 
00107 #endif   /* ASC_FUNCTYPE_H */
00108 

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