Last change
on this file since 31587 was
31587,
checked in by Ivan Raikov, 6 years ago
|
nemo: bug fixes in NEST templates
|
File size:
943 bytes
|
Line | |
---|
1 | |
---|
2 | {# |
---|
3 | NEST function template |
---|
4 | |
---|
5 | Template variables are: |
---|
6 | |
---|
7 | - name: string with the name of the function |
---|
8 | - vars: list of strings with the name of the arguments |
---|
9 | - localVars: list of strings with the name of any local variables |
---|
10 | - returnVar: the name of the return variable |
---|
11 | - exprString: string with expression body converted to NMODL syntax |
---|
12 | |
---|
13 | #} |
---|
14 | |
---|
15 | {{functionDef.returnType}} {{functionDef.name}} {{ functionDef.vars | join (", ") }} { |
---|
16 | |
---|
17 | double {{functionDef.returnVar}}; |
---|
18 | |
---|
19 | {% if (!(functionDef.localVars == [])) %} |
---|
20 | double {{functionDef.localVars | join(", ")}}; |
---|
21 | {% endif %} |
---|
22 | {% if (!(functionDef.consts == [])) %} |
---|
23 | double {{functionDef.consts | join(", ")}}; |
---|
24 | const ~A::Parameters_{{modelName}} & p = *(reinterpret_cast< const {{modelName}}::Parameters_ *>(params)); |
---|
25 | |
---|
26 | {% for const in functionDef.consts %} |
---|
27 | {{const}} = p.{{const}}; |
---|
28 | {% endfor %} |
---|
29 | {% endif %} |
---|
30 | {{functionDef.exprString}} |
---|
31 | return {{functionDef.returnVar}}; |
---|
32 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.