1 #include <../../nrnconf.h>
16 diag(
"Discrete variable must have @index >= 1", (
char*) 0);
19 if (!(
s->subtype &
STAT)) {
20 diag(
s->name,
"must be a STATE for use as discrete variable");
22 if (array && !(
s->subtype &
ARRAY)) {
23 diag(
s->name,
"must be a scalar discrete variable");
25 if (!array && (
s->subtype &
ARRAY)) {
26 diag(
s->name,
"must be an array discrete variable");
28 if (
s->discdim <= num) {
51 "{int _i, _j; for (_j=%d; _j >=0; _j--) {\n\
52 for (_i=%d; _i>0; _i--) __%s[_i][_j] = __%s[_i-1][_j];\n\
53 __%s[0][_j] = %s[_j];\n\
63 "{int _i; for (_i=%d; _i>0; _i--) __%s[_i] = __%s[_i-1];\n\
85 "{int _i, _j; for (_j=%d; _j >=0; _j--) {\n\
86 for (_i=%d; _i>=0; _i--) __%s[_i][_j] = %s0;}}\n",
92 Sprintf(
buf,
"static double __%s[%d][%d];\n",
s->name,
s->discdim,
s->araydim);
96 "{int _i; for (_i=%d; _i>=0; _i--) __%s[_i] = %s0;}\n",
101 Sprintf(
buf,
"static double __%s[%d];\n",
s->name,
s->discdim);
void massagediscblk(Item *q1, Item *q2, Item *q3, Item *q4)
void disc_var_seen(Item *q1, Item *q2, Item *q3, int array)
void movelist(Item *q1, Item *q2, List *s)
void replacstr(Item *q, const char *s)
int Sprintf(char(&buf)[N], const char *fmt, Args &&... args)
Redirect sprintf to snprintf if the buffer size can be deduced.
NMODL parser global flags / functions.
static double remove(void *v)