1 #include <../../nmodlconf.h>
14 "%s(%d,_slist%d, _p, %s, _dlist%d);\n",
29 " 0; %s();\n error = %s(%d, _coef%d, _p, _slist%d);\n",
69 diag(
"NONLINEAR merging not implemented", (
char*) 0);
98 "for(_i=0;_i<%d;_i++){\n _slist%d[%d+_i] = %s_columnindex + _i;}\n",
117 char* eqtype =
SYM(
ITM(lq))->name;
118 if (strcmp(eqtype,
"~+") == 0) {
120 diag(
"no previous equation for adding terms", (
char*) 0);
123 }
else if (eqtype[0] ==
'D') {
125 int count_deriv =
SYM(
ITM(lq))->araydim;
127 counte += count_deriv;
135 if (counte != counts) {
136 Sprintf(
buf,
"Number of equations, %d, does not equal number, %d", counte, counts);
142 "if(_counte != %d) printf( \"Number of equations, %%d,\
143 does not equal number of states, %d\", _counte + 1);\n",
150 diag(
"NONLINEAR contains no equations", (
char*) 0);
154 "static int _slist%d[%d]; static double _dlist%d[%d];\n",
179 q =
insertstr(q3,
"{ static int _recurse = 0;\n int _counte = -1;\n");
181 "{ double* _savstate%d = _thread[_dith%d]._pval;\n\
182 double* _dlist%d = _thread[_dith%d]._pval + %d;\n int _counte = -1;\n",
189 Insertstr(q3,
"if (!_recurse) {\n _recurse = 1;\n");
191 "error = newton(%d,_slist%d, _p, %s, _dlist%d);\n",
198 "error = nrn_newton_thread(_newtonspace%d, %d,_slist%d, _p, %s, _dlist%d, _ppvar, "
206 Insertstr(q3,
"_recurse = 0; if(error) {abort_run(error);}}\n");
236 if (strcmp(
SYM(q1)->
name,
"~+") == 0) {
263 "for(_i=0;_i<%d;_i++){_slist%d[%d+_i] = %s_columnindex + _i;}\n",
298 }
else if (pstate == 0) {
302 diag(
"more than one state in preceding term", (
char*) 0);
343 "if(_counte != %d) printf( \"Number of equations, %%d,\
344 does not equal number of states, %d\", _counte + 1);\n",
352 "static int _slist%d[%d];static double **_coef%d;\n",
sprintf(buf, " if (secondorder) {\n" " int _i;\n" " for (_i = 0; _i < %d; ++_i) {\n" " _p[_slist%d[_i]] += dt*_p[_dlist%d[_i]];\n" " }}\n", numeqn, listnum, listnum)
char * qconcat(Item *q1, Item *q2)
#define ITERATE(itm, lst)
NMODL parser global flags / functions.
Item * linsertstr(List *list, char *str)
void movelist(Item *q1, Item *q2, List *s)
void freelist(List **plist)
Item * insertstr(Item *item, char *str)
void replacstr(Item *q, char *s)
void deltokens(Item *q1, Item *q2)
Item * lappendsym(List *list, Symbol *sym)
void slist_data(Symbol *s, int indx, int findx)
void vectorize_substitute(Item *q, char *str)
void sens_nonlin_out(Item *q, Symbol *fun)
void add_sens_statelist(Symbol *)
void sensmassage(int type, Item *qfun, int fn)
void init_linblk(Item *q)
int in_solvefor(Symbol *s)
void lin_state_term(Item *q1, Item *q2)
int nonlin_common(Item *, int)
void massage_linblk(Item *q1, Item *q2, Item *q3, Item *q4, int sensused)
Item * mixed_eqns(Item *q2, Item *q3, Item *q4)
static void freeqnqueue()
void init_lineq(Item *q1)
void massagenonlin(Item *q1, Item *q2, Item *q3, Item *q4, int sensused)
void solv_lineq(Item *qsol, Symbol *fun, Symbol *method, int numeqn, int listnum)
void solv_nonlin(Item *qsol, Symbol *fun, Symbol *method, int numeqn, int listnum)
void linterm(Item *q1, Item *q2, int pstate, int sign)