01: /*
02:  *  ddeq.h
03:  *  DDEsolve
04:  *
05:  *  Created by Ashley Buckner on Tue Mar 09 2004.
06:  *  Copyright (c) 2004 __MyCompanyName__. All rights reserved.
07:  *
08:  */
09: 
10: // #include <Carbon/Carbon.h>
11: 
12: 
13: #ifndef DDE_HEADER_IN
14: #define DDE_HEADER_IN 1
15: 
16: typedef struct
17: { double **buff,**gbuff,*clock,last_time,first_time;
18:   long offset,size,no,**lagmarker;
19: } histype;
20: 
21: void initialise_dde();
22: 
23: // Clashed with math.h
24: // #define round(a) ((a)-floor(a) <0.5 ? (int)floor(a):(int) floor(a)+1)
25: 
26: 
27: /***************************************************************************/
28: /*                       Function Prototypes                               */
29: /***************************************************************************/
30: #ifdef SUNC
31: 
32: void switchfunctions();
33: void map();
34: void grad();
35: void storehistory();
36: void initialstate();
37: void output();
38: 
39: /*********************** Integration routines ******************************/
40: 
41: void rk23();
42: void inithisbuff();
43: void updatehistory();
44: double pastvalue();
45: double pastgradient();
46: double zeropos();
47: double istep();
48: void dde();
49: 
50: #else
51: /************************ User Supplied Routines ***************************/
52: /*void initcons(int *no_vars,int *no_cons);
53: void switchfunctions(double *sw,double *state,double *coeff,double time);
54: void map(double *state,double *coeff,double time,int swno);
55: void grad(double *g,double *s,double *c,double t);
56: void storehistory(double *his,double *ghis,double *g,double *s,double *c,double t);
57: void initialstate(double *s,double *c,double t);
58: void output(double *s,double t, globaldatatype *data);
59: void error (char *str);
60: void statescale(double *scale); */
61: /*********************** Integration routines ******************************/
62: void output(double *s,double t, void *data);
63: 
64: void rk23(double *state,double *newstate,double *g,double *newg,double *error,
65:           double *coeff,int ns,double time,double dt);
66: void inithisbuff(int nhv,long histsize,int nlag);
67: void updatehistory(double *g,double *s,double *c,double t);
68: double pastvalue(int i,double t,int markno);
69: double pastgradient(int i,double t,int markno);
70: double zeropos(double x1,double x2,double x3,double s1,double s2,double s3);
71: double istep(double *sw0,double *newsws,double *s0,double *news,double *g,
72:              double *newg,double *c,double *err,double t0,double t1,int nsw,
73:              int ns,int *flickedswitch);
74: void dde(double *s,double *c,double t0,double t1,double *dt,double eps,
75:          double dout, int ns,int nsw,int nhv,long hbsize,int nlag,int reset,
76:          int fixstep, void *data);
77: #endif
78: #endif