home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / formu220.zip / formulc.h < prev    next >
C/C++ Source or Header  |  1995-05-17  |  2KB  |  74 lines

  1. /* FORMULC.H     as of 12/13/94 (v2.2 definitive)*/
  2. /*Copyright (c) 1995 by Harald Helfgott        */
  3. /* This program must be distributed with its corresponding README.DOC */
  4. /* The full copyright and availability notice is in README.DOC          */
  5. /*     This program is provided "as is", without any explicit or */
  6. /* implicit warranty. */
  7.  
  8.  
  9. /* Programmer's Address:
  10.         Harald Helfgott
  11.         MB 1807, Brandeis University
  12.         P.O. Box 9110
  13.         Waltham, MA 02254-9110
  14.         hhelf@cs.brandeis.edu
  15.            OR
  16.          (during the summer)
  17.         2606 Willett Apt. 427
  18.         Laramie, Wyoming 82070
  19.         seiere@uwyo.edu */
  20. #define UCHAR unsigned char
  21. #define MAXPAR 3
  22.             /* maximum number of parameters */
  23. typedef struct {
  24.  UCHAR *code;
  25.  double *ctable;
  26. } formu;
  27.  
  28. typedef double (*Func)(double);
  29. typedef double (*Func2)(double,double);
  30. typedef double (*Func3)(double,double,double);
  31. typedef double (*Func0)(void);
  32.  
  33. formu translate(const char *source, const char *args, int *length, 
  34.                                                 int *error);
  35. void destrf(formu);
  36. void make_empty(formu);
  37. int fnot_empty(formu);
  38. const char *fget_error(void);
  39.  
  40. double fval_at(formu function);
  41. void make_var(char var, double value);
  42. double fval(formu function, char *args, ...);
  43. double f_x_val(formu function, double x);
  44.  
  45. int fnew(char *name, Func f, int n_of_pars, int varying);
  46. int read_table(int i, char *name, int *n_of_pars, int *varying);
  47. int where_table(char *name);
  48. int fdel(char *name);
  49.  
  50. double rnd(void);
  51. void rnd_init(void);
  52. /* If MY_RND is defined, rnd() and rnd_init() must be defined by the user.*/
  53. /* Otherwise, formulc.c uses the random-number generator r250  */
  54. /* (written by W. L. Maier, S. Kirkpatrick and E. Stoll) */
  55.  
  56. /* rnd_init is used by formulc.c only if STAND_ALONE is defined.   */
  57. /* If FORMULC is compiled without STAND_ALONE, it is the user's    */
  58. /* responsibility to initialize her random-number generator.       */
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.