From 5ab466110fab142c7131d54402f2ccff1d161515 Mon Sep 17 00:00:00 2001 From: 1uc Date: Mon, 15 Jul 2024 08:36:32 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20BlueBrai?= =?UTF-8?q?n/nmodl@094a6abfb42e711e3b5b1ba578fca9727e07e8c4=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .doctrees/environment.pickle | Bin 147558 -> 147558 bytes .../notebooks/nmodl-kinetic-schemes.ipynb | 56 +- .../notebooks/nmodl-python-tutorial.ipynb | 160 +- .../notebooks/nmodl-sympy-conductance.ipynb | 72 +- .../notebooks/nmodl-sympy-solver-cnexp.ipynb | 64 +- .../nmodl-sympy-solver-derivimplicit.ipynb | 32 +- .../notebooks/nmodl-sympy-solver-sparse.ipynb | 32 +- ...degen_1_1_codegen_acc_visitor-members.html | 2 +- ...dl_1_1codegen_1_1_codegen_acc_visitor.html | 6 +- ...odegen_coreneuron_cpp_visitor-members.html | 2 +- ...en_1_1_codegen_coreneuron_cpp_visitor.html | 6 +- ...degen_1_1_codegen_cpp_visitor-members.html | 2 +- ...dl_1_1codegen_1_1_codegen_cpp_visitor.html | 31 +- ...modl_1_1codegen_1_1_codegen_cpp_visitor.js | 2 +- ...1_1codegen_1_1_codegen_helper_visitor.html | 76 +- ..._1_codegen_neuron_cpp_visitor-members.html | 4 +- ...odegen_1_1_codegen_neuron_cpp_visitor.html | 178 +- .../codegen__acc__visitor_8cpp_source.html | 10 +- ..._coreneuron__cpp__visitor_8hpp_source.html | 4 +- .../codegen__cpp__visitor_8cpp_source.html | 253 +- .../codegen__cpp__visitor_8hpp_source.html | 856 ++-- .../codegen__helper__visitor_8cpp_source.html | 1453 +++--- .../codegen__helper__visitor_8hpp_source.html | 78 +- doxygen/codegen__info_8hpp.html | 1 + doxygen/codegen__info_8hpp_source.html | 1333 ++--- ...gen__neuron__cpp__visitor_8hpp_source.html | 174 +- doxygen/functions_func_t.html | 6 +- doxygen/functions_s.html | 2 +- doxygen/functions_t.html | 6 +- doxygen/functions_v.html | 7 +- doxygen/functions_vars_v.html | 1 + doxygen/group__codegen__backends.html | 4 +- doxygen/group__codegen__backends.js | 2 +- doxygen/group__codegen__details.js | 1 + doxygen/namespacenmodl_1_1codegen.html | 2 +- doxygen/navtreedata.js | 4 +- doxygen/navtreeindex16.js | 2 +- doxygen/navtreeindex26.js | 40 +- doxygen/navtreeindex27.js | 36 +- doxygen/navtreeindex28.js | 2 +- doxygen/navtreeindex29.js | 18 +- doxygen/navtreeindex30.js | 24 +- doxygen/navtreeindex32.js | 6 +- doxygen/navtreeindex33.js | 4 +- doxygen/navtreeindex34.js | 1 + doxygen/search/all_12.js | 2 +- doxygen/search/all_13.js | 14 +- doxygen/search/all_15.js | 4 +- doxygen/search/functions_13.js | 4 +- doxygen/search/variables_13.js | 2 +- ..._coreneuron__cpp__visitor_8cpp_source.html | 12 +- ...c_2codegen_2codegen__info_8cpp_source.html | 2 +- ...n_2codegen__neuron__cpp__visitor_8cpp.html | 1 + ...gen__neuron__cpp__visitor_8cpp_source.html | 4494 ++++++++--------- ...ructnmodl_1_1codegen_1_1_codegen_info.html | 166 +- ...tructnmodl_1_1codegen_1_1_conductance.html | 6 +- ...tnmodl_1_1codegen_1_1_index_semantics.html | 10 +- ...tructnmodl_1_1codegen_1_1_ion-members.html | 5 +- doxygen/structnmodl_1_1codegen_1_1_ion.html | 95 +- doxygen/structnmodl_1_1codegen_1_1_ion.js | 1 + .../symtab__visitor__helper_8hpp_source.html | 2 +- notebooks/nmodl-kinetic-schemes.ipynb | 56 +- notebooks/nmodl-python-tutorial.ipynb | 160 +- notebooks/nmodl-sympy-conductance.ipynb | 72 +- notebooks/nmodl-sympy-solver-cnexp.ipynb | 64 +- .../nmodl-sympy-solver-derivimplicit.ipynb | 32 +- notebooks/nmodl-sympy-solver-sparse.ipynb | 32 +- 67 files changed, 5169 insertions(+), 5122 deletions(-) diff --git a/.doctrees/environment.pickle b/.doctrees/environment.pickle index efefb798250a0d24b5f599bf6b9b10bda9587626..f992581782e7774d39094bb4e69f92390a311aaa 100644 GIT binary patch delta 9797 zcmY+Kc|cT0^2aSu)K#OPC@QEpW5g3L1VIj!L=f*QYP>*DcmW1ERJ;aPC6J5;?a?+G z5wCbeE(dsu2qJ2BlTFm@X^cm9qid3lIW>vD#Qdte-s{LeQ{VbjzdoybdLG=*YkNPh zZH4Dh&(>+S#GKTmET_XGGbuhXEs6a$^m#AOWw!L}r1b2pz-2j^nL@CGft~r%!_cw4 z)6q8FmYtMfv%QkVb_@*|)m{|NOi9SePDx+kbaYV9rr6T4-rwt5m6DZ`ZOcT~msi$6 z-w{qnCslYwsx2WtwORQLTMG6A@J8Nf@_h@pCR;|3pXKJ;x z%KOoyy;k$PchI3#Devc;IIaG7?|6`QUU^S?b<`T|%Kg9dbG16<{dVU=t<>~xw6M(5 zYL(afA1`aCmDgv?VePW=EHyP+rSiTi*`i%Ey^qJPy`-H}-lhi`T7&x%WAq=tKWUtH z$qe2+?%7K#H@#2tV=rsE>D^A8a8$csdUt%UzpA;Eck}vFtxS2h&OKo@qrzH?Iex<# zz`TQcv!6!!xff{_EI4R9RI{}~5pBi5FzOh?8iR(l&&o~9j!zhxk?VBCAQ;H3qx-PD z(W_Wa@Nl=pEH*s&&+O6YaqLO(LTF+yg9c7;foeSclHT7N#iXn zGCY;_A7f!3hHLB{tooC4zHD_w6nliRVGVxlN7OyTENnq!3fmoOVfQ1GSa76;rAH;O zxF`$n(;EC)mvK?71S?rR?jf5!&cX-yzz|kFK8iWdLW!i(qJ z@@Fq6@pMiuiNcrCNwl4Rp9H)dL?UM4S0pAbUJtx^gP}Ux)&u5#W4$lC8#5F0 zUt>2WT3wEnILsRpJzaWcCNQsEqxrQd5XvIMyjfXx47;_<>gtg*7*Ke+URt${#G}>I zNX*IANL*Ws(|X`VT@*>)Tox?V1OUc8~c+mvXi%F&$^uNp7S10k$ebsJA zyj;b_Rw5rAu(;tvp3LLWSG=|x4m~n_Fx!4OhA-)94*$tv96q{Uu6{>x&{FMtdzqm+ z9Up0^IVa{Bs^R2khN?b=$ts_CT8e2Q)ui$#hMHTMZKzL9=Nl@!%Eyh$71yjY*q}3O zfHlR8X4mW?c!mvRVYM-=DAvl3)m~wT&yHr(myf|SEs<@mwX(#z3Mh4XpMMAVvFAZd z4<2zzyw`AZJZBp=f^fZDv5mT+yqdl=RL9HTkYe6{_T$sDp`~lYyVs4N_n%j|(WBen zHyFD;skLj(2ak;sc~{36>iuhP7!`>USs(pkc<*29=qmc#YeuQT|F~l)zkju(x|t{u z`?15||Gjz7P`7V=YN+dXS{nWM@23L|W%;bN@%-&u?fG9yz|%GV{s+bbArHKbVoScj zbd{sO^JO-$0ogV@^#`yozlvcEYmLqP(nDWB&&##->nvbzWYEMf|2B;!ue7oszrDg{ zePzQhhrVp;_c3hbL#wOy`<}qEzV>qc_XpfqLM(fnM&jQ;t|yW4^ClAR|7Rny<(DN= z@F7FM*X8-NBYDGyg9pzTif38eZ{wapy=Oq@Y8^rp>aO>2d&c$9HFtLcc1 z^`ekmLa|l!HS@6rh2)&vTmT;d`{^5bK8kx+3j6D~R{g{x@CH<#`qjmN8&Igor6PHR zIvWowNrf$g%|^LIz&$LY3zq|4DujA(1*{-7J_Ya_Sg^|);CUfbY$|L6dBckXdA*Bs zmv_6kcJg8u_Xl~ai*u7#x;PJcpNo4=Ugq!tag)QCxW*wAcQ}ON0*6N2-r{`Z%?*o) zYa2pwXN&6~FKp>6nG*c~d&9 zf>Iu8gF$xDiz2Oa2YI8HeJawtn|ULfc|py*;AY;KW?on`FT9yI&-BEvsUmHG=}K>5 zGjDM-Z)r0xp_!N1%v;{fOK#?A$_p0FZ&j}FN}73xnt5|N(L9yvdo$n{m?M5CEpp1W zM}#Ry zYN70Dq3md(>}R3uW})n5q3mR#%+ErZo`tf5g|dGIvU>%xcLlO@1+s4ivTFsJ?uDHx zkUcAq9V@_oJzfj3P|Ks%!EiL0>mV4-$#oEf=I%N?aB8{VdWb-?kj%dIFvLUtyb0nn zHbNKv@Ac4)KnQ`(8^8<8KfeJ6qM5M)&(&JKVFQdrQ@H^`sPIH8?7mSJ?z&O7IC&$C zrSNnLAKD1L@Ug~?c!<<;e>Gn{XMXf&T}!S>H^kFEH4FgZ(veYajzn278b#L53vCq-n_U7y7KEq*r6)!y#tn^$=!hme-(ec1JUo+I`lH$9gy->e?a%;y z`E4h3K>a@_3_;Ul7c7QGp1TWPLUVl=3`X;G7cOukpST-dK(lQ(=6ECj%Wj;NM()P3 z;zl09@!r$O^El3QBX8okq>a4y9vo>S&));Dc!&eU5y&s>fnmJ=n-EXHmzC7`@zlN8 zj}P920D?Yj$eHfE%U&3R4^Q2T3scAI_Tr+|anF6YLrQu0KFr)wp0f`}Q_J`7le_0n z`=B3s5BJF}IOHvv_!^qlGLI+uvxXbq{Nh_+C6M6HKKx7sfs8?+w>P|MTy%RO;) zKZK%pcR%gwVrdo>%k7z841?RrDnrC(2;oJ=;L|QXD|_gwl%&;oD)PItMf%$0OF2VGx<#$SCv%Uv$eNXcR z2XTL#=4A(A1e#9|LV|}la2?%v)Isp!@rSU@%bXv={IBHyIfT2vl8-x#3s=csI}93{ zM~5LDP2v%-w-$%A!+#oYJOci_-BB4|bre=({NYhpi01lv@Z~Gs#ywrh{p&FmOG)2) z8?&I2TaHPSLZ$I#KSqg`UJe~2ABB4 zQ+PMI#IK#g{Jz9*Rf3g=l;ZZj#J85hJ~aMikdNkg8RpO>-mx4q(BzfFCJ*r?;^@ye zSs;K1R=_&s?^M7JDCgmo*nTY}+6G;%6e>$q?_wRC~>_qu#$>=|jcl94Tac19NNb{10M0^f2L{)nb^EllUWH86nZ z)j}-)rUrue(^?4U3v_%xJ?|WZ@)J6A<0pjrPN*m6ux1yZP=~#7@ya?pV_Y;Jmh-q# zT{Iti&%O6ongm|Jxz4|UHI(sd7i8h*8f6XB8esv#la2D3mKULbUO0O9ZP6m%srjJM#2qEM z7`-0C6YtBlo)qq70vYaOdYV6ltqSxb5Fmhjc{zZLvDln12Bn9I7wy=wFPgP_Z6`85PECO={kZ)gKBCx;&awrQ; zPg_Lcr3%CoNK_z+Kr#XG!Zn3Rsw$F3AVYzb1hN&#A+Sb)TmtJA*gzmp0Qs_b6M-!z zkR8vro38dM#a|OZzEggkz;+YJ2Z~Hj+d*Nc0=o$8QQ%DiZz-^!K#2ke`{MX<0gebF zUtb@kBF9Z28$D@y+B+03Q=pu{X$4#aY8223)GBa}K)nRw2Zh!^9pp9DTu;3g_Nj{deF@|FD^D)Mg=$kBf$Joz5~9)%y6K!(3C zJ?%>hKNLWG(`#Q7_|62f{12w5Jwheg|4EUbQ6cz6fnN!DlE}bfmQ_CDA1Nb zdj&cW=%j!rfi42rWk#6A zDI)IqSjiLxk_b#!;CTWw6&OHZwgQ6*%vB(ez&r&;5Lke~PGbuqvQQNfw<_$&Vg(`y zEL9+yK!O4j2_z~YZdzE!as{RnNLFB$Kka`_k-1bPRe|{g(iK=pAVYyA1TqCU?T#N= zsIc8tCXfrY#`LsY3a=O7vfTe0h~!D)ZhZayQFxW;X`4}DefcJk^%a<&R!Cuo0^0}_ zDX@cpQ-NIs_E>QJsf{;@yrqilCs3lmK>|k8AL91~7eGGt!1T1w zDf~YLz9R6A0^bt&L4ijEep29P0>3Ems|0qfh1FEfr`*pp5|X50-5Sv^Rn5 z=X0i~b)>MD0-XtTRiGPz9tzld66vK#ZvuT4un>4&f&K&rDlmw^Pz3@Bj8I@Cfzb*C z69}~nBHr<6VMHQKAjcMEdfGS&M=S6Gffxm12~1XC3W4bg%pfpZfjL&%;PVujPem3g zu!z7?1>y-LDv(4VS%3>-Bq;<^O&~{-ZhD%H!kH4t4W310l`68Dz*+^?5!k4Jm^aLo zKMEjTifNk(`~xN0&fW*|1iFvK#2)tqlZjS zJ51rX6*xxVqyq04<0w<4oQj-Qz(t@&0i8gt0_Ot|;)X1Ubp!eEe02 z?Dzy{5dQ^4{9Lr9IB>&nD&-SMj$^1^?God?!-Df4d4+d>>@J2L5PXMAPFy zKb(`d#K&>*aY%d|6(8^Do34SoyN5Wc9sT&GW6+OB9L7H$IV|i!pkLdeDH*xx3HT0_ z-})=equ;Il_{uWq*M{DK;x8tsg#PG>ZQ=+J|7jF}o=7#vF!g^&oe_yda10=Hs}9=p zfWJepF{0%S^sW_+I403FkP(L+dg5?FBN{*>YDVMI?SBWW2h{3EZi06!Z*j|Tv`@9g zCoV}^6Q7omnk3%tes~wk7UPSE4Uul$y2~Q%#Q##Q$c)cU8nFyZh^I#K$OkYIdnmo( rEby}ty-9bL%ZYU_+fCmBh<-t?}do*+&9TWFm zQvn~~vdL<;npp4FYnqn&+Gbj5%dhNrX3o8n{PUdi{mk4u+nKrNUbvUxaWBIo-?MMu zrin4hOP9wijdR#rC0oW&Q#w9!KE!5Qs)?~cWJs~+QJti@ceHY}%y6m?w_n=OGiXFVfW*${sDgMcHi#MnJ+sJox#ES?d!^}1o=Z3?t2=#w0X9VDb@t+ZEBix zNIySUTd8ZKMx#f3c5M8OYU>!SLaCY-JGFA9YFD1nbfxO<6=?4$b!p(gvyv>LPUcF>BMTA8W7eE!E% zTD7UZx}UjN%Qw}Xv(rA(3Qcu4c~2v)NU4;p3|2fa++ED^n~p%%F4&L#Ibp7X$n#3^<>>cy0GftArL0{s*q7Ij3tK#vxlM2vBx2o z*zcipp_I)WR1X#G@Zhd&?BE$}+6W8VJ)sl3Jvf4`9BE;ZVN+P$a0`2y(v@8gi(sMX z4-22c9=~K^diXNdG2Fs3c6qafLn2t<5DT9-AKJ6eQ5+guWD~Cle7HMJqs{Gh5=toCb*qq@BtkWn9yEik_Ev7u5p`;7Y? zcv@4iVuUQ=e>DS7p7K1jc6OQA0fh8&j+->k@X9B@D!n$&u&H4N%bd2v@SaXzZFt!; zlMT;f_C3RcSAq>MYVP-jH+ud$;3o%R+mT^jEOKEK?>o|LKYw9+5Yo$eJqFv7UiZbr z3~yzu)rHuvOF|455&yvSw3iIe@#<2;YmxM`;kCA|1NQ5~5H@MaVB7*4`}9$O)4r?& zpyTP(Q&WLW{oaZjqAfe09>oSc2yk{--Wyoj4_?k$E9~SvSvi568LJb>xwa;WoJs3` z#ZkS0qtZ95=AB+NM>NfbBSPurv}ME?-j5q&4KIEZ&Y3K|zxidui^#+omF&aU=NMjS zw%vu;Ki|OFkfq(WnWa0nCmO6}&U(W;u)}J2o!L*odZdT2dfOn};PY738d_}zyDu}Z zU4A?3r_yGh#G}}aT>-3uUxZ5Mnmw6-2KHVS=DplYE@-wL2o|dDV1E~^>dD-We9yX1 zu;Tg9n{7WD#eSG$MAGj^+XE^uXSd_A@+rtA`Y(@Ugy{()97xw{gJQc(=;87OGTg@`puC!_c2kGs4`%g2vHxo6+{MT;q|6RXpcsFm{HoR+JG&cJ2zuP?x z&vM7zxc=si=KP~W;OU%w?}~B3p!?oNwFTc`Y|7Dp@hwjM#UHJBy7yq;ejml^e=$~h z<^x|q<>lP+LmKdNbAhIQ$)hA*Ip3H@_RFKo{DK=6iLI9$(Und3DT-&iLx8jFr;Z>z zPv^a#@sN?;q9@p_^ltxx!7M%NZ?74i%m1Yq-ljhmlE-`Z0Y9hb)0QN6yWnFar7s?4 z(SMD226dhct&4ORM5x#Wru2Sz)oV8Zm=0xbtMJ4 z&&bX^xI0ActTUQB+#Q?SS?9&EwJ!SCfiOZSeMnEdyTE5>K%o9bFBl?mpFYq_;(jlJ zn~t*?trQm%sox92nG`p`3X}gX!+C72pY2a&TwKg?E?es@2R?)J1;NkUPp=KZ$>!6> zfK{ac@jPrS1n8#+gAWMTllPkr7X5J;j3lj(83K6b$)dMsKo9+gq1bb&^&!KdH@PAd z^o$6xw4$br4B7i9BSah+tb;y#DJNMaaI>)#Y82D|2PJ7 zwVW{l`uwrjYxImxpNWRiBxOf?jmM74QW3WLt_jdmN)@*H)rr`Os3E(L{l!M2HdrwW z3go#{v5|hZ0Ns6>Xyn#LFODnNRi8RtG=fscb;R>l6yO^A>ceJ<`wJ--L+lHE)ojs# zVsb{V&w)>HEDNk6$x2{-m=uBbOQ5$qsyx@eFIU9_vr=AxU)R4)2Cna4%D$RsY> zO=fV>&&%`;FA%vKmWjj-p~%`0ij)nF$k(EMWUhu)M52aJWNFbYWQvALylvwT;yR^=w%bV$kAH2kmeIS zG`~ejp$;`rM;fTU&e*511}qism`w+M^MfJQ|V4qY*hg8j--G5!pK$k-DQ1 zvyMirJsPq0XvEs1aq8cu!Y#K6B2h;v79WjRd^93IMCaYhav=)hyZFY}wmv+1YH_*KFC{*uVSQhr{$r=~~P9CuqUPP0+7DCaS zSqs5vZmq>L$I1QH!7wy)$>gqsK5p`bCYVp&0B!h}>!2NhK?GW_2QRGu!g}b5X7YM` zBslr{^)LWU!Fm`(l}A%$*A23A+YPeCaT{O=6;Gn#BO9O-URJXK7NGIB!8|lJo9tJG z4I)teX@kCKdS^fnG&3^f2)1W{AF8utJ|J@+O=sElMgEN%#UF@2ke%+>=+HhxrQO7z zKwSNRjc^^HboVBRf>J(a69hp8U%d&tSHbhh+}#AzQH5`YSD>8p%@B#^^Uc_PId|KF zkBxFZWs593zXhhEa>>N3p`1_8!~?LLS7ze#xSaQX9Z!RDp7J`3Lv!(U7>lN977kSB z@mY8?o$t)TRnhsSEWD@ATV>-TQ|F7w6lMdy{qtY4VH%ooTctU?6=tFOeJi%7^YL$B zL+|kNH?X01_+M|}@%;`TWQR#`foI!sL>G9K9mcqcJ!0?57oGzPe{mbcnqb*B1eM!l z{g&Hd2Jtq0;&$-n8QbAyyurKMaZGu<-98B zH$RXAZTYnv>`)%}-T{lztlk0Z&^*}zYtSs)i6hA4AMAvoXqqyZM3;7Co;kjJ4Z|tO z;~z16Smp5-9S{!1Jjnsw(d=@-3wXM=sDiHirUP1_|D6N+py{v+A3-I2^)8r+=GrcN z&X@3~yKsR^_~_j*3eC3N7~>`Uqun?wCESJMjZ642j@eEL&)_)ICA^N~l9uq!dvK&B zJaZ4c>Lv~ldl0YQ1O0gSw;+aqFFRE1#}oHrKd!t5fdqY6pOW^x&0ZLc7f;xW3v-TF z?8QYp$31g#hg{@Cb1`x+^5wZW8YkbMD|gR(xzG*OgIu`<`|Oi}uc2|5aXi+aRek2o zYxh9_fkpo8_SZhV$$oiRul+axCr{ch_r&r25Qgg3e%jRsq?vO-ZqLjE(7TzuD)L(gaR|fD$-g)xoAo`6>s!F*9LD`oz|S9s{%CF=hDC1Tz_qvI5r@Ht z#~i^n&vSkRZh>(b^Mi6 zFaa*{GpAq?nii+A<|RJ$G{nFqz34QYaDf^=_bjBLsXvSHUBhn_KmZ?f4!3s=-*OIe z(fFT-Of;v?V+_^smU);4)$oiw*ytu6BKGclqXhzaP(G$YHT>;-*a2mHXaTlg#(4p@ zSSD^dAB|rz){DJ>2Vfb0R15?8XBTi?%4mQ+op@}N(EwA)Kjy?luZ(|3W?-RIIKZ}i zXQ8ZoiBR(*oTqA@P=u3L&Hqt^FDf(3pa&mSjO$g+Hx)w?f4>ZZc{d$@!prev_DUW4 z^PT0;j#mrsE8%&R;DT23Atks})qD#X+1wo}X;+GQcs}1;is@fIcQ3;;CZ7hCQHF;` zJ`L(=8Mc~FgPK*2(VI_$I!*qaa-54oKC%LLQz0*?zzYlMCYFo1Wee#hdoMx=`ndEH z(cr3!TCY}OG#2q=l{kY%{B9-gxgv3N3`G-Ng}pA~jw+n@BL1KXG&k`b4Ob_q8fQJT z8t+iV>#Jqu=WFC0Cf2|lglB5xHH~W_i#|4bcWu-t)1mpG(L}Zqe*jenp~Po$ts@n8 zGJ!1aVk*s_iUSnrMj%iC`Qfq$f!-#NH|Q&rO_m2yd4IE98$cjLflvZr3WO6FroeCl zFDWpRz{?7ZCNNfk=&p@yV%!rHnMhTpC@_`43<2bq*O>(7m_QC?uBo(nRJ>4u7y_{h z#1V)mAU?Jx5J^;3k_e;%`i)eM`j;1dw0) ze<1Lq31t1BO{G0XPqhE5BEO-B;131P^H)RcTMaR{=i)T@>&q5THOe0)YzjAkbR?@$#hgA<)kRVmfSEe<9@`K?YEH zhzaC$4H8PG99=Pmz@dkmKo$=*l{O4LEFPgiIMt6-U<85D3XJuq^JlCgBIC!Kj8`Cz zz$67;ATULN9t5T-(3`*v1%e37QlLM9IS6btwqPQ2RTYt6VMpdGFpR)L1tJM7QeZTJ zSOrARh4)yZz$60k3QYB<{jVu9gQ_GdFq=TK0&@wZD6oJ)ssIJ9_>+bnw!6Xva-mk4 zN?T3E>jXG2_y2k#8IrgfkH6Q1l7I8sM8%mVkoU_nm6lD#b_KQ($WdSi0fz#+2<)-o z`coTk5!t7z>?d$Yfx`rjDR7*?DFsdwIIF-p0{IFQ5GYij=oKO*g2+GXl@h2hfgEh5 zP~vlfRz=0NCXmIKOr^a;#qUYL|NQ}^*=k(zvag8W6I=j!*?m)KUsLgS3VcuCp#qNx z{H(xZ0>3Ko8-YI*_)`L#)+oSeR0H%dFd8e+gg{dP zOd!V=VJd9|6-O#Cia?YCV+f2>U_60I3QQ(2O@ZkFw83X7GMlQ*RbU>0g$l$Fh*cnt zK)e9?Vk8L!5=|gSl58r?O2w%X$PJ!GWQD4-lE4}T))LsDfS5OomDdCipU1RK1Tsw^ z8_hD6mQBTW1-22eN6p2Rn6F6i7+2|2dX-BE}gaRiCoKfIy zV;tud$)hS46mSwKRzN3Era(D?N(HJ2)GAO%;IabmO0YbBD1YfH4EOjA2ZR6lp_THj zSHaKYcO~<$;yX%rC4O}WSTsuS!q= z-BF4CVGk7lzZ8f{#F)LG`X8v)h(rX~dl0%&0nK^fKcUlL(e!$16OA|@(NvKUryMHL z4jRz_8gXYdg}UvZ5a0$*{n&NzZsIM{3w!fKYfS8dxK%MpDT#671MkPT;QW027O{S~ zOS|^6N;C2AOiNQ^(&PFs#v0O~fGr+;ViTcueOSHvwyOh{gkwmL06 VF3G6VhTpQ`AIqG4QiMy}{|9sxH^~41 diff --git a/.doctrees/nbsphinx/notebooks/nmodl-kinetic-schemes.ipynb b/.doctrees/nbsphinx/notebooks/nmodl-kinetic-schemes.ipynb index 0b34dec98..ce45db613 100644 --- a/.doctrees/nbsphinx/notebooks/nmodl-kinetic-schemes.ipynb +++ b/.doctrees/nbsphinx/notebooks/nmodl-kinetic-schemes.ipynb @@ -152,10 +152,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:32.660499Z", - "iopub.status.busy": "2024-07-12T14:02:32.660305Z", - "iopub.status.idle": "2024-07-12T14:02:33.450144Z", - "shell.execute_reply": "2024-07-12T14:02:33.449274Z" + "iopub.execute_input": "2024-07-15T08:35:49.671242Z", + "iopub.status.busy": "2024-07-15T08:35:49.671055Z", + "iopub.status.idle": "2024-07-15T08:35:50.563590Z", + "shell.execute_reply": "2024-07-15T08:35:50.562728Z" } }, "outputs": [], @@ -169,10 +169,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:33.453425Z", - "iopub.status.busy": "2024-07-12T14:02:33.452968Z", - "iopub.status.idle": "2024-07-12T14:02:33.482731Z", - "shell.execute_reply": "2024-07-12T14:02:33.481973Z" + "iopub.execute_input": "2024-07-15T08:35:50.566737Z", + "iopub.status.busy": "2024-07-15T08:35:50.566516Z", + "iopub.status.idle": "2024-07-15T08:35:50.596189Z", + "shell.execute_reply": "2024-07-15T08:35:50.595419Z" } }, "outputs": [], @@ -277,10 +277,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:33.485504Z", - "iopub.status.busy": "2024-07-12T14:02:33.485252Z", - "iopub.status.idle": "2024-07-12T14:02:33.489968Z", - "shell.execute_reply": "2024-07-12T14:02:33.489322Z" + "iopub.execute_input": "2024-07-15T08:35:50.598803Z", + "iopub.status.busy": "2024-07-15T08:35:50.598592Z", + "iopub.status.idle": "2024-07-15T08:35:50.603550Z", + "shell.execute_reply": "2024-07-15T08:35:50.602900Z" } }, "outputs": [ @@ -323,10 +323,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:33.522368Z", - "iopub.status.busy": "2024-07-12T14:02:33.521813Z", - "iopub.status.idle": "2024-07-12T14:02:33.525742Z", - "shell.execute_reply": "2024-07-12T14:02:33.525040Z" + "iopub.execute_input": "2024-07-15T08:35:50.637043Z", + "iopub.status.busy": "2024-07-15T08:35:50.636825Z", + "iopub.status.idle": "2024-07-15T08:35:50.640979Z", + "shell.execute_reply": "2024-07-15T08:35:50.640292Z" } }, "outputs": [ @@ -367,10 +367,10 @@ "execution_count": 5, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:33.528410Z", - "iopub.status.busy": "2024-07-12T14:02:33.528036Z", - "iopub.status.idle": "2024-07-12T14:02:33.531651Z", - "shell.execute_reply": "2024-07-12T14:02:33.530985Z" + "iopub.execute_input": "2024-07-15T08:35:50.643445Z", + "iopub.status.busy": "2024-07-15T08:35:50.643055Z", + "iopub.status.idle": "2024-07-15T08:35:50.646991Z", + "shell.execute_reply": "2024-07-15T08:35:50.646312Z" }, "scrolled": true }, @@ -412,10 +412,10 @@ "execution_count": 6, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:33.534273Z", - "iopub.status.busy": "2024-07-12T14:02:33.533780Z", - "iopub.status.idle": "2024-07-12T14:02:33.537579Z", - "shell.execute_reply": "2024-07-12T14:02:33.536939Z" + "iopub.execute_input": "2024-07-15T08:35:50.649506Z", + "iopub.status.busy": "2024-07-15T08:35:50.649197Z", + "iopub.status.idle": "2024-07-15T08:35:50.653089Z", + "shell.execute_reply": "2024-07-15T08:35:50.652440Z" }, "scrolled": true }, @@ -459,10 +459,10 @@ "execution_count": 7, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:33.540068Z", - "iopub.status.busy": "2024-07-12T14:02:33.539667Z", - "iopub.status.idle": "2024-07-12T14:02:33.544484Z", - "shell.execute_reply": "2024-07-12T14:02:33.543803Z" + "iopub.execute_input": "2024-07-15T08:35:50.655743Z", + "iopub.status.busy": "2024-07-15T08:35:50.655346Z", + "iopub.status.idle": "2024-07-15T08:35:50.659721Z", + "shell.execute_reply": "2024-07-15T08:35:50.659042Z" } }, "outputs": [ diff --git a/.doctrees/nbsphinx/notebooks/nmodl-python-tutorial.ipynb b/.doctrees/nbsphinx/notebooks/nmodl-python-tutorial.ipynb index 22789c48b..0e24c9e2d 100644 --- a/.doctrees/nbsphinx/notebooks/nmodl-python-tutorial.ipynb +++ b/.doctrees/nbsphinx/notebooks/nmodl-python-tutorial.ipynb @@ -30,10 +30,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:42.130631Z", - "iopub.status.busy": "2024-07-12T14:02:42.130153Z", - "iopub.status.idle": "2024-07-12T14:02:42.918685Z", - "shell.execute_reply": "2024-07-12T14:02:42.917772Z" + "iopub.execute_input": "2024-07-15T08:35:56.049675Z", + "iopub.status.busy": "2024-07-15T08:35:56.049471Z", + "iopub.status.idle": "2024-07-15T08:35:56.839412Z", + "shell.execute_reply": "2024-07-15T08:35:56.838608Z" } }, "outputs": [], @@ -63,10 +63,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:42.922257Z", - "iopub.status.busy": "2024-07-12T14:02:42.921793Z", - "iopub.status.idle": "2024-07-12T14:02:42.950002Z", - "shell.execute_reply": "2024-07-12T14:02:42.949356Z" + "iopub.execute_input": "2024-07-15T08:35:56.842727Z", + "iopub.status.busy": "2024-07-15T08:35:56.842296Z", + "iopub.status.idle": "2024-07-15T08:35:56.870363Z", + "shell.execute_reply": "2024-07-15T08:35:56.869747Z" } }, "outputs": [], @@ -86,10 +86,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:42.952826Z", - "iopub.status.busy": "2024-07-12T14:02:42.952456Z", - "iopub.status.idle": "2024-07-12T14:02:42.956160Z", - "shell.execute_reply": "2024-07-12T14:02:42.955604Z" + "iopub.execute_input": "2024-07-15T08:35:56.873129Z", + "iopub.status.busy": "2024-07-15T08:35:56.872741Z", + "iopub.status.idle": "2024-07-15T08:35:56.876217Z", + "shell.execute_reply": "2024-07-15T08:35:56.875638Z" } }, "outputs": [], @@ -152,10 +152,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:42.958509Z", - "iopub.status.busy": "2024-07-12T14:02:42.958315Z", - "iopub.status.idle": "2024-07-12T14:02:42.962186Z", - "shell.execute_reply": "2024-07-12T14:02:42.961505Z" + "iopub.execute_input": "2024-07-15T08:35:56.878560Z", + "iopub.status.busy": "2024-07-15T08:35:56.878213Z", + "iopub.status.idle": "2024-07-15T08:35:56.882045Z", + "shell.execute_reply": "2024-07-15T08:35:56.881367Z" } }, "outputs": [], @@ -183,10 +183,10 @@ "execution_count": 5, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:42.964623Z", - "iopub.status.busy": "2024-07-12T14:02:42.964260Z", - "iopub.status.idle": "2024-07-12T14:02:42.967932Z", - "shell.execute_reply": "2024-07-12T14:02:42.967310Z" + "iopub.execute_input": "2024-07-15T08:35:56.884596Z", + "iopub.status.busy": "2024-07-15T08:35:56.884210Z", + "iopub.status.idle": "2024-07-15T08:35:56.888135Z", + "shell.execute_reply": "2024-07-15T08:35:56.887409Z" } }, "outputs": [ @@ -235,10 +235,10 @@ "execution_count": 6, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:42.970451Z", - "iopub.status.busy": "2024-07-12T14:02:42.970062Z", - "iopub.status.idle": "2024-07-12T14:02:42.973866Z", - "shell.execute_reply": "2024-07-12T14:02:42.973329Z" + "iopub.execute_input": "2024-07-15T08:35:56.890538Z", + "iopub.status.busy": "2024-07-15T08:35:56.890171Z", + "iopub.status.idle": "2024-07-15T08:35:56.894244Z", + "shell.execute_reply": "2024-07-15T08:35:56.893619Z" } }, "outputs": [], @@ -260,10 +260,10 @@ "execution_count": 7, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:42.976286Z", - "iopub.status.busy": "2024-07-12T14:02:42.975904Z", - "iopub.status.idle": "2024-07-12T14:02:42.979774Z", - "shell.execute_reply": "2024-07-12T14:02:42.979115Z" + "iopub.execute_input": "2024-07-15T08:35:56.896907Z", + "iopub.status.busy": "2024-07-15T08:35:56.896533Z", + "iopub.status.idle": "2024-07-15T08:35:56.900122Z", + "shell.execute_reply": "2024-07-15T08:35:56.899410Z" } }, "outputs": [ @@ -297,10 +297,10 @@ "execution_count": 8, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:42.982233Z", - "iopub.status.busy": "2024-07-12T14:02:42.981816Z", - "iopub.status.idle": "2024-07-12T14:02:42.989452Z", - "shell.execute_reply": "2024-07-12T14:02:42.988787Z" + "iopub.execute_input": "2024-07-15T08:35:56.902741Z", + "iopub.status.busy": "2024-07-15T08:35:56.902360Z", + "iopub.status.idle": "2024-07-15T08:35:56.909594Z", + "shell.execute_reply": "2024-07-15T08:35:56.908896Z" } }, "outputs": [ @@ -365,10 +365,10 @@ "execution_count": 9, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:42.991822Z", - "iopub.status.busy": "2024-07-12T14:02:42.991517Z", - "iopub.status.idle": "2024-07-12T14:02:42.996016Z", - "shell.execute_reply": "2024-07-12T14:02:42.995449Z" + "iopub.execute_input": "2024-07-15T08:35:56.912246Z", + "iopub.status.busy": "2024-07-15T08:35:56.911868Z", + "iopub.status.idle": "2024-07-15T08:35:56.916088Z", + "shell.execute_reply": "2024-07-15T08:35:56.915430Z" } }, "outputs": [ @@ -416,10 +416,10 @@ "execution_count": 10, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:42.998603Z", - "iopub.status.busy": "2024-07-12T14:02:42.998219Z", - "iopub.status.idle": "2024-07-12T14:02:43.001293Z", - "shell.execute_reply": "2024-07-12T14:02:43.000706Z" + "iopub.execute_input": "2024-07-15T08:35:56.918584Z", + "iopub.status.busy": "2024-07-15T08:35:56.918215Z", + "iopub.status.idle": "2024-07-15T08:35:56.921295Z", + "shell.execute_reply": "2024-07-15T08:35:56.920768Z" } }, "outputs": [], @@ -441,10 +441,10 @@ "execution_count": 11, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:43.003669Z", - "iopub.status.busy": "2024-07-12T14:02:43.003277Z", - "iopub.status.idle": "2024-07-12T14:02:43.006952Z", - "shell.execute_reply": "2024-07-12T14:02:43.006286Z" + "iopub.execute_input": "2024-07-15T08:35:56.923803Z", + "iopub.status.busy": "2024-07-15T08:35:56.923410Z", + "iopub.status.idle": "2024-07-15T08:35:56.927115Z", + "shell.execute_reply": "2024-07-15T08:35:56.926438Z" } }, "outputs": [ @@ -510,10 +510,10 @@ "execution_count": 12, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:43.009466Z", - "iopub.status.busy": "2024-07-12T14:02:43.009088Z", - "iopub.status.idle": "2024-07-12T14:02:43.012374Z", - "shell.execute_reply": "2024-07-12T14:02:43.011723Z" + "iopub.execute_input": "2024-07-15T08:35:56.929618Z", + "iopub.status.busy": "2024-07-15T08:35:56.929244Z", + "iopub.status.idle": "2024-07-15T08:35:56.932493Z", + "shell.execute_reply": "2024-07-15T08:35:56.931823Z" } }, "outputs": [ @@ -548,10 +548,10 @@ "execution_count": 13, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:43.014965Z", - "iopub.status.busy": "2024-07-12T14:02:43.014593Z", - "iopub.status.idle": "2024-07-12T14:02:43.018055Z", - "shell.execute_reply": "2024-07-12T14:02:43.017361Z" + "iopub.execute_input": "2024-07-15T08:35:56.934981Z", + "iopub.status.busy": "2024-07-15T08:35:56.934651Z", + "iopub.status.idle": "2024-07-15T08:35:56.938155Z", + "shell.execute_reply": "2024-07-15T08:35:56.937482Z" } }, "outputs": [ @@ -584,10 +584,10 @@ "execution_count": 14, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:43.020506Z", - "iopub.status.busy": "2024-07-12T14:02:43.020117Z", - "iopub.status.idle": "2024-07-12T14:02:43.023632Z", - "shell.execute_reply": "2024-07-12T14:02:43.022978Z" + "iopub.execute_input": "2024-07-15T08:35:56.940692Z", + "iopub.status.busy": "2024-07-15T08:35:56.940316Z", + "iopub.status.idle": "2024-07-15T08:35:56.943859Z", + "shell.execute_reply": "2024-07-15T08:35:56.943165Z" } }, "outputs": [ @@ -622,10 +622,10 @@ "execution_count": 15, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:43.026145Z", - "iopub.status.busy": "2024-07-12T14:02:43.025758Z", - "iopub.status.idle": "2024-07-12T14:02:43.029794Z", - "shell.execute_reply": "2024-07-12T14:02:43.029124Z" + "iopub.execute_input": "2024-07-15T08:35:56.946382Z", + "iopub.status.busy": "2024-07-15T08:35:56.946005Z", + "iopub.status.idle": "2024-07-15T08:35:56.949953Z", + "shell.execute_reply": "2024-07-15T08:35:56.949286Z" } }, "outputs": [ @@ -669,10 +669,10 @@ "execution_count": 16, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:43.032338Z", - "iopub.status.busy": "2024-07-12T14:02:43.031956Z", - "iopub.status.idle": "2024-07-12T14:02:43.037191Z", - "shell.execute_reply": "2024-07-12T14:02:43.036526Z" + "iopub.execute_input": "2024-07-15T08:35:56.952266Z", + "iopub.status.busy": "2024-07-15T08:35:56.952068Z", + "iopub.status.idle": "2024-07-15T08:35:56.957340Z", + "shell.execute_reply": "2024-07-15T08:35:56.956666Z" } }, "outputs": [ @@ -733,10 +733,10 @@ "execution_count": 17, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:43.039701Z", - "iopub.status.busy": "2024-07-12T14:02:43.039320Z", - "iopub.status.idle": "2024-07-12T14:02:43.042885Z", - "shell.execute_reply": "2024-07-12T14:02:43.042236Z" + "iopub.execute_input": "2024-07-15T08:35:56.959865Z", + "iopub.status.busy": "2024-07-15T08:35:56.959494Z", + "iopub.status.idle": "2024-07-15T08:35:56.963077Z", + "shell.execute_reply": "2024-07-15T08:35:56.962432Z" } }, "outputs": [], @@ -761,10 +761,10 @@ "execution_count": 18, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:43.045341Z", - "iopub.status.busy": "2024-07-12T14:02:43.044872Z", - "iopub.status.idle": "2024-07-12T14:02:43.055075Z", - "shell.execute_reply": "2024-07-12T14:02:43.054422Z" + "iopub.execute_input": "2024-07-15T08:35:56.965483Z", + "iopub.status.busy": "2024-07-15T08:35:56.965098Z", + "iopub.status.idle": "2024-07-15T08:35:56.975172Z", + "shell.execute_reply": "2024-07-15T08:35:56.974587Z" } }, "outputs": [], @@ -857,10 +857,10 @@ "execution_count": 19, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:43.057617Z", - "iopub.status.busy": "2024-07-12T14:02:43.057254Z", - "iopub.status.idle": "2024-07-12T14:02:43.060894Z", - "shell.execute_reply": "2024-07-12T14:02:43.060228Z" + "iopub.execute_input": "2024-07-15T08:35:56.977566Z", + "iopub.status.busy": "2024-07-15T08:35:56.977237Z", + "iopub.status.idle": "2024-07-15T08:35:56.980917Z", + "shell.execute_reply": "2024-07-15T08:35:56.980257Z" } }, "outputs": [ @@ -897,10 +897,10 @@ "execution_count": 20, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:43.063428Z", - "iopub.status.busy": "2024-07-12T14:02:43.063043Z", - "iopub.status.idle": "2024-07-12T14:02:43.068835Z", - "shell.execute_reply": "2024-07-12T14:02:43.068193Z" + "iopub.execute_input": "2024-07-15T08:35:56.983395Z", + "iopub.status.busy": "2024-07-15T08:35:56.983038Z", + "iopub.status.idle": "2024-07-15T08:35:56.988564Z", + "shell.execute_reply": "2024-07-15T08:35:56.987903Z" } }, "outputs": [ diff --git a/.doctrees/nbsphinx/notebooks/nmodl-sympy-conductance.ipynb b/.doctrees/nbsphinx/notebooks/nmodl-sympy-conductance.ipynb index 7a036f787..acab6b387 100644 --- a/.doctrees/nbsphinx/notebooks/nmodl-sympy-conductance.ipynb +++ b/.doctrees/nbsphinx/notebooks/nmodl-sympy-conductance.ipynb @@ -86,10 +86,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:45.578799Z", - "iopub.status.busy": "2024-07-12T14:02:45.578600Z", - "iopub.status.idle": "2024-07-12T14:02:46.371542Z", - "shell.execute_reply": "2024-07-12T14:02:46.370575Z" + "iopub.execute_input": "2024-07-15T08:35:59.456021Z", + "iopub.status.busy": "2024-07-15T08:35:59.455813Z", + "iopub.status.idle": "2024-07-15T08:36:00.241945Z", + "shell.execute_reply": "2024-07-15T08:36:00.241043Z" } }, "outputs": [], @@ -103,10 +103,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:46.374971Z", - "iopub.status.busy": "2024-07-12T14:02:46.374535Z", - "iopub.status.idle": "2024-07-12T14:02:46.408459Z", - "shell.execute_reply": "2024-07-12T14:02:46.407590Z" + "iopub.execute_input": "2024-07-15T08:36:00.245157Z", + "iopub.status.busy": "2024-07-15T08:36:00.244936Z", + "iopub.status.idle": "2024-07-15T08:36:00.275293Z", + "shell.execute_reply": "2024-07-15T08:36:00.274672Z" } }, "outputs": [], @@ -149,10 +149,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:46.411530Z", - "iopub.status.busy": "2024-07-12T14:02:46.411259Z", - "iopub.status.idle": "2024-07-12T14:02:46.683993Z", - "shell.execute_reply": "2024-07-12T14:02:46.683248Z" + "iopub.execute_input": "2024-07-15T08:36:00.278067Z", + "iopub.status.busy": "2024-07-15T08:36:00.277583Z", + "iopub.status.idle": "2024-07-15T08:36:00.546016Z", + "shell.execute_reply": "2024-07-15T08:36:00.545327Z" } }, "outputs": [ @@ -196,10 +196,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:46.686530Z", - "iopub.status.busy": "2024-07-12T14:02:46.686297Z", - "iopub.status.idle": "2024-07-12T14:02:46.819028Z", - "shell.execute_reply": "2024-07-12T14:02:46.818183Z" + "iopub.execute_input": "2024-07-15T08:36:00.548875Z", + "iopub.status.busy": "2024-07-15T08:36:00.548472Z", + "iopub.status.idle": "2024-07-15T08:36:00.680237Z", + "shell.execute_reply": "2024-07-15T08:36:00.679583Z" } }, "outputs": [ @@ -243,10 +243,10 @@ "execution_count": 5, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:46.821986Z", - "iopub.status.busy": "2024-07-12T14:02:46.821462Z", - "iopub.status.idle": "2024-07-12T14:02:46.830251Z", - "shell.execute_reply": "2024-07-12T14:02:46.829560Z" + "iopub.execute_input": "2024-07-15T08:36:00.682918Z", + "iopub.status.busy": "2024-07-15T08:36:00.682535Z", + "iopub.status.idle": "2024-07-15T08:36:00.690181Z", + "shell.execute_reply": "2024-07-15T08:36:00.689513Z" } }, "outputs": [ @@ -290,10 +290,10 @@ "execution_count": 6, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:46.832686Z", - "iopub.status.busy": "2024-07-12T14:02:46.832316Z", - "iopub.status.idle": "2024-07-12T14:02:46.850361Z", - "shell.execute_reply": "2024-07-12T14:02:46.849762Z" + "iopub.execute_input": "2024-07-15T08:36:00.692900Z", + "iopub.status.busy": "2024-07-15T08:36:00.692520Z", + "iopub.status.idle": "2024-07-15T08:36:00.710209Z", + "shell.execute_reply": "2024-07-15T08:36:00.709621Z" } }, "outputs": [ @@ -337,10 +337,10 @@ "execution_count": 7, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:46.853025Z", - "iopub.status.busy": "2024-07-12T14:02:46.852545Z", - "iopub.status.idle": "2024-07-12T14:02:46.970028Z", - "shell.execute_reply": "2024-07-12T14:02:46.969308Z" + "iopub.execute_input": "2024-07-15T08:36:00.712794Z", + "iopub.status.busy": "2024-07-15T08:36:00.712416Z", + "iopub.status.idle": "2024-07-15T08:36:00.831935Z", + "shell.execute_reply": "2024-07-15T08:36:00.831310Z" } }, "outputs": [ @@ -400,10 +400,10 @@ "execution_count": 8, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:46.972610Z", - "iopub.status.busy": "2024-07-12T14:02:46.972408Z", - "iopub.status.idle": "2024-07-12T14:02:47.066874Z", - "shell.execute_reply": "2024-07-12T14:02:47.066202Z" + "iopub.execute_input": "2024-07-15T08:36:00.834409Z", + "iopub.status.busy": "2024-07-15T08:36:00.834024Z", + "iopub.status.idle": "2024-07-15T08:36:00.928545Z", + "shell.execute_reply": "2024-07-15T08:36:00.927966Z" } }, "outputs": [ @@ -456,10 +456,10 @@ "execution_count": 9, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:47.069430Z", - "iopub.status.busy": "2024-07-12T14:02:47.069062Z", - "iopub.status.idle": "2024-07-12T14:02:47.143051Z", - "shell.execute_reply": "2024-07-12T14:02:47.142389Z" + "iopub.execute_input": "2024-07-15T08:36:00.931040Z", + "iopub.status.busy": "2024-07-15T08:36:00.930656Z", + "iopub.status.idle": "2024-07-15T08:36:01.004508Z", + "shell.execute_reply": "2024-07-15T08:36:01.003885Z" } }, "outputs": [ diff --git a/.doctrees/nbsphinx/notebooks/nmodl-sympy-solver-cnexp.ipynb b/.doctrees/nbsphinx/notebooks/nmodl-sympy-solver-cnexp.ipynb index 1a96fdf9b..a1680e4a3 100644 --- a/.doctrees/nbsphinx/notebooks/nmodl-sympy-solver-cnexp.ipynb +++ b/.doctrees/nbsphinx/notebooks/nmodl-sympy-solver-cnexp.ipynb @@ -62,10 +62,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:49.058507Z", - "iopub.status.busy": "2024-07-12T14:02:49.058304Z", - "iopub.status.idle": "2024-07-12T14:02:49.854439Z", - "shell.execute_reply": "2024-07-12T14:02:49.853537Z" + "iopub.execute_input": "2024-07-15T08:36:02.923125Z", + "iopub.status.busy": "2024-07-15T08:36:02.922935Z", + "iopub.status.idle": "2024-07-15T08:36:03.706385Z", + "shell.execute_reply": "2024-07-15T08:36:03.705640Z" } }, "outputs": [], @@ -79,10 +79,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:49.857718Z", - "iopub.status.busy": "2024-07-12T14:02:49.857287Z", - "iopub.status.idle": "2024-07-12T14:02:49.887417Z", - "shell.execute_reply": "2024-07-12T14:02:49.886789Z" + "iopub.execute_input": "2024-07-15T08:36:03.709562Z", + "iopub.status.busy": "2024-07-15T08:36:03.709174Z", + "iopub.status.idle": "2024-07-15T08:36:03.739233Z", + "shell.execute_reply": "2024-07-15T08:36:03.738508Z" } }, "outputs": [], @@ -123,10 +123,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:49.890225Z", - "iopub.status.busy": "2024-07-12T14:02:49.889826Z", - "iopub.status.idle": "2024-07-12T14:02:50.307079Z", - "shell.execute_reply": "2024-07-12T14:02:50.306269Z" + "iopub.execute_input": "2024-07-15T08:36:03.741995Z", + "iopub.status.busy": "2024-07-15T08:36:03.741785Z", + "iopub.status.idle": "2024-07-15T08:36:04.157333Z", + "shell.execute_reply": "2024-07-15T08:36:04.156592Z" } }, "outputs": [ @@ -165,10 +165,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:50.309964Z", - "iopub.status.busy": "2024-07-12T14:02:50.309483Z", - "iopub.status.idle": "2024-07-12T14:02:50.420565Z", - "shell.execute_reply": "2024-07-12T14:02:50.419955Z" + "iopub.execute_input": "2024-07-15T08:36:04.160377Z", + "iopub.status.busy": "2024-07-15T08:36:04.159903Z", + "iopub.status.idle": "2024-07-15T08:36:04.272371Z", + "shell.execute_reply": "2024-07-15T08:36:04.271668Z" } }, "outputs": [ @@ -207,10 +207,10 @@ "execution_count": 5, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:50.423245Z", - "iopub.status.busy": "2024-07-12T14:02:50.422839Z", - "iopub.status.idle": "2024-07-12T14:02:50.619519Z", - "shell.execute_reply": "2024-07-12T14:02:50.618878Z" + "iopub.execute_input": "2024-07-15T08:36:04.274861Z", + "iopub.status.busy": "2024-07-15T08:36:04.274660Z", + "iopub.status.idle": "2024-07-15T08:36:04.481294Z", + "shell.execute_reply": "2024-07-15T08:36:04.480699Z" } }, "outputs": [ @@ -255,10 +255,10 @@ "execution_count": 6, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:50.622294Z", - "iopub.status.busy": "2024-07-12T14:02:50.621819Z", - "iopub.status.idle": "2024-07-12T14:02:50.779053Z", - "shell.execute_reply": "2024-07-12T14:02:50.778415Z" + "iopub.execute_input": "2024-07-15T08:36:04.483757Z", + "iopub.status.busy": "2024-07-15T08:36:04.483539Z", + "iopub.status.idle": "2024-07-15T08:36:04.644712Z", + "shell.execute_reply": "2024-07-15T08:36:04.644006Z" } }, "outputs": [ @@ -303,10 +303,10 @@ "execution_count": 7, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:50.781600Z", - "iopub.status.busy": "2024-07-12T14:02:50.781184Z", - "iopub.status.idle": "2024-07-12T14:02:52.536734Z", - "shell.execute_reply": "2024-07-12T14:02:52.536006Z" + "iopub.execute_input": "2024-07-15T08:36:04.647242Z", + "iopub.status.busy": "2024-07-15T08:36:04.647030Z", + "iopub.status.idle": "2024-07-15T08:36:06.394817Z", + "shell.execute_reply": "2024-07-15T08:36:06.394179Z" } }, "outputs": [ @@ -351,10 +351,10 @@ "execution_count": 8, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:52.539339Z", - "iopub.status.busy": "2024-07-12T14:02:52.539135Z", - "iopub.status.idle": "2024-07-12T14:02:54.724911Z", - "shell.execute_reply": "2024-07-12T14:02:54.724178Z" + "iopub.execute_input": "2024-07-15T08:36:06.397287Z", + "iopub.status.busy": "2024-07-15T08:36:06.397082Z", + "iopub.status.idle": "2024-07-15T08:36:08.663862Z", + "shell.execute_reply": "2024-07-15T08:36:08.663252Z" } }, "outputs": [ diff --git a/.doctrees/nbsphinx/notebooks/nmodl-sympy-solver-derivimplicit.ipynb b/.doctrees/nbsphinx/notebooks/nmodl-sympy-solver-derivimplicit.ipynb index 644fe6d59..4213374b6 100644 --- a/.doctrees/nbsphinx/notebooks/nmodl-sympy-solver-derivimplicit.ipynb +++ b/.doctrees/nbsphinx/notebooks/nmodl-sympy-solver-derivimplicit.ipynb @@ -39,10 +39,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:56.495316Z", - "iopub.status.busy": "2024-07-12T14:02:56.495121Z", - "iopub.status.idle": "2024-07-12T14:02:57.311811Z", - "shell.execute_reply": "2024-07-12T14:02:57.311053Z" + "iopub.execute_input": "2024-07-15T08:36:10.289503Z", + "iopub.status.busy": "2024-07-15T08:36:10.288910Z", + "iopub.status.idle": "2024-07-15T08:36:11.072528Z", + "shell.execute_reply": "2024-07-15T08:36:11.071753Z" } }, "outputs": [], @@ -56,10 +56,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:57.315108Z", - "iopub.status.busy": "2024-07-12T14:02:57.314673Z", - "iopub.status.idle": "2024-07-12T14:02:57.344651Z", - "shell.execute_reply": "2024-07-12T14:02:57.343898Z" + "iopub.execute_input": "2024-07-15T08:36:11.075716Z", + "iopub.status.busy": "2024-07-15T08:36:11.075423Z", + "iopub.status.idle": "2024-07-15T08:36:11.105140Z", + "shell.execute_reply": "2024-07-15T08:36:11.104517Z" } }, "outputs": [], @@ -100,10 +100,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:57.347677Z", - "iopub.status.busy": "2024-07-12T14:02:57.347293Z", - "iopub.status.idle": "2024-07-12T14:02:57.805988Z", - "shell.execute_reply": "2024-07-12T14:02:57.805272Z" + "iopub.execute_input": "2024-07-15T08:36:11.107995Z", + "iopub.status.busy": "2024-07-15T08:36:11.107600Z", + "iopub.status.idle": "2024-07-15T08:36:11.568097Z", + "shell.execute_reply": "2024-07-15T08:36:11.567391Z" } }, "outputs": [ @@ -165,10 +165,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:57.808767Z", - "iopub.status.busy": "2024-07-12T14:02:57.808352Z", - "iopub.status.idle": "2024-07-12T14:02:58.024800Z", - "shell.execute_reply": "2024-07-12T14:02:58.024154Z" + "iopub.execute_input": "2024-07-15T08:36:11.571010Z", + "iopub.status.busy": "2024-07-15T08:36:11.570577Z", + "iopub.status.idle": "2024-07-15T08:36:11.786533Z", + "shell.execute_reply": "2024-07-15T08:36:11.785890Z" } }, "outputs": [ diff --git a/.doctrees/nbsphinx/notebooks/nmodl-sympy-solver-sparse.ipynb b/.doctrees/nbsphinx/notebooks/nmodl-sympy-solver-sparse.ipynb index 2dc04380e..a0013479b 100644 --- a/.doctrees/nbsphinx/notebooks/nmodl-sympy-solver-sparse.ipynb +++ b/.doctrees/nbsphinx/notebooks/nmodl-sympy-solver-sparse.ipynb @@ -39,10 +39,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:59.532310Z", - "iopub.status.busy": "2024-07-12T14:02:59.532114Z", - "iopub.status.idle": "2024-07-12T14:03:00.340512Z", - "shell.execute_reply": "2024-07-12T14:03:00.339611Z" + "iopub.execute_input": "2024-07-15T08:36:13.273561Z", + "iopub.status.busy": "2024-07-15T08:36:13.273004Z", + "iopub.status.idle": "2024-07-15T08:36:14.055222Z", + "shell.execute_reply": "2024-07-15T08:36:14.054418Z" } }, "outputs": [], @@ -56,10 +56,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:03:00.343576Z", - "iopub.status.busy": "2024-07-12T14:03:00.343361Z", - "iopub.status.idle": "2024-07-12T14:03:00.373520Z", - "shell.execute_reply": "2024-07-12T14:03:00.372722Z" + "iopub.execute_input": "2024-07-15T08:36:14.058506Z", + "iopub.status.busy": "2024-07-15T08:36:14.058073Z", + "iopub.status.idle": "2024-07-15T08:36:14.088084Z", + "shell.execute_reply": "2024-07-15T08:36:14.087449Z" } }, "outputs": [], @@ -100,10 +100,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:03:00.376862Z", - "iopub.status.busy": "2024-07-12T14:03:00.376451Z", - "iopub.status.idle": "2024-07-12T14:03:00.839981Z", - "shell.execute_reply": "2024-07-12T14:03:00.839202Z" + "iopub.execute_input": "2024-07-15T08:36:14.090804Z", + "iopub.status.busy": "2024-07-15T08:36:14.090422Z", + "iopub.status.idle": "2024-07-15T08:36:14.552245Z", + "shell.execute_reply": "2024-07-15T08:36:14.551490Z" } }, "outputs": [ @@ -165,10 +165,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:03:00.842550Z", - "iopub.status.busy": "2024-07-12T14:03:00.842305Z", - "iopub.status.idle": "2024-07-12T14:03:01.058641Z", - "shell.execute_reply": "2024-07-12T14:03:01.057940Z" + "iopub.execute_input": "2024-07-15T08:36:14.555109Z", + "iopub.status.busy": "2024-07-15T08:36:14.554848Z", + "iopub.status.idle": "2024-07-15T08:36:14.770763Z", + "shell.execute_reply": "2024-07-15T08:36:14.770107Z" } }, "outputs": [ diff --git a/doxygen/classnmodl_1_1codegen_1_1_codegen_acc_visitor-members.html b/doxygen/classnmodl_1_1codegen_1_1_codegen_acc_visitor-members.html index bcc925d80..0010d95c3 100644 --- a/doxygen/classnmodl_1_1codegen_1_1_codegen_acc_visitor-members.html +++ b/doxygen/classnmodl_1_1codegen_1_1_codegen_acc_visitor-members.html @@ -314,7 +314,7 @@ simulator_name() overridenmodl::codegen::CodegenCoreneuronCppVisitorprotectedvirtual statement_to_skip(const ast::Statement &node)nmodl::codegen::CodegenCppVisitorprotectedstatic SymbolType typedefnmodl::codegen::CodegenCppVisitorprotected - table_function_prefix() constnmodl::codegen::CodegenCppVisitorprotected + table_update_function_name(const std::string &block_name) constnmodl::codegen::CodegenCppVisitorprotected thread_variables_struct() constnmodl::codegen::CodegenCppVisitorinlineprotected update_if_ion_variable_name(const std::string &name) constnmodl::codegen::CodegenCppVisitorprotected update_index_semantics()nmodl::codegen::CodegenCppVisitorprotected diff --git a/doxygen/classnmodl_1_1codegen_1_1_codegen_acc_visitor.html b/doxygen/classnmodl_1_1codegen_1_1_codegen_acc_visitor.html index 63f2d164f..4248a8e7c 100644 --- a/doxygen/classnmodl_1_1codegen_1_1_codegen_acc_visitor.html +++ b/doxygen/classnmodl_1_1codegen_1_1_codegen_acc_visitor.html @@ -675,9 +675,9 @@ std::string update_if_ion_variable_name (const std::string &name) const  Determine the updated name if the ion variable has been optimized. More...
  -std::string table_function_prefix () const - Prefix used for the function that performs the lazy update. More...
-  +std::string table_update_function_name (const std::string &block_name) const + The name of the function that updates the table value if the parameters changed. More...
+  int get_int_variable_index (const std::string &var_name)   void print_backend_info () diff --git a/doxygen/classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor-members.html b/doxygen/classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor-members.html index 7e23be713..2512051ea 100644 --- a/doxygen/classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor-members.html +++ b/doxygen/classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor-members.html @@ -314,7 +314,7 @@ simulator_name() overridenmodl::codegen::CodegenCoreneuronCppVisitorprotectedvirtual statement_to_skip(const ast::Statement &node)nmodl::codegen::CodegenCppVisitorprotectedstatic SymbolType typedefnmodl::codegen::CodegenCppVisitorprotected - table_function_prefix() constnmodl::codegen::CodegenCppVisitorprotected + table_update_function_name(const std::string &block_name) constnmodl::codegen::CodegenCppVisitorprotected thread_variables_struct() constnmodl::codegen::CodegenCppVisitorinlineprotected update_if_ion_variable_name(const std::string &name) constnmodl::codegen::CodegenCppVisitorprotected update_index_semantics()nmodl::codegen::CodegenCppVisitorprotected diff --git a/doxygen/classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html b/doxygen/classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html index fd3978b9c..1473c5c57 100644 --- a/doxygen/classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html +++ b/doxygen/classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html @@ -1083,9 +1083,9 @@ std::string update_if_ion_variable_name (const std::string &name) const  Determine the updated name if the ion variable has been optimized. More...
  -std::string table_function_prefix () const - Prefix used for the function that performs the lazy update. More...
-  +std::string table_update_function_name (const std::string &block_name) const + The name of the function that updates the table value if the parameters changed. More...
+  int get_int_variable_index (const std::string &var_name)   void print_backend_info () diff --git a/doxygen/classnmodl_1_1codegen_1_1_codegen_cpp_visitor-members.html b/doxygen/classnmodl_1_1codegen_1_1_codegen_cpp_visitor-members.html index e34da57a5..f03244428 100644 --- a/doxygen/classnmodl_1_1codegen_1_1_codegen_cpp_visitor-members.html +++ b/doxygen/classnmodl_1_1codegen_1_1_codegen_cpp_visitor-members.html @@ -243,7 +243,7 @@ simulator_name()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual statement_to_skip(const ast::Statement &node)nmodl::codegen::CodegenCppVisitorprotectedstatic SymbolType typedefnmodl::codegen::CodegenCppVisitorprotected - table_function_prefix() constnmodl::codegen::CodegenCppVisitorprotected + table_update_function_name(const std::string &block_name) constnmodl::codegen::CodegenCppVisitorprotected thread_variables_struct() constnmodl::codegen::CodegenCppVisitorinlineprotected update_if_ion_variable_name(const std::string &name) constnmodl::codegen::CodegenCppVisitorprotected update_index_semantics()nmodl::codegen::CodegenCppVisitorprotected diff --git a/doxygen/classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html b/doxygen/classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html index 37024ca23..5b9b87ae1 100644 --- a/doxygen/classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html +++ b/doxygen/classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html @@ -799,9 +799,9 @@ virtual std::string get_variable_name (const std::string &name, bool use_instance=true) const =0  Determine variable name in the structure of mechanism properties. More...
  -std::string table_function_prefix () const - Prefix used for the function that performs the lazy update. More...
-  +std::string table_update_function_name (const std::string &block_name) const + The name of the function that updates the table value if the parameters changed. More...
+  int get_int_variable_index (const std::string &var_name)   void print_backend_info () @@ -1522,7 +1522,7 @@

Returns
return a tuple <true, array_length> if variable is an array otherwise <false, 0>
-

Definition at line 1633 of file codegen_cpp_visitor.cpp.

+

Definition at line 1632 of file codegen_cpp_visitor.cpp.

@@ -2114,7 +2114,7 @@

-

Definition at line 1608 of file codegen_cpp_visitor.cpp.

+

Definition at line 1607 of file codegen_cpp_visitor.cpp.

@@ -2172,7 +2172,7 @@

-

Definition at line 1620 of file codegen_cpp_visitor.cpp.

+

Definition at line 1619 of file codegen_cpp_visitor.cpp.

@@ -5394,8 +5394,8 @@

-

◆ table_function_prefix()

+ +

◆ table_update_function_name()

-

Definition at line 1359 of file codegen_cpp_visitor.hpp.

+

Definition at line 1361 of file codegen_cpp_visitor.hpp.

diff --git a/doxygen/classnmodl_1_1codegen_1_1_codegen_cpp_visitor.js b/doxygen/classnmodl_1_1codegen_1_1_codegen_cpp_visitor.js index 56077d592..9ef89e9f5 100644 --- a/doxygen/classnmodl_1_1codegen_1_1_codegen_cpp_visitor.js +++ b/doxygen/classnmodl_1_1codegen_1_1_codegen_cpp_visitor.js @@ -130,7 +130,7 @@ var classnmodl_1_1codegen_1_1_codegen_cpp_visitor = [ "setup", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ae333398890c61148ec60cb52c3d28c10", null ], [ "simulator_name", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a8b8b75dcd53ae8e3a641f18cb00bee1d", null ], [ "statement_to_skip", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a789dae2310c3496443a8a51c26cc8b71", null ], - [ "table_function_prefix", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ab516d94c30f043b502152544cde2d563", null ], + [ "table_update_function_name", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a93358fcb6712a4ac8c1565529821b340", null ], [ "thread_variables_struct", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a1c3e5aa67b1f486463340b8102b95e81", null ], [ "update_if_ion_variable_name", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aba3a9521ace5f09f4d2263e4401b33ee", null ], [ "update_index_semantics", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ae0d8d4e346e244c764911c0c64c2ac1c", null ], diff --git a/doxygen/classnmodl_1_1codegen_1_1_codegen_helper_visitor.html b/doxygen/classnmodl_1_1codegen_1_1_codegen_helper_visitor.html index 77362902f..d8c647d8c 100644 --- a/doxygen/classnmodl_1_1codegen_1_1_codegen_helper_visitor.html +++ b/doxygen/classnmodl_1_1codegen_1_1_codegen_helper_visitor.html @@ -757,7 +757,7 @@

Definition at line 734 of file codegen_helper_visitor.cpp.

+

Definition at line 744 of file codegen_helper_visitor.cpp.

@@ -818,7 +818,7 @@

-

Definition at line 470 of file codegen_helper_visitor.cpp.

+

Definition at line 480 of file codegen_helper_visitor.cpp.

@@ -861,7 +861,7 @@

Definition at line 153 of file codegen_helper_visitor.cpp.

+

Definition at line 163 of file codegen_helper_visitor.cpp.

@@ -931,7 +931,7 @@

Definition at line 346 of file codegen_helper_visitor.cpp.

+

Definition at line 356 of file codegen_helper_visitor.cpp.

@@ -958,7 +958,7 @@

-

Definition at line 463 of file codegen_helper_visitor.cpp.

+

Definition at line 473 of file codegen_helper_visitor.cpp.

@@ -1025,7 +1025,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 778 of file codegen_helper_visitor.cpp.

+

Definition at line 788 of file codegen_helper_visitor.cpp.

@@ -1057,7 +1057,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 689 of file codegen_helper_visitor.cpp.

+

Definition at line 699 of file codegen_helper_visitor.cpp.

@@ -1089,7 +1089,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 774 of file codegen_helper_visitor.cpp.

+

Definition at line 784 of file codegen_helper_visitor.cpp.

@@ -1121,7 +1121,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 680 of file codegen_helper_visitor.cpp.

+

Definition at line 690 of file codegen_helper_visitor.cpp.

@@ -1153,7 +1153,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 543 of file codegen_helper_visitor.cpp.

+

Definition at line 553 of file codegen_helper_visitor.cpp.

@@ -1185,7 +1185,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 612 of file codegen_helper_visitor.cpp.

+

Definition at line 622 of file codegen_helper_visitor.cpp.

@@ -1217,7 +1217,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 511 of file codegen_helper_visitor.cpp.

+

Definition at line 521 of file codegen_helper_visitor.cpp.

@@ -1249,7 +1249,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 532 of file codegen_helper_visitor.cpp.

+

Definition at line 542 of file codegen_helper_visitor.cpp.

@@ -1281,7 +1281,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 538 of file codegen_helper_visitor.cpp.

+

Definition at line 548 of file codegen_helper_visitor.cpp.

@@ -1313,7 +1313,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 517 of file codegen_helper_visitor.cpp.

+

Definition at line 527 of file codegen_helper_visitor.cpp.

@@ -1345,7 +1345,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 747 of file codegen_helper_visitor.cpp.

+

Definition at line 757 of file codegen_helper_visitor.cpp.

@@ -1377,7 +1377,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 595 of file codegen_helper_visitor.cpp.

+

Definition at line 605 of file codegen_helper_visitor.cpp.

@@ -1409,7 +1409,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 582 of file codegen_helper_visitor.cpp.

+

Definition at line 592 of file codegen_helper_visitor.cpp.

@@ -1441,7 +1441,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 496 of file codegen_helper_visitor.cpp.

+

Definition at line 506 of file codegen_helper_visitor.cpp.

@@ -1473,7 +1473,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 675 of file codegen_helper_visitor.cpp.

+

Definition at line 685 of file codegen_helper_visitor.cpp.

@@ -1505,7 +1505,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 705 of file codegen_helper_visitor.cpp.

+

Definition at line 715 of file codegen_helper_visitor.cpp.

@@ -1537,7 +1537,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 567 of file codegen_helper_visitor.cpp.

+

Definition at line 577 of file codegen_helper_visitor.cpp.

@@ -1569,7 +1569,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 601 of file codegen_helper_visitor.cpp.

+

Definition at line 611 of file codegen_helper_visitor.cpp.

@@ -1601,7 +1601,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 577 of file codegen_helper_visitor.cpp.

+

Definition at line 587 of file codegen_helper_visitor.cpp.

@@ -1633,7 +1633,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 501 of file codegen_helper_visitor.cpp.

+

Definition at line 511 of file codegen_helper_visitor.cpp.

@@ -1665,7 +1665,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 739 of file codegen_helper_visitor.cpp.

+

Definition at line 749 of file codegen_helper_visitor.cpp.

@@ -1697,7 +1697,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 523 of file codegen_helper_visitor.cpp.

+

Definition at line 533 of file codegen_helper_visitor.cpp.

@@ -1729,7 +1729,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 743 of file codegen_helper_visitor.cpp.

+

Definition at line 753 of file codegen_helper_visitor.cpp.

@@ -1761,7 +1761,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 551 of file codegen_helper_visitor.cpp.

+

Definition at line 561 of file codegen_helper_visitor.cpp.

@@ -1793,7 +1793,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 557 of file codegen_helper_visitor.cpp.

+

Definition at line 567 of file codegen_helper_visitor.cpp.

@@ -1825,7 +1825,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 716 of file codegen_helper_visitor.cpp.

+

Definition at line 726 of file codegen_helper_visitor.cpp.

@@ -1860,7 +1860,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 644 of file codegen_helper_visitor.cpp.

+

Definition at line 654 of file codegen_helper_visitor.cpp.

@@ -1892,7 +1892,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 484 of file codegen_helper_visitor.cpp.

+

Definition at line 494 of file codegen_helper_visitor.cpp.

@@ -1924,7 +1924,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 710 of file codegen_helper_visitor.cpp.

+

Definition at line 720 of file codegen_helper_visitor.cpp.

@@ -1956,7 +1956,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 751 of file codegen_helper_visitor.cpp.

+

Definition at line 761 of file codegen_helper_visitor.cpp.

@@ -1988,7 +1988,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 756 of file codegen_helper_visitor.cpp.

+

Definition at line 766 of file codegen_helper_visitor.cpp.

@@ -2020,7 +2020,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 694 of file codegen_helper_visitor.cpp.

+

Definition at line 704 of file codegen_helper_visitor.cpp.

@@ -2052,7 +2052,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 699 of file codegen_helper_visitor.cpp.

+

Definition at line 709 of file codegen_helper_visitor.cpp.

diff --git a/doxygen/classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor-members.html b/doxygen/classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor-members.html index f2bca0514..b322b2b9d 100644 --- a/doxygen/classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor-members.html +++ b/doxygen/classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor-members.html @@ -272,8 +272,8 @@ simulator_name() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual statement_to_skip(const ast::Statement &node)nmodl::codegen::CodegenCppVisitorprotectedstatic SymbolType typedefnmodl::codegen::CodegenCppVisitorprotected - table_function_prefix() constnmodl::codegen::CodegenCppVisitorprotected - table_thread_function_name() constnmodl::codegen::CodegenNeuronCppVisitorprotected + table_thread_function_name() constnmodl::codegen::CodegenNeuronCppVisitorprotected + table_update_function_name(const std::string &block_name) constnmodl::codegen::CodegenCppVisitorprotected thread_variable_name(const ThreadVariableInfo &var_info, bool use_instance=true) constnmodl::codegen::CodegenNeuronCppVisitorprotected thread_variables_struct() constnmodl::codegen::CodegenCppVisitorinlineprotected update_if_ion_variable_name(const std::string &name) constnmodl::codegen::CodegenCppVisitorprotected diff --git a/doxygen/classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html b/doxygen/classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html index eda40eb80..844a9f004 100644 --- a/doxygen/classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html +++ b/doxygen/classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html @@ -949,9 +949,9 @@ std::string update_if_ion_variable_name (const std::string &name) const  Determine the updated name if the ion variable has been optimized. More...
  -std::string table_function_prefix () const - Prefix used for the function that performs the lazy update. More...
-  +std::string table_update_function_name (const std::string &block_name) const + The name of the function that updates the table value if the parameters changed. More...
+  int get_int_variable_index (const std::string &var_name)   void print_backend_info () @@ -1171,7 +1171,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 462 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 460 of file codegen_neuron_cpp_visitor.cpp.

@@ -1203,7 +1203,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 454 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 452 of file codegen_neuron_cpp_visitor.cpp.

@@ -1260,7 +1260,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 568 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 566 of file codegen_neuron_cpp_visitor.cpp.

@@ -1291,7 +1291,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 49 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 50 of file codegen_neuron_cpp_visitor.cpp.

@@ -1396,7 +1396,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 490 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 488 of file codegen_neuron_cpp_visitor.cpp.

@@ -1436,7 +1436,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 496 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 494 of file codegen_neuron_cpp_visitor.cpp.

@@ -1488,7 +1488,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 595 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 593 of file codegen_neuron_cpp_visitor.cpp.

@@ -1519,7 +1519,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 833 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 831 of file codegen_neuron_cpp_visitor.cpp.

@@ -1569,7 +1569,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 674 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 672 of file codegen_neuron_cpp_visitor.cpp.

@@ -1619,7 +1619,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 664 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 662 of file codegen_neuron_cpp_visitor.cpp.

@@ -1649,7 +1649,7 @@

Definition at line 526 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 524 of file codegen_neuron_cpp_visitor.cpp.

@@ -1679,7 +1679,7 @@

Definition at line 532 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 530 of file codegen_neuron_cpp_visitor.cpp.

@@ -1737,7 +1737,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 615 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 613 of file codegen_neuron_cpp_visitor.cpp.

@@ -1769,7 +1769,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 468 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 466 of file codegen_neuron_cpp_visitor.cpp.

@@ -1801,7 +1801,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 474 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 472 of file codegen_neuron_cpp_visitor.cpp.

@@ -1828,7 +1828,7 @@

-

Definition at line 1773 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1765 of file codegen_neuron_cpp_visitor.cpp.

@@ -1855,7 +1855,7 @@

-

Definition at line 1778 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1770 of file codegen_neuron_cpp_visitor.cpp.

@@ -1887,7 +1887,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 503 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 501 of file codegen_neuron_cpp_visitor.cpp.

@@ -1919,7 +1919,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 509 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 507 of file codegen_neuron_cpp_visitor.cpp.

@@ -1950,7 +1950,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 100 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 101 of file codegen_neuron_cpp_visitor.cpp.

@@ -1989,7 +1989,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 64 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 65 of file codegen_neuron_cpp_visitor.cpp.

@@ -2028,7 +2028,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 76 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 77 of file codegen_neuron_cpp_visitor.cpp.

@@ -2060,7 +2060,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 96 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 97 of file codegen_neuron_cpp_visitor.cpp.

@@ -2089,7 +2089,7 @@

Definition at line 158 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 159 of file codegen_neuron_cpp_visitor.cpp.

@@ -2121,7 +2121,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2112 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 2104 of file codegen_neuron_cpp_visitor.cpp.

@@ -2153,7 +2153,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2095 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 2087 of file codegen_neuron_cpp_visitor.cpp.

@@ -2191,7 +2191,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2063 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 2055 of file codegen_neuron_cpp_visitor.cpp.

@@ -2223,7 +2223,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1927 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1919 of file codegen_neuron_cpp_visitor.cpp.

@@ -2261,7 +2261,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 317 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 316 of file codegen_neuron_cpp_visitor.cpp.

@@ -2317,7 +2317,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 264 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 263 of file codegen_neuron_cpp_visitor.cpp.

@@ -2355,7 +2355,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 297 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 296 of file codegen_neuron_cpp_visitor.cpp.

@@ -2388,7 +2388,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 253 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 252 of file codegen_neuron_cpp_visitor.cpp.

@@ -2419,7 +2419,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2085 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 2077 of file codegen_neuron_cpp_visitor.cpp.

@@ -2467,7 +2467,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1511 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1503 of file codegen_neuron_cpp_visitor.cpp.

@@ -2496,7 +2496,7 @@

Definition at line 1997 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1989 of file codegen_neuron_cpp_visitor.cpp.

@@ -2529,7 +2529,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1012 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1003 of file codegen_neuron_cpp_visitor.cpp.

@@ -2560,7 +2560,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1979 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1971 of file codegen_neuron_cpp_visitor.cpp.

@@ -2598,7 +2598,7 @@

-

Definition at line 336 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 335 of file codegen_neuron_cpp_visitor.cpp.

@@ -2625,7 +2625,7 @@

-

Definition at line 438 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 436 of file codegen_neuron_cpp_visitor.cpp.

@@ -2655,7 +2655,7 @@

Definition at line 1489 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1481 of file codegen_neuron_cpp_visitor.cpp.

@@ -2684,7 +2684,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2133 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 2125 of file codegen_neuron_cpp_visitor.cpp.

@@ -2713,7 +2713,7 @@

Definition at line 1989 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1981 of file codegen_neuron_cpp_visitor.cpp.

@@ -2742,7 +2742,7 @@

Definition at line 1373 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1365 of file codegen_neuron_cpp_visitor.cpp.

@@ -2771,7 +2771,7 @@

Definition at line 1438 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1430 of file codegen_neuron_cpp_visitor.cpp.

@@ -2810,7 +2810,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 847 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 838 of file codegen_neuron_cpp_visitor.cpp.

@@ -2848,7 +2848,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1334 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1326 of file codegen_neuron_cpp_visitor.cpp.

@@ -2886,7 +2886,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1132 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1123 of file codegen_neuron_cpp_visitor.cpp.

@@ -2916,7 +2916,7 @@

Definition at line 2014 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 2006 of file codegen_neuron_cpp_visitor.cpp.

@@ -2947,7 +2947,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2053 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 2045 of file codegen_neuron_cpp_visitor.cpp.

@@ -2978,7 +2978,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2058 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 2050 of file codegen_neuron_cpp_visitor.cpp.

@@ -3009,7 +3009,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 558 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 556 of file codegen_neuron_cpp_visitor.cpp.

@@ -3040,7 +3040,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 564 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 562 of file codegen_neuron_cpp_visitor.cpp.

@@ -3078,7 +3078,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2172 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 2164 of file codegen_neuron_cpp_visitor.cpp.

@@ -3116,7 +3116,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2162 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 2154 of file codegen_neuron_cpp_visitor.cpp.

@@ -3145,7 +3145,7 @@

Definition at line 2210 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 2202 of file codegen_neuron_cpp_visitor.cpp.

@@ -3210,7 +3210,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2138 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 2130 of file codegen_neuron_cpp_visitor.cpp.

@@ -3240,7 +3240,7 @@

Definition at line 1327 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1319 of file codegen_neuron_cpp_visitor.cpp.

@@ -3269,7 +3269,7 @@

Definition at line 781 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 779 of file codegen_neuron_cpp_visitor.cpp.

@@ -3297,7 +3297,7 @@

Definition at line 1424 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1416 of file codegen_neuron_cpp_visitor.cpp.

@@ -3330,7 +3330,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1600 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1592 of file codegen_neuron_cpp_visitor.cpp.

@@ -3362,7 +3362,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1588 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1580 of file codegen_neuron_cpp_visitor.cpp.

@@ -3394,7 +3394,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1933 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1925 of file codegen_neuron_cpp_visitor.cpp.

@@ -3434,7 +3434,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1820 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1812 of file codegen_neuron_cpp_visitor.cpp.

@@ -3473,7 +3473,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1894 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1886 of file codegen_neuron_cpp_visitor.cpp.

@@ -3506,7 +3506,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1859 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1851 of file codegen_neuron_cpp_visitor.cpp.

@@ -3546,7 +3546,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1801 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1793 of file codegen_neuron_cpp_visitor.cpp.

@@ -3578,7 +3578,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1594 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1586 of file codegen_neuron_cpp_visitor.cpp.

@@ -3614,7 +3614,7 @@

Definition at line 1534 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1526 of file codegen_neuron_cpp_visitor.cpp.

@@ -3643,7 +3643,7 @@

Definition at line 1554 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1546 of file codegen_neuron_cpp_visitor.cpp.

@@ -3676,7 +3676,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1723 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1715 of file codegen_neuron_cpp_visitor.cpp.

@@ -3705,7 +3705,7 @@

Definition at line 113 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 114 of file codegen_neuron_cpp_visitor.cpp.

@@ -3743,7 +3743,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 312 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 311 of file codegen_neuron_cpp_visitor.cpp.

@@ -3778,7 +3778,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 792 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 790 of file codegen_neuron_cpp_visitor.cpp.

@@ -3807,7 +3807,7 @@

Definition at line 203 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 202 of file codegen_neuron_cpp_visitor.cpp.

@@ -3838,7 +3838,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 765 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 763 of file codegen_neuron_cpp_visitor.cpp.

@@ -3867,7 +3867,7 @@

Definition at line 1293 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1285 of file codegen_neuron_cpp_visitor.cpp.

@@ -3889,7 +3889,7 @@

Definition at line 1457 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1449 of file codegen_neuron_cpp_visitor.cpp.

@@ -3920,7 +3920,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2073 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 2065 of file codegen_neuron_cpp_visitor.cpp.

@@ -3960,7 +3960,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 515 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 513 of file codegen_neuron_cpp_visitor.cpp.

@@ -3990,7 +3990,7 @@

Definition at line 541 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 539 of file codegen_neuron_cpp_visitor.cpp.

@@ -4020,7 +4020,7 @@

Definition at line 547 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 545 of file codegen_neuron_cpp_visitor.cpp.

@@ -4052,7 +4052,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 521 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 519 of file codegen_neuron_cpp_visitor.cpp.

@@ -4083,7 +4083,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 44 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 45 of file codegen_neuron_cpp_visitor.cpp.

@@ -4112,7 +4112,7 @@

Definition at line 54 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 55 of file codegen_neuron_cpp_visitor.cpp.

@@ -4159,7 +4159,7 @@

Definition at line 643 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 641 of file codegen_neuron_cpp_visitor.cpp.

@@ -4191,7 +4191,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 2253 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 2245 of file codegen_neuron_cpp_visitor.cpp.

diff --git a/doxygen/codegen__acc__visitor_8cpp_source.html b/doxygen/codegen__acc__visitor_8cpp_source.html index db163c5ab..afb363e73 100644 --- a/doxygen/codegen__acc__visitor_8cpp_source.html +++ b/doxygen/codegen__acc__visitor_8cpp_source.html @@ -479,8 +479,8 @@
codegen::CodegenInfo info
All ast information for code generation.
std::string global_struct_instance() const
Name of the (host-only) global instance of global_struct
void print_deriv_advance_flag_transfer_to_device() const override
update derivimplicit advance flag on the gpu device
-
int derivimplicit_list_num
slist/dlist id for derivimplicit block
-
int thread_data_index
thread_data_index indicates number of threads being allocated.
+
int derivimplicit_list_num
slist/dlist id for derivimplicit block
+
int thread_data_index
thread_data_index indicates number of threads being allocated.
const char * operator_for_d() const noexcept
Operator for diagonal vector update (matrix update)
bool nrn_cur_reduction_loop_required() override
if reduction block in nrn_cur required
encapsulates code generation backend implementations
Definition: ast_common.hpp:26
@@ -491,18 +491,18 @@
void print_atomic_reduction_pragma() override
atomic update pragma for reduction statements
Base class for all block scoped nodes.
Definition: block.hpp:41
void print_instance_struct_transfer_routine_declarations() override
declare helper functions for copying the instance struct to the device
-
bool artificial_cell
if mod file is artificial cell
+
bool artificial_cell
if mod file is artificial cell
@ Equation
breakpoint block
void print_nrn_cur_matrix_shadow_update() override
update to matrix elements with/without shadow vectors
void print_instance_struct_copy_to_device() override
call helper function for copying the instance struct to the device
void print_rhs_d_shadow_variables() override
setup method for setting matrix shadow vectors
virtual void print_memory_allocation_routine() const
Print memory allocation routine.
@ NetReceive
net_receive block
-
bool point_process
if mod file is point process
+
bool point_process
if mod file is point process
void print_dt_update_to_device() const override
update dt from host to device
std::string get_variable_name(const std::string &name, bool use_instance=true) const override
Determine variable name in the structure of mechanism properties.
void print_global_variable_device_update_annotation() override
update global variable from host to the device
-
bool electrode_current
if electrode current specified
+
bool electrode_current
if electrode current specified
void print_kernel_data_present_annotation_block_end() override
end of annotation like "acc enter data"
BlockType
Helper to represent various block types.
void print_abort_routine() const override
abort routine
diff --git a/doxygen/codegen__coreneuron__cpp__visitor_8hpp_source.html b/doxygen/codegen__coreneuron__cpp__visitor_8hpp_source.html index 92d2b6bf0..a32501485 100644 --- a/doxygen/codegen__coreneuron__cpp__visitor_8hpp_source.html +++ b/doxygen/codegen__coreneuron__cpp__visitor_8hpp_source.html @@ -1166,7 +1166,7 @@
virtual void print_newtonspace_transfer_to_device() const
Print code block to transfer newtonspace structure to device.
CodegenCppVisitor(std::string mod_filename, const std::string &output_dir, std::string float_type, const bool optimize_ionvar_copies, std::unique_ptr< nmodl::utils::Blame > blame)
Constructs the C++ code generator visitor.
-
int thread_data_index
thread_data_index indicates number of threads being allocated.
+
int thread_data_index
thread_data_index indicates number of threads being allocated.
void print_namespace_end() override
Print end of namespaces.
void print_net_send_call(const ast::FunctionCall &node) override
Print call to net_send.
virtual void print_net_receive_loop_begin()
Print the code for the main net_receive loop.
@@ -1238,7 +1238,7 @@
virtual void print_rhs_d_shadow_variables()
Print the setup method for setting matrix shadow vectors.
std::string process_verbatim_text(std::string const &text) override
Process a verbatim block for possible variable renaming.
void print_net_receive()
Print net_receive function definition.
-
bool vectorize
true if mod file is vectorizable (which should be always true for coreneuron) But there are some bloc...
+
bool vectorize
true if mod file is vectorizable (which should be always true for coreneuron) But there are some bloc...
bool optimize_ion_variable_copies() const override
Check if ion variable copies should be avoided.
void print_function(const ast::FunctionBlock &node) override
Print NMODL function in target backend code.
void print_top_verbatim_blocks()
Print top level (global scope) verbatim blocks.
diff --git a/doxygen/codegen__cpp__visitor_8cpp_source.html b/doxygen/codegen__cpp__visitor_8cpp_source.html index 4cd5ca86d..93641fb8b 100644 --- a/doxygen/codegen__cpp__visitor_8cpp_source.html +++ b/doxygen/codegen__cpp__visitor_8cpp_source.html @@ -168,8 +168,8 @@
72 }
73 
74 
- -
76  return "lazy_update_";
+
75 std::string CodegenCppVisitor::table_update_function_name(const std::string& block_name) const {
+
76  return "update_table_" + method_name(block_name);
77 }
78 
79 
@@ -1620,130 +1620,130 @@
1524  auto float_type = default_float_data_type();
1525 
1526  printer->add_newline(2);
-
1527  printer->fmt_push_block("void {}{}({})",
-
1528  table_function_prefix(),
-
1529  method_name(name),
-
1530  get_parameter_str(internal_params));
-
1531  {
-
1532  printer->fmt_push_block("if ({} == 0)", use_table_var);
-
1533  printer->add_line("return;");
-
1534  printer->pop_block();
-
1535 
-
1536  printer->add_line("static bool make_table = true;");
-
1537  for (const auto& variable: depend_variables) {
-
1538  printer->fmt_line("static {} save_{};", float_type, variable->get_node_name());
-
1539  }
-
1540 
-
1541  for (const auto& variable: depend_variables) {
-
1542  const auto& var_name = variable->get_node_name();
-
1543  const auto& instance_name = get_variable_name(var_name);
-
1544  printer->fmt_push_block("if (save_{} != {})", var_name, instance_name);
-
1545  printer->add_line("make_table = true;");
-
1546  printer->pop_block();
-
1547  }
-
1548 
-
1549  printer->push_block("if (make_table)");
-
1550  {
-
1551  printer->add_line("make_table = false;");
-
1552 
-
1553  printer->add_indent();
-
1554  printer->add_text(tmin_name, " = ");
-
1555  from->accept(*this);
-
1556  printer->add_text(';');
-
1557  printer->add_newline();
-
1558 
-
1559  printer->add_indent();
-
1560  printer->add_text("double tmax = ");
-
1561  to->accept(*this);
-
1562  printer->add_text(';');
-
1563  printer->add_newline();
+
1527  printer->fmt_push_block("void {}({})",
+
1528  table_update_function_name(name),
+
1529  get_parameter_str(internal_params));
+
1530  {
+
1531  printer->fmt_push_block("if ({} == 0)", use_table_var);
+
1532  printer->add_line("return;");
+
1533  printer->pop_block();
+
1534 
+
1535  printer->add_line("static bool make_table = true;");
+
1536  for (const auto& variable: depend_variables) {
+
1537  printer->fmt_line("static {} save_{};", float_type, variable->get_node_name());
+
1538  }
+
1539 
+
1540  for (const auto& variable: depend_variables) {
+
1541  const auto& var_name = variable->get_node_name();
+
1542  const auto& instance_name = get_variable_name(var_name);
+
1543  printer->fmt_push_block("if (save_{} != {})", var_name, instance_name);
+
1544  printer->add_line("make_table = true;");
+
1545  printer->pop_block();
+
1546  }
+
1547 
+
1548  printer->push_block("if (make_table)");
+
1549  {
+
1550  printer->add_line("make_table = false;");
+
1551 
+
1552  printer->add_indent();
+
1553  printer->add_text(tmin_name, " = ");
+
1554  from->accept(*this);
+
1555  printer->add_text(';');
+
1556  printer->add_newline();
+
1557 
+
1558  printer->add_indent();
+
1559  printer->add_text("double tmax = ");
+
1560  to->accept(*this);
+
1561  printer->add_text(';');
+
1562  printer->add_newline();
+
1563 
1564 
-
1565 
-
1566  printer->fmt_line("double dx = (tmax-{}) / {}.;", tmin_name, with);
-
1567  printer->fmt_line("{} = 1./dx;", mfac_name);
-
1568 
-
1569  printer->fmt_line("double x = {};", tmin_name);
-
1570  printer->fmt_push_block("for (std::size_t i = 0; i < {}; x += dx, i++)", with + 1);
-
1571  auto function = method_name("f_" + name);
-
1572  if (node.is_procedure_block()) {
-
1573  printer->fmt_line("{}({}, x);", function, internal_method_arguments());
-
1574  for (const auto& variable: table_variables) {
-
1575  auto var_name = variable->get_node_name();
-
1576  auto instance_name = get_variable_name(var_name);
-
1577  auto table_name = get_variable_name("t_" + var_name);
-
1578  auto [is_array, array_length] = check_if_var_is_array(var_name);
-
1579  if (is_array) {
-
1580  for (int j = 0; j < array_length; j++) {
-
1581  printer->fmt_line(
-
1582  "{}[{}][i] = {}[{}];", table_name, j, instance_name, j);
-
1583  }
-
1584  } else {
-
1585  printer->fmt_line("{}[i] = {};", table_name, instance_name);
-
1586  }
-
1587  }
-
1588  } else {
-
1589  auto table_name = get_variable_name("t_" + name);
-
1590  printer->fmt_line("{}[i] = {}({}, x);",
-
1591  table_name,
-
1592  function,
-
1593  internal_method_arguments());
-
1594  }
-
1595  printer->pop_block();
-
1596 
-
1597  for (const auto& variable: depend_variables) {
-
1598  auto var_name = variable->get_node_name();
-
1599  auto instance_name = get_variable_name(var_name);
-
1600  printer->fmt_line("save_{} = {};", var_name, instance_name);
-
1601  }
-
1602  }
-
1603  printer->pop_block();
-
1604  }
-
1605  printer->pop_block();
-
1606 }
-
1607 
- -
1609  const std::unordered_set<CppObjectSpecifier>& specifiers) {
-
1610  std::string result;
-
1611  for (const auto& specifier: specifiers) {
-
1612  if (!result.empty()) {
-
1613  result += " ";
-
1614  }
-
1615  result += object_specifier_map[specifier];
-
1616  }
-
1617  return result;
-
1618 }
-
1619 
- -
1621  const auto& table_statements = collect_nodes(node, {AstNodeType::TABLE_STATEMENT});
-
1622 
-
1623  if (table_statements.size() != 1) {
-
1624  auto message = fmt::format("One table statement expected in {} found {}",
-
1625  node.get_node_name(),
-
1626  table_statements.size());
-
1627  throw std::runtime_error(message);
-
1628  }
-
1629  return dynamic_cast<const ast::TableStatement*>(table_statements.front().get());
-
1630 }
+
1565  printer->fmt_line("double dx = (tmax-{}) / {}.;", tmin_name, with);
+
1566  printer->fmt_line("{} = 1./dx;", mfac_name);
+
1567 
+
1568  printer->fmt_line("double x = {};", tmin_name);
+
1569  printer->fmt_push_block("for (std::size_t i = 0; i < {}; x += dx, i++)", with + 1);
+
1570  auto function = method_name("f_" + name);
+
1571  if (node.is_procedure_block()) {
+
1572  printer->fmt_line("{}({}, x);", function, internal_method_arguments());
+
1573  for (const auto& variable: table_variables) {
+
1574  auto var_name = variable->get_node_name();
+
1575  auto instance_name = get_variable_name(var_name);
+
1576  auto table_name = get_variable_name("t_" + var_name);
+
1577  auto [is_array, array_length] = check_if_var_is_array(var_name);
+
1578  if (is_array) {
+
1579  for (int j = 0; j < array_length; j++) {
+
1580  printer->fmt_line(
+
1581  "{}[{}][i] = {}[{}];", table_name, j, instance_name, j);
+
1582  }
+
1583  } else {
+
1584  printer->fmt_line("{}[i] = {};", table_name, instance_name);
+
1585  }
+
1586  }
+
1587  } else {
+
1588  auto table_name = get_variable_name("t_" + name);
+
1589  printer->fmt_line("{}[i] = {}({}, x);",
+
1590  table_name,
+
1591  function,
+
1592  internal_method_arguments());
+
1593  }
+
1594  printer->pop_block();
+
1595 
+
1596  for (const auto& variable: depend_variables) {
+
1597  auto var_name = variable->get_node_name();
+
1598  auto instance_name = get_variable_name(var_name);
+
1599  printer->fmt_line("save_{} = {};", var_name, instance_name);
+
1600  }
+
1601  }
+
1602  printer->pop_block();
+
1603  }
+
1604  printer->pop_block();
+
1605 }
+
1606 
+ +
1608  const std::unordered_set<CppObjectSpecifier>& specifiers) {
+
1609  std::string result;
+
1610  for (const auto& specifier: specifiers) {
+
1611  if (!result.empty()) {
+
1612  result += " ";
+
1613  }
+
1614  result += object_specifier_map[specifier];
+
1615  }
+
1616  return result;
+
1617 }
+
1618 
+ +
1620  const auto& table_statements = collect_nodes(node, {AstNodeType::TABLE_STATEMENT});
+
1621 
+
1622  if (table_statements.size() != 1) {
+
1623  auto message = fmt::format("One table statement expected in {} found {}",
+
1624  node.get_node_name(),
+
1625  table_statements.size());
+
1626  throw std::runtime_error(message);
+
1627  }
+
1628  return dynamic_cast<const ast::TableStatement*>(table_statements.front().get());
+
1629 }
+
1630 
1631 
-
1632 
-
1633 std::tuple<bool, int> CodegenCppVisitor::check_if_var_is_array(const std::string& name) {
-
1634  auto symbol = program_symtab->lookup_in_scope(name);
-
1635  if (!symbol) {
-
1636  throw std::runtime_error(
-
1637  fmt::format("CodegenCppVisitor:: {} not found in symbol table!", name));
-
1638  }
-
1639  if (symbol->is_array()) {
-
1640  return {true, symbol->get_length()};
-
1641  } else {
-
1642  return {false, 0};
-
1643  }
-
1644 }
-
1645 } // namespace codegen
-
1646 } // namespace nmodl
+
1632 std::tuple<bool, int> CodegenCppVisitor::check_if_var_is_array(const std::string& name) {
+
1633  auto symbol = program_symtab->lookup_in_scope(name);
+
1634  if (!symbol) {
+
1635  throw std::runtime_error(
+
1636  fmt::format("CodegenCppVisitor:: {} not found in symbol table!", name));
+
1637  }
+
1638  if (symbol->is_array()) {
+
1639  return {true, symbol->get_length()};
+
1640  } else {
+
1641  return {false, 0};
+
1642  }
+
1643 }
+
1644 } // namespace codegen
+
1645 } // namespace nmodl
std::string get_node_name() const override
Return name of the node.
Definition: ast.cpp:7061
std::shared_ptr< Expression > get_length() const noexcept
Getter for member variable IndexedName::length.
+
std::string table_update_function_name(const std::string &block_name) const
The name of the function that updates the table value if the parameters changed.
void visit_eigen_linear_solver_block(const ast::EigenLinearSolverBlock &node) override
visit node of type ast::EigenLinearSolverBlock
bool ion_variable_struct_required() const
Check if a structure for ion variables is required.
static bool need_semicolon(const ast::Statement &node)
Check if a semicolon is required at the end of given statement.
@@ -1800,7 +1800,6 @@
void print_statement_block(const ast::StatementBlock &node, bool open_brace=true, bool close_brace=true)
Print any statement block in nmodl with option to (not) print braces.
const std::string & get_value() const noexcept
Getter for member variable Double::value.
Definition: double.hpp:158
StatementVector::const_iterator insert_statement(StatementVector::const_iterator position, const std::shared_ptr< Statement > &n)
Insert member to statements.
Definition: ast.cpp:3130
-
std::string table_function_prefix() const
Prefix used for the function that performs the lazy update.
virtual bool is_procedure_block() const noexcept
Check if the ast node is an instance of ast::ProcedureBlock.
Definition: ast.cpp:144
Represents TABLE statement in NMODL.
@@ -1808,7 +1807,7 @@
void visit_binary_expression(const ast::BinaryExpression &node) override
visit node of type ast::BinaryExpression
Represents a variable.
Definition: var_name.hpp:43
Represents an integer variable.
Definition: integer.hpp:49
-
std::string get_object_specifiers(const std::unordered_set< CppObjectSpecifier > &)
+
std::string get_object_specifiers(const std::unordered_set< CppObjectSpecifier > &)
std::vector< SymbolType > get_float_variables() const
Determine all float variables required during code generation.
virtual bool is_expression_statement() const noexcept
Check if the ast node is an instance of ast::ExpressionStatement.
Definition: ast.cpp:226
@@ -1882,7 +1881,7 @@
bool net_send_buffer_required() const noexcept
Check if net_send_buffer is required.
void visit_float(const ast::Float &node) override
visit node of type ast::Float
void visit_string(const ast::String &node) override
visit node of type ast::String
-
Represent semantic information for index variable.
+
Represent semantic information for index variable.
std::string to_string(const T &obj)
virtual bool is_block_comment() const noexcept
Check if the ast node is an instance of ast::BlockComment.
Definition: ast.cpp:286
@@ -1894,7 +1893,7 @@
virtual void print_global_var_struct_decl()
Instantiate global var instance.
static constexpr char AREA_SEMANTIC[]
semantic type for area variable
void visit_var_name(const ast::VarName &node) override
-
std::string mod_file
name of mod file
+
std::string mod_file
name of mod file
void print_nmodl_constants()
Print the nmodl constants used in backend code.
std::shared_ptr< Expression > get_expression() const noexcept
Getter for member variable ParenExpression::expression.
const BinaryOperator & get_op() const noexcept
Getter for member variable BinaryExpression::op.
@@ -1915,7 +1914,7 @@
std::string eval() const
Return enum value in string form.
virtual bool is_mutex_unlock() const noexcept
Check if the ast node is an instance of ast::MutexUnlock.
Definition: ast.cpp:244
@ LOCAL_VAR
type of ast::LocalVar
-
codegen::CodegenInfo analyze(const ast::Program &node)
run visitor and return information for code generation
+
codegen::CodegenInfo analyze(const ast::Program &node)
run visitor and return information for code generation
std::shared_ptr< StatementBlock > get_statement_block() const noexcept override
Getter for member variable WhileStatement::statement_block.
void visit_integer(const ast::Integer &node) override
visit node of type ast::Integer
Represent linear solver solution block based on Eigen.
@@ -1923,10 +1922,10 @@
Visitor to return Def-Use chain for a given variable in the block/node
Statement to indicate a change in timestep in a given block.
Definition: update_dt.hpp:38
std::shared_ptr< StatementBlock > get_functor_block() const noexcept
Getter for member variable EigenNewtonSolverBlock::functor_block.
-
const ast::TableStatement * get_table_statement(const ast::Block &)
+
const ast::TableStatement * get_table_statement(const ast::Block &)
std::string format_float_string(const std::string &value)
Convert a given float value to its string representation.
-
std::tuple< bool, int > check_if_var_is_array(const std::string &name)
Check if the given name exist in the symbol.
+
std::tuple< bool, int > check_if_var_is_array(const std::string &name)
Check if the given name exist in the symbol.
bool is_functor_const(const ast::StatementBlock &variable_block, const ast::StatementBlock &functor_block)
Checks whether the functor_block generated by sympy solver modifies any variable outside its scope.
std::shared_ptr< Expression > get_node_to_solve() const noexcept
Getter for member variable SolutionExpression::node_to_solve.
static std::vector< std::string > split_string(const std::string &text, char delimiter)
Split a text in a list of words, using a given delimiter character.
diff --git a/doxygen/codegen__cpp__visitor_8hpp_source.html b/doxygen/codegen__cpp__visitor_8hpp_source.html index d8a397b13..399758742 100644 --- a/doxygen/codegen__cpp__visitor_8hpp_source.html +++ b/doxygen/codegen__cpp__visitor_8hpp_source.html @@ -1208,435 +1208,438 @@
1112  bool use_instance = true) const = 0;
1113 
1114  /**
-
1115  * Prefix used for the function that performs the lazy update
-
1116  */
-
1117  std::string table_function_prefix() const;
-
1118 
-
1119 
-
1120  /**
-
1121  * Return ion variable name and corresponding ion read variable name.
-
1122  *
-
1123  * Example:
-
1124  * {"ena", "ion_ena"} = read_ion_variable_name("ena");
-
1125  *
-
1126  * \param name The ion variable name
-
1127  * \return The ion read variable name
-
1128  */
-
1129  static std::pair<std::string, std::string> read_ion_variable_name(const std::string& name);
-
1130 
-
1131 
-
1132  /**
-
1133  * Return ion variable name and corresponding ion write variable name
-
1134  *
-
1135  * Example:
-
1136  * {"ion_ena", "ena"} = write_ion_variable_name("ena");
-
1137  *
-
1138  * \param name The ion variable name
-
1139  * \return The ion write variable name
-
1140  */
-
1141  static std::pair<std::string, std::string> write_ion_variable_name(const std::string& name);
-
1142 
-
1143 
-
1144  int get_int_variable_index(const std::string& var_name);
+
1115  * The name of the function that updates the table value if the parameters
+
1116  * changed.
+
1117  *
+
1118  * \param block_name The name of the block that contains the TABLE.
+
1119  */
+
1120  std::string table_update_function_name(const std::string& block_name) const;
+
1121 
+
1122  /**
+
1123  * Return ion variable name and corresponding ion read variable name.
+
1124  *
+
1125  * Example:
+
1126  * {"ena", "ion_ena"} = read_ion_variable_name("ena");
+
1127  *
+
1128  * \param name The ion variable name
+
1129  * \return The ion read variable name
+
1130  */
+
1131  static std::pair<std::string, std::string> read_ion_variable_name(const std::string& name);
+
1132 
+
1133 
+
1134  /**
+
1135  * Return ion variable name and corresponding ion write variable name
+
1136  *
+
1137  * Example:
+
1138  * {"ion_ena", "ena"} = write_ion_variable_name("ena");
+
1139  *
+
1140  * \param name The ion variable name
+
1141  * \return The ion write variable name
+
1142  */
+
1143  static std::pair<std::string, std::string> write_ion_variable_name(const std::string& name);
+
1144 
1145 
-
1146  /****************************************************************************************/
-
1147  /* Main printing routines for code generation */
+
1146  int get_int_variable_index(const std::string& var_name);
+
1147 
1148  /****************************************************************************************/
-
1149 
-
1150 
-
1151  /**
-
1152  * Print top file header printed in generated code
-
1153  */
-
1154  void print_backend_info();
-
1155 
-
1156 
-
1157  /**
-
1158  * Print standard C/C++ includes
-
1159  */
-
1160  virtual void print_standard_includes() = 0;
-
1161 
-
1162 
-
1163  virtual void print_sdlists_init(bool print_initializers) = 0;
+
1149  /* Main printing routines for code generation */
+
1150  /****************************************************************************************/
+
1151 
+
1152 
+
1153  /**
+
1154  * Print top file header printed in generated code
+
1155  */
+
1156  void print_backend_info();
+
1157 
+
1158 
+
1159  /**
+
1160  * Print standard C/C++ includes
+
1161  */
+
1162  virtual void print_standard_includes() = 0;
+
1163 
1164 
-
1165 
-
1166  /**
-
1167  * Print the structure that wraps all global variables used in the NMODL
-
1168  *
-
1169  * \param print_initializers Whether to include default values in the struct
-
1170  * definition (true: int foo{42}; false: int foo;)
-
1171  */
-
1172  virtual void print_mechanism_global_var_structure(bool print_initializers) = 0;
-
1173 
-
1174 
-
1175  /**
-
1176  * Print static assertions about the global variable struct.
-
1177  */
-
1178  virtual void print_global_var_struct_assertions() const;
-
1179 
-
1180 
-
1181  /**
-
1182  * Print declaration of macro NRN_PRCELLSTATE for debugging
-
1183  */
-
1184  void print_prcellstate_macros() const;
-
1185 
-
1186 
-
1187  /**
-
1188  * Print backend code for byte array that has mechanism information (to be registered
-
1189  * with NEURON/CoreNEURON)
-
1190  */
-
1191  void print_mechanism_info();
-
1192 
-
1193 
-
1194  /**
-
1195  * Print byte arrays that register scalar and vector variables for hoc interface
-
1196  *
-
1197  */
-
1198  virtual void print_global_variables_for_hoc() = 0;
-
1199 
-
1200 
-
1201  /**
-
1202  * Print the mechanism registration function
-
1203  *
-
1204  */
-
1205  virtual void print_mechanism_register() = 0;
-
1206 
-
1207 
-
1208  /**
-
1209  * Print common code for global functions like nrn_init, nrn_cur and nrn_state
-
1210  * \param type The target backend code block type
-
1211  */
-
1212  virtual void print_global_function_common_code(BlockType type,
-
1213  const std::string& function_name = "") = 0;
-
1214 
-
1215 
-
1216  /**
-
1217  * Print nrn_constructor function definition
-
1218  *
-
1219  */
-
1220  virtual void print_nrn_constructor() = 0;
-
1221 
-
1222 
-
1223  /**
-
1224  * Print nrn_destructor function definition
-
1225  *
-
1226  */
-
1227  virtual void print_nrn_destructor() = 0;
-
1228 
-
1229 
-
1230  /**
-
1231  * Print nrn_alloc function definition
-
1232  *
-
1233  */
-
1234  virtual void print_nrn_alloc() = 0;
-
1235 
-
1236 
-
1237  /****************************************************************************************/
-
1238  /* Print nrn_state routine */
+
1165  virtual void print_sdlists_init(bool print_initializers) = 0;
+
1166 
+
1167 
+
1168  /**
+
1169  * Print the structure that wraps all global variables used in the NMODL
+
1170  *
+
1171  * \param print_initializers Whether to include default values in the struct
+
1172  * definition (true: int foo{42}; false: int foo;)
+
1173  */
+
1174  virtual void print_mechanism_global_var_structure(bool print_initializers) = 0;
+
1175 
+
1176 
+
1177  /**
+
1178  * Print static assertions about the global variable struct.
+
1179  */
+
1180  virtual void print_global_var_struct_assertions() const;
+
1181 
+
1182 
+
1183  /**
+
1184  * Print declaration of macro NRN_PRCELLSTATE for debugging
+
1185  */
+
1186  void print_prcellstate_macros() const;
+
1187 
+
1188 
+
1189  /**
+
1190  * Print backend code for byte array that has mechanism information (to be registered
+
1191  * with NEURON/CoreNEURON)
+
1192  */
+
1193  void print_mechanism_info();
+
1194 
+
1195 
+
1196  /**
+
1197  * Print byte arrays that register scalar and vector variables for hoc interface
+
1198  *
+
1199  */
+
1200  virtual void print_global_variables_for_hoc() = 0;
+
1201 
+
1202 
+
1203  /**
+
1204  * Print the mechanism registration function
+
1205  *
+
1206  */
+
1207  virtual void print_mechanism_register() = 0;
+
1208 
+
1209 
+
1210  /**
+
1211  * Print common code for global functions like nrn_init, nrn_cur and nrn_state
+
1212  * \param type The target backend code block type
+
1213  */
+
1214  virtual void print_global_function_common_code(BlockType type,
+
1215  const std::string& function_name = "") = 0;
+
1216 
+
1217 
+
1218  /**
+
1219  * Print nrn_constructor function definition
+
1220  *
+
1221  */
+
1222  virtual void print_nrn_constructor() = 0;
+
1223 
+
1224 
+
1225  /**
+
1226  * Print nrn_destructor function definition
+
1227  *
+
1228  */
+
1229  virtual void print_nrn_destructor() = 0;
+
1230 
+
1231 
+
1232  /**
+
1233  * Print nrn_alloc function definition
+
1234  *
+
1235  */
+
1236  virtual void print_nrn_alloc() = 0;
+
1237 
+
1238 
1239  /****************************************************************************************/
-
1240 
-
1241 
-
1242  /**
-
1243  * Print nrn_state / state update function definition
-
1244  */
-
1245  virtual void print_nrn_state() = 0;
-
1246 
-
1247 
-
1248  /****************************************************************************************/
-
1249  /* Print nrn_cur related routines */
+
1240  /* Print nrn_state routine */
+
1241  /****************************************************************************************/
+
1242 
+
1243 
+
1244  /**
+
1245  * Print nrn_state / state update function definition
+
1246  */
+
1247  virtual void print_nrn_state() = 0;
+
1248 
+
1249 
1250  /****************************************************************************************/
-
1251 
-
1252 
-
1253  /**
-
1254  * Print the \c nrn_current kernel
-
1255  *
-
1256  * \note nrn_cur_kernel will have two calls to nrn_current if no conductance keywords specified
-
1257  * \param node the AST node representing the NMODL breakpoint block
-
1258  */
-
1259  virtual void print_nrn_current(const ast::BreakpointBlock& node) = 0;
-
1260 
-
1261 
-
1262  /**
-
1263  * Print the \c nrn\_cur kernel with NMODL \c conductance keyword provisions
-
1264  *
-
1265  * If the NMODL \c conductance keyword is used in the \c breakpoint block, then
-
1266  * CodegenCoreneuronCppVisitor::print_nrn_cur_kernel will use this printer
-
1267  *
-
1268  * \param node the AST node representing the NMODL breakpoint block
-
1269  */
-
1270  virtual void print_nrn_cur_conductance_kernel(const ast::BreakpointBlock& node) = 0;
-
1271 
-
1272 
-
1273  /**
-
1274  * Print the \c nrn\_cur kernel without NMODL \c conductance keyword provisions
-
1275  *
-
1276  * If the NMODL \c conductance keyword is \b not used in the \c breakpoint block, then
-
1277  * CodegenCoreneuronCppVisitor::print_nrn_cur_kernel will use this printer
-
1278  */
-
1279  virtual void print_nrn_cur_non_conductance_kernel() = 0;
-
1280 
-
1281 
-
1282  /**
-
1283  * Print main body of nrn_cur function
-
1284  * \param node the AST node representing the NMODL breakpoint block
-
1285  */
-
1286  virtual void print_nrn_cur_kernel(const ast::BreakpointBlock& node) = 0;
-
1287 
-
1288 
-
1289  /**
-
1290  * Print fast membrane current calculation code
-
1291  */
-
1292  virtual void print_fast_imem_calculation() = 0;
-
1293 
-
1294 
-
1295  /**
-
1296  * Print nrn_cur / current update function definition
-
1297  */
-
1298  virtual void print_nrn_cur() = 0;
-
1299 
-
1300 
-
1301  /****************************************************************************************/
-
1302  /* Main code printing entry points */
+
1251  /* Print nrn_cur related routines */
+
1252  /****************************************************************************************/
+
1253 
+
1254 
+
1255  /**
+
1256  * Print the \c nrn_current kernel
+
1257  *
+
1258  * \note nrn_cur_kernel will have two calls to nrn_current if no conductance keywords specified
+
1259  * \param node the AST node representing the NMODL breakpoint block
+
1260  */
+
1261  virtual void print_nrn_current(const ast::BreakpointBlock& node) = 0;
+
1262 
+
1263 
+
1264  /**
+
1265  * Print the \c nrn\_cur kernel with NMODL \c conductance keyword provisions
+
1266  *
+
1267  * If the NMODL \c conductance keyword is used in the \c breakpoint block, then
+
1268  * CodegenCoreneuronCppVisitor::print_nrn_cur_kernel will use this printer
+
1269  *
+
1270  * \param node the AST node representing the NMODL breakpoint block
+
1271  */
+
1272  virtual void print_nrn_cur_conductance_kernel(const ast::BreakpointBlock& node) = 0;
+
1273 
+
1274 
+
1275  /**
+
1276  * Print the \c nrn\_cur kernel without NMODL \c conductance keyword provisions
+
1277  *
+
1278  * If the NMODL \c conductance keyword is \b not used in the \c breakpoint block, then
+
1279  * CodegenCoreneuronCppVisitor::print_nrn_cur_kernel will use this printer
+
1280  */
+
1281  virtual void print_nrn_cur_non_conductance_kernel() = 0;
+
1282 
+
1283 
+
1284  /**
+
1285  * Print main body of nrn_cur function
+
1286  * \param node the AST node representing the NMODL breakpoint block
+
1287  */
+
1288  virtual void print_nrn_cur_kernel(const ast::BreakpointBlock& node) = 0;
+
1289 
+
1290 
+
1291  /**
+
1292  * Print fast membrane current calculation code
+
1293  */
+
1294  virtual void print_fast_imem_calculation() = 0;
+
1295 
+
1296 
+
1297  /**
+
1298  * Print nrn_cur / current update function definition
+
1299  */
+
1300  virtual void print_nrn_cur() = 0;
+
1301 
+
1302 
1303  /****************************************************************************************/
-
1304 
-
1305 
-
1306  /**
-
1307  * Print all includes
-
1308  *
-
1309  */
-
1310  virtual void print_headers_include() = 0;
-
1311 
-
1312 
-
1313  /**
-
1314  * Print start of namespaces
-
1315  *
-
1316  */
-
1317  virtual void print_namespace_begin() = 0;
-
1318 
-
1319 
-
1320  /**
-
1321  * Print end of namespaces
-
1322  *
-
1323  */
-
1324  virtual void print_namespace_end() = 0;
-
1325 
-
1326 
-
1327  /**
-
1328  * Print all classes
-
1329  * \param print_initializers Whether to include default values.
-
1330  */
-
1331  virtual void print_data_structures(bool print_initializers) = 0;
-
1332 
-
1333 
-
1334  /**
-
1335  * Set v_unused (voltage) for NRN_PRCELLSTATE feature
-
1336  */
-
1337  virtual void print_v_unused() const = 0;
-
1338 
-
1339 
-
1340  /**
-
1341  * Set g_unused (conductance) for NRN_PRCELLSTATE feature
-
1342  */
-
1343  virtual void print_g_unused() const = 0;
-
1344 
-
1345 
-
1346  /**
-
1347  * Print all compute functions for every backend
-
1348  *
-
1349  */
-
1350  virtual void print_compute_functions() = 0;
-
1351 
-
1352 
-
1353  /**
-
1354  * Print entry point to code generation
-
1355  *
-
1356  */
-
1357  virtual void print_codegen_routines() = 0;
-
1358 
-
1359  std::unordered_map<CppObjectSpecifier, std::string> object_specifier_map = {
-
1360  {CppObjectSpecifier::Inline, "inline"},
-
1361  {CppObjectSpecifier::Static, "static"},
-
1362  {CppObjectSpecifier::Constexpr, "constexpr"},
-
1363  {CppObjectSpecifier::Volatile, "volatile"},
-
1364  {CppObjectSpecifier::Virtual, "virtual"},
-
1365  {CppObjectSpecifier::Explicit, "explicit"},
-
1366  {CppObjectSpecifier::Friend, "friend"},
-
1367  {CppObjectSpecifier::Extern, "extern"},
-
1368  {CppObjectSpecifier::ExternC, "extern \"C\""},
-
1369  {CppObjectSpecifier::ThreadLocal, "thread_local"},
-
1370  {CppObjectSpecifier::Const, "const"}};
-
1371 
-
1372 
-
1373  /**
-
1374  * Print the nmodl constants used in backend code
-
1375  *
-
1376  * Currently we define three basic constants, which are assumed to be present in NMODL, directly
-
1377  * in the backend code:
-
1378  *
-
1379  * \code
-
1380  * static const double FARADAY = 96485.3;
-
1381  * static const double PI = 3.14159;
-
1382  * static const double R = 8.3145;
-
1383  * \endcode
-
1384  */
-
1385  void print_nmodl_constants();
-
1386 
-
1387 
-
1388  /****************************************************************************************/
-
1389  /* Overloaded visitor routines */
+
1304  /* Main code printing entry points */
+
1305  /****************************************************************************************/
+
1306 
+
1307 
+
1308  /**
+
1309  * Print all includes
+
1310  *
+
1311  */
+
1312  virtual void print_headers_include() = 0;
+
1313 
+
1314 
+
1315  /**
+
1316  * Print start of namespaces
+
1317  *
+
1318  */
+
1319  virtual void print_namespace_begin() = 0;
+
1320 
+
1321 
+
1322  /**
+
1323  * Print end of namespaces
+
1324  *
+
1325  */
+
1326  virtual void print_namespace_end() = 0;
+
1327 
+
1328 
+
1329  /**
+
1330  * Print all classes
+
1331  * \param print_initializers Whether to include default values.
+
1332  */
+
1333  virtual void print_data_structures(bool print_initializers) = 0;
+
1334 
+
1335 
+
1336  /**
+
1337  * Set v_unused (voltage) for NRN_PRCELLSTATE feature
+
1338  */
+
1339  virtual void print_v_unused() const = 0;
+
1340 
+
1341 
+
1342  /**
+
1343  * Set g_unused (conductance) for NRN_PRCELLSTATE feature
+
1344  */
+
1345  virtual void print_g_unused() const = 0;
+
1346 
+
1347 
+
1348  /**
+
1349  * Print all compute functions for every backend
+
1350  *
+
1351  */
+
1352  virtual void print_compute_functions() = 0;
+
1353 
+
1354 
+
1355  /**
+
1356  * Print entry point to code generation
+
1357  *
+
1358  */
+
1359  virtual void print_codegen_routines() = 0;
+
1360 
+
1361  std::unordered_map<CppObjectSpecifier, std::string> object_specifier_map = {
+
1362  {CppObjectSpecifier::Inline, "inline"},
+
1363  {CppObjectSpecifier::Static, "static"},
+
1364  {CppObjectSpecifier::Constexpr, "constexpr"},
+
1365  {CppObjectSpecifier::Volatile, "volatile"},
+
1366  {CppObjectSpecifier::Virtual, "virtual"},
+
1367  {CppObjectSpecifier::Explicit, "explicit"},
+
1368  {CppObjectSpecifier::Friend, "friend"},
+
1369  {CppObjectSpecifier::Extern, "extern"},
+
1370  {CppObjectSpecifier::ExternC, "extern \"C\""},
+
1371  {CppObjectSpecifier::ThreadLocal, "thread_local"},
+
1372  {CppObjectSpecifier::Const, "const"}};
+
1373 
+
1374 
+
1375  /**
+
1376  * Print the nmodl constants used in backend code
+
1377  *
+
1378  * Currently we define three basic constants, which are assumed to be present in NMODL, directly
+
1379  * in the backend code:
+
1380  *
+
1381  * \code
+
1382  * static const double FARADAY = 96485.3;
+
1383  * static const double PI = 3.14159;
+
1384  * static const double R = 8.3145;
+
1385  * \endcode
+
1386  */
+
1387  void print_nmodl_constants();
+
1388 
+
1389 
1390  /****************************************************************************************/
-
1391  void visit_binary_expression(const ast::BinaryExpression& node) override;
-
1392  void visit_binary_operator(const ast::BinaryOperator& node) override;
-
1393  void visit_boolean(const ast::Boolean& node) override;
-
1394  void visit_double(const ast::Double& node) override;
-
1395  void visit_else_if_statement(const ast::ElseIfStatement& node) override;
-
1396  void visit_else_statement(const ast::ElseStatement& node) override;
-
1397  void visit_float(const ast::Float& node) override;
-
1398  void visit_from_statement(const ast::FromStatement& node) override;
-
1399  void visit_function_call(const ast::FunctionCall& node) override;
-
1400  void visit_if_statement(const ast::IfStatement& node) override;
-
1401  void visit_indexed_name(const ast::IndexedName& node) override;
-
1402  void visit_integer(const ast::Integer& node) override;
-
1403  void visit_local_list_statement(const ast::LocalListStatement& node) override;
-
1404  void visit_name(const ast::Name& node) override;
-
1405  void visit_paren_expression(const ast::ParenExpression& node) override;
-
1406  void visit_prime_name(const ast::PrimeName& node) override;
-
1407  void visit_statement_block(const ast::StatementBlock& node) override;
-
1408  void visit_string(const ast::String& node) override;
-
1409  void visit_unary_operator(const ast::UnaryOperator& node) override;
-
1410  void visit_unit(const ast::Unit& node) override;
-
1411  void visit_var_name(const ast::VarName& node) override;
-
1412  void visit_verbatim(const ast::Verbatim& node) override;
-
1413  void visit_while_statement(const ast::WhileStatement& node) override;
-
1414  void visit_update_dt(const ast::UpdateDt& node) override;
-
1415  void visit_protect_statement(const ast::ProtectStatement& node) override;
-
1416  void visit_mutex_lock(const ast::MutexLock& node) override;
-
1417  void visit_mutex_unlock(const ast::MutexUnlock& node) override;
-
1418  void visit_solution_expression(const ast::SolutionExpression& node) override;
- - -
1421 
-
1422  std::string compute_method_name(BlockType type) const;
+
1391  /* Overloaded visitor routines */
+
1392  /****************************************************************************************/
+
1393  void visit_binary_expression(const ast::BinaryExpression& node) override;
+
1394  void visit_binary_operator(const ast::BinaryOperator& node) override;
+
1395  void visit_boolean(const ast::Boolean& node) override;
+
1396  void visit_double(const ast::Double& node) override;
+
1397  void visit_else_if_statement(const ast::ElseIfStatement& node) override;
+
1398  void visit_else_statement(const ast::ElseStatement& node) override;
+
1399  void visit_float(const ast::Float& node) override;
+
1400  void visit_from_statement(const ast::FromStatement& node) override;
+
1401  void visit_function_call(const ast::FunctionCall& node) override;
+
1402  void visit_if_statement(const ast::IfStatement& node) override;
+
1403  void visit_indexed_name(const ast::IndexedName& node) override;
+
1404  void visit_integer(const ast::Integer& node) override;
+
1405  void visit_local_list_statement(const ast::LocalListStatement& node) override;
+
1406  void visit_name(const ast::Name& node) override;
+
1407  void visit_paren_expression(const ast::ParenExpression& node) override;
+
1408  void visit_prime_name(const ast::PrimeName& node) override;
+
1409  void visit_statement_block(const ast::StatementBlock& node) override;
+
1410  void visit_string(const ast::String& node) override;
+
1411  void visit_unary_operator(const ast::UnaryOperator& node) override;
+
1412  void visit_unit(const ast::Unit& node) override;
+
1413  void visit_var_name(const ast::VarName& node) override;
+
1414  void visit_verbatim(const ast::Verbatim& node) override;
+
1415  void visit_while_statement(const ast::WhileStatement& node) override;
+
1416  void visit_update_dt(const ast::UpdateDt& node) override;
+
1417  void visit_protect_statement(const ast::ProtectStatement& node) override;
+
1418  void visit_mutex_lock(const ast::MutexLock& node) override;
+
1419  void visit_mutex_unlock(const ast::MutexUnlock& node) override;
+
1420  void visit_solution_expression(const ast::SolutionExpression& node) override;
+ +
1423 
-
1424  public:
-
1425  /** Setup the target backend code generator
-
1426  *
-
1427  * Typically called from within \c visit\_program but may be called from
-
1428  * specialized targets to setup this Code generator as fallback.
-
1429  */
-
1430  void setup(const ast::Program& node);
-
1431 
-
1432 
-
1433  /**
-
1434  * Main and only member function to call after creating an instance of this class.
-
1435  * \param program the AST to translate to C++ code
-
1436  */
-
1437  void visit_program(const ast::Program& program) override;
-
1438 
-
1439 
-
1440  /****************************************************************************************/
-
1441  /* Public printing routines for code generation for use in unit tests */
+
1424  std::string compute_method_name(BlockType type) const;
+
1425 
+
1426  public:
+
1427  /** Setup the target backend code generator
+
1428  *
+
1429  * Typically called from within \c visit\_program but may be called from
+
1430  * specialized targets to setup this Code generator as fallback.
+
1431  */
+
1432  void setup(const ast::Program& node);
+
1433 
+
1434 
+
1435  /**
+
1436  * Main and only member function to call after creating an instance of this class.
+
1437  * \param program the AST to translate to C++ code
+
1438  */
+
1439  void visit_program(const ast::Program& program) override;
+
1440 
+
1441 
1442  /****************************************************************************************/
-
1443 
-
1444 
-
1445  /**
-
1446  * Print the structure that wraps all range and int variables required for the NMODL
-
1447  *
-
1448  * \param print_initializers Whether or not default values for variables
-
1449  * be included in the struct declaration.
-
1450  */
-
1451  virtual void print_mechanism_range_var_structure(bool print_initializers) = 0;
-
1452 
-
1453 
-
1454  /**
-
1455  * Print replacement function for function or procedure using table
-
1456  * \param node The AST node representing a function or procedure block
-
1457  */
- -
1459 
-
1460 
-
1461  /**
-
1462  * Print \c check\_function() for functions or procedure using table
-
1463  * \param node The AST node representing a function or procedure block
-
1464  */
- -
1466 
-
1467 
- +
1443  /* Public printing routines for code generation for use in unit tests */
+
1444  /****************************************************************************************/
+
1445 
+
1446 
+
1447  /**
+
1448  * Print the structure that wraps all range and int variables required for the NMODL
+
1449  *
+
1450  * \param print_initializers Whether or not default values for variables
+
1451  * be included in the struct declaration.
+
1452  */
+
1453  virtual void print_mechanism_range_var_structure(bool print_initializers) = 0;
+
1454 
+
1455 
+
1456  /**
+
1457  * Print replacement function for function or procedure using table
+
1458  * \param node The AST node representing a function or procedure block
+
1459  */
+ +
1461 
+
1462 
+
1463  /**
+
1464  * Print \c check\_function() for functions or procedure using table
+
1465  * \param node The AST node representing a function or procedure block
+
1466  */
+ +
1468 
1469 
-
1470  std::string get_object_specifiers(const std::unordered_set<CppObjectSpecifier>&);
-
1471 
-
1472  /**
-
1473  * Print prototype declarations of functions or procedures
-
1474  * \tparam T The AST node type of the node (must be of nmodl::ast::Ast or subclass)
-
1475  * \param node The AST node representing the function or procedure block
-
1476  * \param name A user defined name for the function
-
1477  */
-
1478  template <typename T>
-
1479  void print_function_declaration(const T& node,
-
1480  const std::string& name,
-
1481  const std::unordered_set<CppObjectSpecifier>& = {
- -
1483 };
-
1484 
-
1485 /* Templated functions need to be defined in header file */
-
1486 template <typename T>
-
1487 void CodegenCppVisitor::print_vector_elements(const std::vector<T>& elements,
-
1488  const std::string& separator,
-
1489  const std::string& prefix) {
-
1490  for (auto iter = elements.begin(); iter != elements.end(); iter++) {
-
1491  printer->add_text(prefix);
-
1492  (*iter)->accept(*this);
-
1493  if (!separator.empty() && !nmodl::utils::is_last(iter, elements)) {
-
1494  printer->add_text(separator);
-
1495  }
-
1496  }
-
1497 }
-
1498 
-
1499 
-
1500 /**
-
1501  * \details If there is an argument with name (say alpha) same as range variable (say alpha),
-
1502  * we want to avoid it being printed as instance->alpha. And hence we disable variable
-
1503  * name lookup during prototype declaration. Note that the name of procedure can be
-
1504  * different in case of table statement.
-
1505  */
-
1506 template <typename T>
- -
1508  const T& node,
-
1509  const std::string& name,
-
1510  const std::unordered_set<CppObjectSpecifier>& specifiers) {
- -
1512  auto type = default_float_data_type();
-
1513 
-
1514  // internal and user provided arguments
-
1515  auto internal_params = internal_method_parameters();
-
1516  const auto& params = node.get_parameters();
-
1517  for (const auto& param: params) {
-
1518  internal_params.emplace_back("", type, "", param.get()->get_node_name());
-
1519  }
-
1520 
-
1521  // procedures have "int" return type by default
-
1522  const char* return_type = "int";
-
1523  if (node.is_function_block()) {
-
1524  return_type = default_float_data_type();
-
1525  }
-
1526 
-
1527  printer->add_indent();
-
1528  printer->fmt_text("{} {} {}({})",
-
1529  get_object_specifiers(specifiers),
-
1530  return_type,
-
1531  method_name(name),
-
1532  get_parameter_str(internal_params));
-
1533 
- -
1535 }
-
1536 
-
1537 /** \} */ // end of codegen_backends
-
1538 
-
1539 } // namespace codegen
-
1540 } // namespace nmodl
+ +
1471 
+
1472  std::string get_object_specifiers(const std::unordered_set<CppObjectSpecifier>&);
+
1473 
+
1474  /**
+
1475  * Print prototype declarations of functions or procedures
+
1476  * \tparam T The AST node type of the node (must be of nmodl::ast::Ast or subclass)
+
1477  * \param node The AST node representing the function or procedure block
+
1478  * \param name A user defined name for the function
+
1479  */
+
1480  template <typename T>
+
1481  void print_function_declaration(const T& node,
+
1482  const std::string& name,
+
1483  const std::unordered_set<CppObjectSpecifier>& = {
+ +
1485 };
+
1486 
+
1487 /* Templated functions need to be defined in header file */
+
1488 template <typename T>
+
1489 void CodegenCppVisitor::print_vector_elements(const std::vector<T>& elements,
+
1490  const std::string& separator,
+
1491  const std::string& prefix) {
+
1492  for (auto iter = elements.begin(); iter != elements.end(); iter++) {
+
1493  printer->add_text(prefix);
+
1494  (*iter)->accept(*this);
+
1495  if (!separator.empty() && !nmodl::utils::is_last(iter, elements)) {
+
1496  printer->add_text(separator);
+
1497  }
+
1498  }
+
1499 }
+
1500 
+
1501 
+
1502 /**
+
1503  * \details If there is an argument with name (say alpha) same as range variable (say alpha),
+
1504  * we want to avoid it being printed as instance->alpha. And hence we disable variable
+
1505  * name lookup during prototype declaration. Note that the name of procedure can be
+
1506  * different in case of table statement.
+
1507  */
+
1508 template <typename T>
+ +
1510  const T& node,
+
1511  const std::string& name,
+
1512  const std::unordered_set<CppObjectSpecifier>& specifiers) {
+ +
1514  auto type = default_float_data_type();
+
1515 
+
1516  // internal and user provided arguments
+
1517  auto internal_params = internal_method_parameters();
+
1518  const auto& params = node.get_parameters();
+
1519  for (const auto& param: params) {
+
1520  internal_params.emplace_back("", type, "", param.get()->get_node_name());
+
1521  }
+
1522 
+
1523  // procedures have "int" return type by default
+
1524  const char* return_type = "int";
+
1525  if (node.is_function_block()) {
+
1526  return_type = default_float_data_type();
+
1527  }
+
1528 
+
1529  printer->add_indent();
+
1530  printer->fmt_text("{} {} {}({})",
+
1531  get_object_specifiers(specifiers),
+
1532  return_type,
+
1533  method_name(name),
+
1534  get_parameter_str(internal_params));
+
1535 
+ +
1537 }
+
1538 
+
1539 /** \} */ // end of codegen_backends
+
1540 
+
1541 } // namespace codegen
+
1542 } // namespace nmodl
virtual void print_nrn_constructor()=0
Print nrn_constructor function definition.
+
std::string table_update_function_name(const std::string &block_name) const
The name of the function that updates the table value if the parameters changed.
void visit_eigen_linear_solver_block(const ast::EigenLinearSolverBlock &node) override
visit node of type ast::EigenLinearSolverBlock
bool ion_variable_struct_required() const
Check if a structure for ion variables is required.
bool is_last(Iter iter, const Cont &cont)
Check if the iterator is pointing to last element in the container.
@@ -1704,7 +1707,7 @@
encapsulates code generation backend implementations
Definition: ast_common.hpp:26
@ index
index / int variables
const std::string & float_data_type() const noexcept
Data type for floating point elements specified on command line.
-
Represent ions used in mod file.
+
Represent ions used in mod file.
virtual void print_function(const ast::FunctionBlock &node)=0
Print NMODL function in target backend code.
Implement classes for representing symbol table at block and file scope.
@@ -1712,7 +1715,6 @@
bool range_variable_setup_required() const noexcept
Check if setup_range_variable function is required.
Represent MUTEXLOCK statement in NMODL.
Definition: mutex_lock.hpp:38
void print_statement_block(const ast::StatementBlock &node, bool open_brace=true, bool close_brace=true)
Print any statement block in nmodl with option to (not) print braces.
-
std::string table_function_prefix() const
Prefix used for the function that performs the lazy update.
virtual std::string global_variable_name(const SymbolType &symbol, bool use_instance=true) const =0
Determine the variable name for a global variable given its symbol.
Represents TABLE statement in NMODL.
@@ -1720,14 +1722,14 @@
Represents a variable.
Definition: var_name.hpp:43
Represents an integer variable.
Definition: integer.hpp:49
@ BlockTypeEnd
fake ending block type for loops on the enums. Keep it at the end
-
std::string get_object_specifiers(const std::unordered_set< CppObjectSpecifier > &)
+
std::string get_object_specifiers(const std::unordered_set< CppObjectSpecifier > &)
std::vector< SymbolType > get_float_variables() const
Determine all float variables required during code generation.
virtual void print_net_move_call(const ast::FunctionCall &node)=0
Print call to net_move.
const char * default_int_data_type() const noexcept
Default data type for integer (offset) elements.
-
std::string mod_suffix
name of the suffix
+
std::string mod_suffix
name of the suffix
parser::NmodlParser::symbol_type SymbolType
Definition: nmodl_utils.hpp:26
-
Represent information collected from AST for code generation.
+
Represent information collected from AST for code generation.
void visit_paren_expression(const ast::ParenExpression &node) override
visit node of type ast::ParenExpression
const char * default_float_data_type() const noexcept
Default data type for floating point elements.
bool net_receive_buffering_required() const noexcept
Check if net receive/send buffering kernels required.
@@ -1738,10 +1740,10 @@
bool is_integer
if this is an integer (e.g.
virtual std::string int_variable_name(const IndexVariableInfo &symbol, const std::string &name, bool use_instance) const =0
Determine the name of an int variable given its symbol.
void visit_unit(const ast::Unit &node) override
visit node of type ast::Unit
-
std::unordered_map< CppObjectSpecifier, std::string > object_specifier_map
+
std::unordered_map< CppObjectSpecifier, std::string > object_specifier_map
Represent newton solver solution block based on Eigen.
void visit_update_dt(const ast::UpdateDt &node) override
visit node of type ast::UpdateDt
-
void print_vector_elements(const std::vector< T > &elements, const std::string &separator, const std::string &prefix="")
Print the items in a vector as a list.
+
void print_vector_elements(const std::vector< T > &elements, const std::string &separator, const std::string &prefix="")
Print the items in a vector as a list.
IndexVariableInfo(std::shared_ptr< symtab::Symbol > symbol, bool is_vdata=false, bool is_index=false, bool is_integer=false)
virtual void add_variable_point_process(std::vector< IndexVariableInfo > &variables)=0
Add the variable point_process during get_int_variables.
static constexpr char DEFAULT_FLOAT_TYPE[]
default float variable type
@@ -1815,12 +1817,12 @@
bool printing_net_receive
true if currently net_receive block being printed
virtual std::string process_verbatim_text(std::string const &text)=0
Process a verbatim block for possible variable renaming.
Statement to indicate a change in timestep in a given block.
Definition: update_dt.hpp:38
-
const ast::TableStatement * get_table_statement(const ast::Block &)
+
const ast::TableStatement * get_table_statement(const ast::Block &)
virtual void print_global_variables_for_hoc()=0
Print byte arrays that register scalar and vector variables for hoc interface.
std::string format_float_string(const std::string &value)
Convert a given float value to its string representation.
-
std::tuple< bool, int > check_if_var_is_array(const std::string &name)
Check if the given name exist in the symbol.
+
std::tuple< bool, int > check_if_var_is_array(const std::string &name)
Check if the given name exist in the symbol.
bool is_functor_const(const ast::StatementBlock &variable_block, const ast::StatementBlock &functor_block)
Checks whether the functor_block generated by sympy solver modifies any variable outside its scope.
static std::string get_parameter_str(const ParamVector &params)
Generate the string representing the procedure parameter declaration.
@@ -1833,7 +1835,7 @@
virtual std::string internal_method_arguments()=0
Arguments for functions that are defined and used internally.
std::string global_struct() const
Name of structure that wraps global variables.
-
bool electrode_current
if electrode current specified
+
bool electrode_current
if electrode current specified
void rename_function_arguments()
Rename function/procedure arguments that conflict with default arguments.
virtual ParamVector internal_method_parameters()=0
Parameters for internally defined functions.
virtual void print_nrn_destructor()=0
Print nrn_destructor function definition.
@@ -1905,7 +1907,7 @@
virtual void print_data_structures(bool print_initializers)=0
Print all classes.
std::string format_double_string(const std::string &value)
Convert a given double value to its string representation.
Represent token returned by scanner.
Definition: modtoken.hpp:50
-
void print_function_declaration(const T &node, const std::string &name, const std::unordered_set< CppObjectSpecifier > &={ CppObjectSpecifier::Inline})
Print prototype declarations of functions or procedures.
+
void print_function_declaration(const T &node, const std::string &name, const std::unordered_set< CppObjectSpecifier > &={ CppObjectSpecifier::Inline})
Print prototype declarations of functions or procedures.
Represents a string.
Definition: string.hpp:52
virtual void print_nrn_state()=0
Print nrn_state / state update function definition.
virtual std::string backend_name() const =0
Name of the code generation backend.
diff --git a/doxygen/codegen__helper__visitor_8cpp_source.html b/doxygen/codegen__helper__visitor_8cpp_source.html index 3eee59c76..0a2dabefb 100644 --- a/doxygen/codegen__helper__visitor_8cpp_source.html +++ b/doxygen/codegen__helper__visitor_8cpp_source.html @@ -169,500 +169,500 @@
73  std::vector<std::string> ion_vars;
74  std::vector<std::string> read_ion_vars;
75  std::vector<std::string> write_ion_vars;
-
76 
-
77  for (const auto& ion_node: ion_nodes) {
-
78  const auto& ion = std::dynamic_pointer_cast<const ast::Useion>(ion_node);
-
79  ion_vars.push_back(ion->get_node_name());
-
80  for (const auto& var: ion->get_readlist()) {
-
81  read_ion_vars.push_back(var->get_node_name());
-
82  }
-
83  for (const auto& var: ion->get_writelist()) {
-
84  write_ion_vars.push_back(var->get_node_name());
-
85  }
-
86  }
-
87 
-
88  /**
-
89  * Check if given variable belongs to given ion.
-
90  * For example, eca belongs to ca ion, nai belongs to na ion.
-
91  * We just check if we exclude first/last char, if that is ion name.
-
92  */
-
93  auto ion_variable = [](const std::string& var, const std::string& ion) -> bool {
-
94  auto len = var.size() - 1;
-
95  return (var.substr(1, len) == ion || var.substr(0, len) == ion);
-
96  };
-
97 
-
98  /// iterate over all ion types and construct the Ion objects
-
99  for (auto& ion_name: ion_vars) {
-
100  Ion ion(ion_name);
-
101  for (auto& read_var: read_ion_vars) {
-
102  if (ion_variable(read_var, ion_name)) {
-
103  ion.reads.push_back(read_var);
-
104  }
-
105  }
-
106  for (auto& write_var: write_ion_vars) {
-
107  if (ion_variable(write_var, ion_name)) {
-
108  ion.writes.push_back(write_var);
-
109  if (ion.is_intra_cell_conc(write_var) || ion.is_extra_cell_conc(write_var)) {
-
110  ion.need_style = true;
-
111  info.write_concentration = true;
-
112  }
-
113  }
-
114  }
-
115  info.ions.push_back(std::move(ion));
-
116  }
-
117 
-
118  /// once ions are populated, we can find all currents
-
119  auto vars = psymtab->get_variables_with_properties(NmodlType::nonspecific_cur_var);
-
120  for (auto& var: vars) {
-
121  info.currents.push_back(var->get_name());
-
122  }
-
123  vars = psymtab->get_variables_with_properties(NmodlType::electrode_cur_var);
-
124  for (auto& var: vars) {
-
125  info.currents.push_back(var->get_name());
+
76  std::map<std::string, double> valences;
+
77 
+
78  for (const auto& ion_node: ion_nodes) {
+
79  const auto& ion = std::dynamic_pointer_cast<const ast::Useion>(ion_node);
+
80  auto ion_name = ion->get_node_name();
+
81  ion_vars.push_back(ion_name);
+
82  for (const auto& var: ion->get_readlist()) {
+
83  read_ion_vars.push_back(var->get_node_name());
+
84  }
+
85  for (const auto& var: ion->get_writelist()) {
+
86  write_ion_vars.push_back(var->get_node_name());
+
87  }
+
88 
+
89  if (ion->get_valence() != nullptr) {
+
90  valences[ion_name] = ion->get_valence()->get_value()->to_double();
+
91  }
+
92  }
+
93 
+
94  /**
+
95  * Check if given variable belongs to given ion.
+
96  * For example, eca belongs to ca ion, nai belongs to na ion.
+
97  * We just check if we exclude first/last char, if that is ion name.
+
98  */
+
99  auto ion_variable = [](const std::string& var, const std::string& ion) -> bool {
+
100  auto len = var.size() - 1;
+
101  return (var.substr(1, len) == ion || var.substr(0, len) == ion);
+
102  };
+
103 
+
104  /// iterate over all ion types and construct the Ion objects
+
105  for (auto& ion_name: ion_vars) {
+
106  Ion ion(ion_name);
+
107  for (auto& read_var: read_ion_vars) {
+
108  if (ion_variable(read_var, ion_name)) {
+
109  ion.reads.push_back(read_var);
+
110  }
+
111  }
+
112  for (auto& write_var: write_ion_vars) {
+
113  if (ion_variable(write_var, ion_name)) {
+
114  ion.writes.push_back(write_var);
+
115  if (ion.is_intra_cell_conc(write_var) || ion.is_extra_cell_conc(write_var)) {
+
116  ion.need_style = true;
+
117  info.write_concentration = true;
+
118  }
+
119  }
+
120  }
+
121  if (auto it = valences.find(ion_name); it != valences.end()) {
+
122  ion.valence = it->second;
+
123  }
+
124 
+
125  info.ions.push_back(std::move(ion));
126  }
-
127  for (auto& ion: info.ions) {
-
128  for (auto& var: ion.writes) {
-
129  if (ion.is_ionic_current(var)) {
-
130  info.currents.push_back(var);
-
131  }
-
132  }
-
133  }
-
134 
-
135  /// check if write_conc(...) will be needed
-
136  for (const auto& ion: info.ions) {
-
137  for (const auto& var: ion.writes) {
-
138  if (!ion.is_ionic_current(var) && !ion.is_rev_potential(var)) {
-
139  info.require_wrote_conc = true;
-
140  }
-
141  }
-
142  }
-
143 }
-
144 
-
145 
-
146 /**
-
147  * Find non-range variables i.e. ones that are not belong to per instance allocation
-
148  *
-
149  * Certain variables like pointers, global, parameters are not necessary to be per
-
150  * instance variables. NEURON apply certain rules to determine which variables become
-
151  * thread, static or global variables. Here we construct those variables.
-
152  */
- -
154  /**
-
155  * Top local variables are local variables appear in global scope. All local
-
156  * variables in program symbol table are in global scope.
-
157  */
-
158  info.constant_variables = psymtab->get_variables_with_properties(NmodlType::constant_var);
-
159  info.top_local_variables = psymtab->get_variables_with_properties(NmodlType::local_var);
-
160 
-
161  /**
-
162  * All global variables remain global if mod file is not marked thread safe.
-
163  * Otherwise, global variables written at least once gets promoted to thread variables.
-
164  */
-
165 
-
166  std::string variables;
-
167 
-
168  auto vars = psymtab->get_variables_with_properties(NmodlType::global_var);
-
169  for (auto& var: vars) {
-
170  if (info.thread_safe && var->get_write_count() > 0) {
-
171  var->mark_thread_safe();
-
172  info.thread_variables.push_back(var);
-
173  info.thread_var_data_size += var->get_length();
-
174  variables += " " + var->get_name();
-
175  } else {
-
176  info.global_variables.push_back(var);
-
177  }
-
178  }
-
179 
-
180  /**
-
181  * If parameter is not a range and used only as read variable then it becomes global
-
182  * variable. To qualify it as thread variable it must be be written at least once and
-
183  * mod file must be marked as thread safe.
-
184  * To exclusively get parameters only, we exclude all other variables (in without)
-
185  * and then sort them with neuron/mod2c order.
-
186  */
-
187  // clang-format off
-
188  auto with = NmodlType::param_assign;
-
189  auto without = NmodlType::range_var
-
190  | NmodlType::assigned_definition
-
191  | NmodlType::global_var
-
192  | NmodlType::pointer_var
-
193  | NmodlType::bbcore_pointer_var
-
194  | NmodlType::read_ion_var
-
195  | NmodlType::write_ion_var;
-
196  // clang-format on
-
197  vars = psymtab->get_variables(with, without);
-
198  for (auto& var: vars) {
-
199  // some variables like area and diam are declared in parameter
-
200  // block but they are not global
-
201  if (var->get_name() == naming::DIAM_VARIABLE || var->get_name() == naming::AREA_VARIABLE ||
-
202  var->has_any_property(NmodlType::extern_neuron_variable)) {
-
203  continue;
-
204  }
-
205 
-
206  // if model is thread safe and if parameter is being written then
-
207  // those variables should be promoted to thread safe variable
-
208  if (info.thread_safe && var->get_write_count() > 0) {
-
209  var->mark_thread_safe();
-
210  info.thread_variables.push_back(var);
-
211  info.thread_var_data_size += var->get_length();
-
212  } else {
-
213  info.global_variables.push_back(var);
+
127 
+
128  /// once ions are populated, we can find all currents
+
129  auto vars = psymtab->get_variables_with_properties(NmodlType::nonspecific_cur_var);
+
130  for (auto& var: vars) {
+
131  info.currents.push_back(var->get_name());
+
132  }
+
133  vars = psymtab->get_variables_with_properties(NmodlType::electrode_cur_var);
+
134  for (auto& var: vars) {
+
135  info.currents.push_back(var->get_name());
+
136  }
+
137  for (auto& ion: info.ions) {
+
138  for (auto& var: ion.writes) {
+
139  if (ion.is_ionic_current(var)) {
+
140  info.currents.push_back(var);
+
141  }
+
142  }
+
143  }
+
144 
+
145  /// check if write_conc(...) will be needed
+
146  for (const auto& ion: info.ions) {
+
147  for (const auto& var: ion.writes) {
+
148  if (!ion.is_ionic_current(var) && !ion.is_rev_potential(var)) {
+
149  info.require_wrote_conc = true;
+
150  }
+
151  }
+
152  }
+
153 }
+
154 
+
155 
+
156 /**
+
157  * Find non-range variables i.e. ones that are not belong to per instance allocation
+
158  *
+
159  * Certain variables like pointers, global, parameters are not necessary to be per
+
160  * instance variables. NEURON apply certain rules to determine which variables become
+
161  * thread, static or global variables. Here we construct those variables.
+
162  */
+ +
164  /**
+
165  * Top local variables are local variables appear in global scope. All local
+
166  * variables in program symbol table are in global scope.
+
167  */
+
168  info.constant_variables = psymtab->get_variables_with_properties(NmodlType::constant_var);
+
169  info.top_local_variables = psymtab->get_variables_with_properties(NmodlType::local_var);
+
170 
+
171  /**
+
172  * All global variables remain global if mod file is not marked thread safe.
+
173  * Otherwise, global variables written at least once gets promoted to thread variables.
+
174  */
+
175 
+
176  std::string variables;
+
177 
+
178  auto vars = psymtab->get_variables_with_properties(NmodlType::global_var);
+
179  for (auto& var: vars) {
+
180  if (info.thread_safe && var->get_write_count() > 0) {
+
181  var->mark_thread_safe();
+
182  info.thread_variables.push_back(var);
+
183  info.thread_var_data_size += var->get_length();
+
184  variables += " " + var->get_name();
+
185  } else {
+
186  info.global_variables.push_back(var);
+
187  }
+
188  }
+
189 
+
190  /**
+
191  * If parameter is not a range and used only as read variable then it becomes global
+
192  * variable. To qualify it as thread variable it must be be written at least once and
+
193  * mod file must be marked as thread safe.
+
194  * To exclusively get parameters only, we exclude all other variables (in without)
+
195  * and then sort them with neuron/mod2c order.
+
196  */
+
197  // clang-format off
+
198  auto with = NmodlType::param_assign;
+
199  auto without = NmodlType::range_var
+
200  | NmodlType::assigned_definition
+
201  | NmodlType::global_var
+
202  | NmodlType::pointer_var
+
203  | NmodlType::bbcore_pointer_var
+
204  | NmodlType::read_ion_var
+
205  | NmodlType::write_ion_var;
+
206  // clang-format on
+
207  vars = psymtab->get_variables(with, without);
+
208  for (auto& var: vars) {
+
209  // some variables like area and diam are declared in parameter
+
210  // block but they are not global
+
211  if (var->get_name() == naming::DIAM_VARIABLE || var->get_name() == naming::AREA_VARIABLE ||
+
212  var->has_any_property(NmodlType::extern_neuron_variable)) {
+
213  continue;
214  }
-
215  }
-
216  sort_with_mod2c_symbol_order(info.thread_variables);
-
217 
-
218  /**
-
219  * \todo Below we calculate thread related id and sizes. This will
-
220  * need to do from global analysis pass as here we are handling
-
221  * top local variables, global variables, derivimplicit method.
-
222  * There might be more use cases with other solver methods.
-
223  */
-
224 
-
225  /**
-
226  * If derivimplicit is used, then first three thread ids get assigned to:
-
227  * 1st thread is used for: deriv_advance
-
228  * 2nd thread is used for: dith
-
229  * 3rd thread is used for: newtonspace
-
230  *
-
231  * slist and dlist represent the offsets for prime variables used. For
-
232  * euler or derivimplicit methods its always first number.
+
215 
+
216  // if model is thread safe and if parameter is being written then
+
217  // those variables should be promoted to thread safe variable
+
218  if (info.thread_safe && var->get_write_count() > 0) {
+
219  var->mark_thread_safe();
+
220  info.thread_variables.push_back(var);
+
221  info.thread_var_data_size += var->get_length();
+
222  } else {
+
223  info.global_variables.push_back(var);
+
224  }
+
225  }
+
226  sort_with_mod2c_symbol_order(info.thread_variables);
+
227 
+
228  /**
+
229  * \todo Below we calculate thread related id and sizes. This will
+
230  * need to do from global analysis pass as here we are handling
+
231  * top local variables, global variables, derivimplicit method.
+
232  * There might be more use cases with other solver methods.
233  */
-
234  if (info.derivimplicit_used()) {
-
235  info.derivimplicit_var_thread_id = 0;
-
236  info.thread_data_index = 3;
-
237  info.derivimplicit_list_num = 1;
-
238  info.thread_callback_register = true;
-
239  }
-
240 
-
241  /// next thread id is allocated for top local variables
-
242  if (info.vectorize && !info.top_local_variables.empty()) {
-
243  info.top_local_thread_id = info.thread_data_index++;
-
244  info.thread_callback_register = true;
-
245  }
-
246 
-
247  /// next thread id is allocated for thread promoted variables
-
248  if (info.vectorize && !info.thread_variables.empty()) {
-
249  info.thread_var_thread_id = info.thread_data_index++;
-
250  info.thread_callback_register = true;
-
251  }
-
252 
-
253  /// find total size of local variables in global scope
-
254  for (auto& var: info.top_local_variables) {
-
255  info.top_local_thread_size += var->get_length();
-
256  }
-
257 
-
258  /// find number of prime variables and total size
-
259  auto primes = psymtab->get_variables_with_properties(NmodlType::prime_name);
-
260  info.num_primes = static_cast<int>(primes.size());
-
261  for (auto& variable: primes) {
-
262  info.primes_size += variable->get_length();
-
263  }
-
264 
-
265  /// find pointer or bbcore pointer variables
-
266  // clang-format off
-
267  auto properties = NmodlType::pointer_var
-
268  | NmodlType::bbcore_pointer_var;
-
269  // clang-format on
-
270  info.pointer_variables = psymtab->get_variables_with_properties(properties);
-
271 
-
272  /// find RANDOM variables
-
273  // clang-format off
-
274  properties = NmodlType::random_var;
-
275  // clang-format on
-
276  info.random_variables = psymtab->get_variables_with_properties(properties);
-
277 
-
278  // find special variables like diam, area
-
279  // clang-format off
-
280  properties = NmodlType::assigned_definition
-
281  | NmodlType::param_assign;
-
282  vars = psymtab->get_variables_with_properties(properties);
-
283  for (auto& var : vars) {
-
284  if (var->get_name() == naming::AREA_VARIABLE) {
-
285  info.area_used = true;
-
286  }
-
287  if (var->get_name() == naming::DIAM_VARIABLE) {
-
288  info.diam_used = true;
-
289  }
-
290  }
-
291  // clang-format on
-
292 }
-
293 
-
294 /**
-
295  * Find range variables i.e. ones that are belong to per instance allocation
-
296  *
-
297  * In order to be compatible with NEURON, we need to print all variables in
-
298  * exact order as NEURON/MOD2C implementation. This is important because memory
-
299  * for all variables is allocated in single 1-D array with certain offset
-
300  * for each variable. The order of variables determine the offset and hence
-
301  * they must be in same order as NEURON.
-
302  *
-
303  * Here is how order is determined into NEURON/MOD2C implementation:
-
304  *
-
305  * First, following three lists are created
-
306  * - variables with parameter and range property (List 1)
-
307  * - variables with state and range property (List 2)
-
308  * - variables with assigned and range property (List 3)
-
309  *
-
310  * Once created, we remove some variables due to the following criteria:
-
311  * - In NEURON/MOD2C implementation, we remove variables with NRNPRANGEIN
-
312  * or NRNPRANGEOUT type
-
313  * - So who has NRNPRANGEIN and NRNPRANGEOUT type? these are USEION read
-
314  * or write variables that are not ionic currents.
-
315  * - This is the reason for mod files CaDynamics_E2.mod or cal_mig.mod, ica variable
-
316  * is printed earlier in the list but other variables like cai, cao don't appear
-
317  * in same order.
-
318  *
-
319  * Finally we create 4th list:
-
320  * - variables with assigned property and not in the previous 3 lists
-
321  *
-
322  * We now print the variables in following order:
-
323  *
-
324  * - List 1 i.e. range + parameter variables are printed first
-
325  * - List 3 i.e. range + assigned variables are printed next
-
326  * - List 2 i.e. range + state variables are printed next
-
327  * - List 4 i.e. assigned and ion variables not present in the previous 3 lists
+
234 
+
235  /**
+
236  * If derivimplicit is used, then first three thread ids get assigned to:
+
237  * 1st thread is used for: deriv_advance
+
238  * 2nd thread is used for: dith
+
239  * 3rd thread is used for: newtonspace
+
240  *
+
241  * slist and dlist represent the offsets for prime variables used. For
+
242  * euler or derivimplicit methods its always first number.
+
243  */
+
244  if (info.derivimplicit_used()) {
+
245  info.derivimplicit_var_thread_id = 0;
+
246  info.thread_data_index = 3;
+
247  info.derivimplicit_list_num = 1;
+
248  info.thread_callback_register = true;
+
249  }
+
250 
+
251  /// next thread id is allocated for top local variables
+
252  if (info.vectorize && !info.top_local_variables.empty()) {
+
253  info.top_local_thread_id = info.thread_data_index++;
+
254  info.thread_callback_register = true;
+
255  }
+
256 
+
257  /// next thread id is allocated for thread promoted variables
+
258  if (info.vectorize && !info.thread_variables.empty()) {
+
259  info.thread_var_thread_id = info.thread_data_index++;
+
260  info.thread_callback_register = true;
+
261  }
+
262 
+
263  /// find total size of local variables in global scope
+
264  for (auto& var: info.top_local_variables) {
+
265  info.top_local_thread_size += var->get_length();
+
266  }
+
267 
+
268  /// find number of prime variables and total size
+
269  auto primes = psymtab->get_variables_with_properties(NmodlType::prime_name);
+
270  info.num_primes = static_cast<int>(primes.size());
+
271  for (auto& variable: primes) {
+
272  info.primes_size += variable->get_length();
+
273  }
+
274 
+
275  /// find pointer or bbcore pointer variables
+
276  // clang-format off
+
277  auto properties = NmodlType::pointer_var
+
278  | NmodlType::bbcore_pointer_var;
+
279  // clang-format on
+
280  info.pointer_variables = psymtab->get_variables_with_properties(properties);
+
281 
+
282  /// find RANDOM variables
+
283  // clang-format off
+
284  properties = NmodlType::random_var;
+
285  // clang-format on
+
286  info.random_variables = psymtab->get_variables_with_properties(properties);
+
287 
+
288  // find special variables like diam, area
+
289  // clang-format off
+
290  properties = NmodlType::assigned_definition
+
291  | NmodlType::param_assign;
+
292  vars = psymtab->get_variables_with_properties(properties);
+
293  for (auto& var : vars) {
+
294  if (var->get_name() == naming::AREA_VARIABLE) {
+
295  info.area_used = true;
+
296  }
+
297  if (var->get_name() == naming::DIAM_VARIABLE) {
+
298  info.diam_used = true;
+
299  }
+
300  }
+
301  // clang-format on
+
302 }
+
303 
+
304 /**
+
305  * Find range variables i.e. ones that are belong to per instance allocation
+
306  *
+
307  * In order to be compatible with NEURON, we need to print all variables in
+
308  * exact order as NEURON/MOD2C implementation. This is important because memory
+
309  * for all variables is allocated in single 1-D array with certain offset
+
310  * for each variable. The order of variables determine the offset and hence
+
311  * they must be in same order as NEURON.
+
312  *
+
313  * Here is how order is determined into NEURON/MOD2C implementation:
+
314  *
+
315  * First, following three lists are created
+
316  * - variables with parameter and range property (List 1)
+
317  * - variables with state and range property (List 2)
+
318  * - variables with assigned and range property (List 3)
+
319  *
+
320  * Once created, we remove some variables due to the following criteria:
+
321  * - In NEURON/MOD2C implementation, we remove variables with NRNPRANGEIN
+
322  * or NRNPRANGEOUT type
+
323  * - So who has NRNPRANGEIN and NRNPRANGEOUT type? these are USEION read
+
324  * or write variables that are not ionic currents.
+
325  * - This is the reason for mod files CaDynamics_E2.mod or cal_mig.mod, ica variable
+
326  * is printed earlier in the list but other variables like cai, cao don't appear
+
327  * in same order.
328  *
-
329  * NOTE:
-
330  * - State variables also have the property `assigned_definition` but these variables
-
331  * are not from ASSIGNED block.
-
332  * - Variable can not be range as well as state, it's redeclaration error
-
333  * - Variable can be parameter as well as range. Without range, parameter
-
334  * is considered as global variable i.e. one value for all instances.
-
335  * - If a variable is only defined as RANGE and not in assigned or parameter
-
336  * or state block then it's not printed.
-
337  * - Note that a variable property is different than the variable type. For example,
-
338  * if variable has range property, it doesn't mean the variable is declared as RANGE.
-
339  * Other variables like STATE and ASSIGNED block variables also get range property
-
340  * without being explicitly declared as RANGE in the mod file.
-
341  * - Also, there is difference between declaration order vs. definition order. For
-
342  * example, POINTER variable in NEURON block is just declaration and doesn't
-
343  * determine the order in which they will get printed. Below we query symbol table
-
344  * and order all instance variables into certain order.
-
345  */
- -
347  /// comparator to decide the order based on definition
-
348  auto comparator = [](const SymbolType& first, const SymbolType& second) -> bool {
-
349  return first->get_definition_order() < second->get_definition_order();
-
350  };
-
351 
-
352  /// from symbols vector `vars`, remove all ion variables which are not ionic currents
-
353  auto remove_non_ioncur_vars = [](SymbolVectorType& vars, const CodegenInfo& info) -> void {
-
354  vars.erase(std::remove_if(vars.begin(),
-
355  vars.end(),
-
356  [&](SymbolType& s) {
-
357  return info.is_ion_variable(s->get_name()) &&
-
358  !info.is_ionic_current(s->get_name());
-
359  }),
-
360  vars.end());
-
361  };
-
362 
-
363  /// if `secondary` vector contains any symbol that exist in the `primary` then remove it
-
364  auto remove_var_exist = [](SymbolVectorType& primary, SymbolVectorType& secondary) -> void {
-
365  secondary.erase(std::remove_if(secondary.begin(),
-
366  secondary.end(),
-
367  [&primary](const SymbolType& tosearch) {
-
368  return std::find_if(primary.begin(),
-
369  primary.end(),
-
370  // compare by symbol name
-
371  [&tosearch](
-
372  const SymbolType& symbol) {
-
373  return tosearch->get_name() ==
-
374  symbol->get_name();
-
375  }) != primary.end();
-
376  }),
-
377  secondary.end());
-
378  };
-
379 
-
380  /**
-
381  * First come parameters which are range variables.
-
382  */
-
383  // clang-format off
-
384  auto with = NmodlType::range_var
-
385  | NmodlType::param_assign;
-
386  auto without = NmodlType::global_var
-
387  | NmodlType::pointer_var
-
388  | NmodlType::bbcore_pointer_var
-
389  | NmodlType::state_var;
-
390 
-
391  // clang-format on
-
392  info.range_parameter_vars = psymtab->get_variables(with, without);
-
393  remove_non_ioncur_vars(info.range_parameter_vars, info);
-
394  std::sort(info.range_parameter_vars.begin(), info.range_parameter_vars.end(), comparator);
-
395 
-
396  /**
-
397  * Second come assigned variables which are range variables.
-
398  */
-
399  // clang-format off
-
400  with = NmodlType::range_var
-
401  | NmodlType::assigned_definition;
-
402  without = NmodlType::global_var
-
403  | NmodlType::pointer_var
-
404  | NmodlType::bbcore_pointer_var
-
405  | NmodlType::state_var
-
406  | NmodlType::param_assign;
-
407 
-
408  // clang-format on
-
409  info.range_assigned_vars = psymtab->get_variables(with, without);
-
410  remove_non_ioncur_vars(info.range_assigned_vars, info);
-
411  std::sort(info.range_assigned_vars.begin(), info.range_assigned_vars.end(), comparator);
-
412 
-
413 
-
414  /**
-
415  * Third come state variables. All state variables are kind of range by default.
-
416  * Note that some mod files like CaDynamics_E2.mod use cai as state variable which
-
417  * appear in USEION read/write list. These variables are not considered in this
-
418  * variables because non ionic-current variables are removed and printed later.
-
419  */
-
420  // clang-format off
-
421  with = NmodlType::state_var;
-
422  without = NmodlType::global_var
-
423  | NmodlType::pointer_var
-
424  | NmodlType::bbcore_pointer_var;
-
425 
-
426  // clang-format on
-
427  info.state_vars = psymtab->get_variables(with, without);
-
428  std::sort(info.state_vars.begin(), info.state_vars.end(), comparator);
-
429 
-
430  /// range_state_vars is copy of state variables but without non ionic current variables
-
431  info.range_state_vars = info.state_vars;
-
432  remove_non_ioncur_vars(info.range_state_vars, info);
-
433 
-
434  /// Remaining variables are assigned and ion variables which are not in the previous 3 lists
-
435 
-
436  // clang-format off
-
437  with = NmodlType::assigned_definition
-
438  | NmodlType::read_ion_var
-
439  | NmodlType::write_ion_var;
-
440  without = NmodlType::global_var
-
441  | NmodlType::pointer_var
-
442  | NmodlType::bbcore_pointer_var
-
443  | NmodlType::extern_neuron_variable;
-
444  // clang-format on
-
445  const auto& variables = psymtab->get_variables_with_properties(with, false);
-
446  for (const auto& variable: variables) {
-
447  if (!variable->has_any_property(without)) {
-
448  info.assigned_vars.push_back(variable);
-
449  }
-
450  }
-
451 
-
452  /// make sure that variables already present in previous lists
-
453  /// are removed to avoid any duplication
-
454  remove_var_exist(info.range_parameter_vars, info.assigned_vars);
-
455  remove_var_exist(info.range_assigned_vars, info.assigned_vars);
-
456  remove_var_exist(info.range_state_vars, info.assigned_vars);
-
457 
-
458  /// sort variables with their definition order
-
459  std::sort(info.assigned_vars.begin(), info.assigned_vars.end(), comparator);
-
460 }
-
461 
-
462 
- -
464  auto property = NmodlType::table_statement_var;
-
465  info.table_statement_variables = psymtab->get_variables_with_properties(property);
-
466  property = NmodlType::table_assigned_var;
-
467  info.table_assigned_variables = psymtab->get_variables_with_properties(property);
-
468 }
-
469 
- -
471  // TODO: it would be nicer not to have this hardcoded list
-
472  using pair = std::pair<const char*, const char*>;
-
473  for (const auto& [var, type]: {pair{naming::CELSIUS_VARIABLE, "double"},
-
474  pair{"secondorder", "int"},
-
475  pair{"pi", "double"}}) {
-
476  auto sym = psymtab->lookup(var);
-
477  if (sym && (sym->get_read_count() || sym->get_write_count())) {
-
478  info.neuron_global_variables.emplace_back(std::move(sym), type);
-
479  }
-
480  }
-
481 }
-
482 
-
483 
- -
485  const auto& type = node.get_type()->get_node_name();
-
486  if (type == naming::POINT_PROCESS) {
-
487  info.point_process = true;
-
488  }
-
489  if (type == naming::ARTIFICIAL_CELL) {
-
490  info.artificial_cell = true;
-
491  info.point_process = true;
-
492  }
-
493  info.mod_suffix = node.get_node_name();
-
494 }
-
495 
- -
497  info.electrode_current = true;
-
498 }
-
499 
-
500 
- -
502  if (under_net_receive_block) {
-
503  info.net_receive_initial_node = &node;
-
504  } else {
-
505  info.initial_node = &node;
-
506  }
-
507  node.visit_children(*this);
+
329  * Finally we create 4th list:
+
330  * - variables with assigned property and not in the previous 3 lists
+
331  *
+
332  * We now print the variables in following order:
+
333  *
+
334  * - List 1 i.e. range + parameter variables are printed first
+
335  * - List 3 i.e. range + assigned variables are printed next
+
336  * - List 2 i.e. range + state variables are printed next
+
337  * - List 4 i.e. assigned and ion variables not present in the previous 3 lists
+
338  *
+
339  * NOTE:
+
340  * - State variables also have the property `assigned_definition` but these variables
+
341  * are not from ASSIGNED block.
+
342  * - Variable can not be range as well as state, it's redeclaration error
+
343  * - Variable can be parameter as well as range. Without range, parameter
+
344  * is considered as global variable i.e. one value for all instances.
+
345  * - If a variable is only defined as RANGE and not in assigned or parameter
+
346  * or state block then it's not printed.
+
347  * - Note that a variable property is different than the variable type. For example,
+
348  * if variable has range property, it doesn't mean the variable is declared as RANGE.
+
349  * Other variables like STATE and ASSIGNED block variables also get range property
+
350  * without being explicitly declared as RANGE in the mod file.
+
351  * - Also, there is difference between declaration order vs. definition order. For
+
352  * example, POINTER variable in NEURON block is just declaration and doesn't
+
353  * determine the order in which they will get printed. Below we query symbol table
+
354  * and order all instance variables into certain order.
+
355  */
+ +
357  /// comparator to decide the order based on definition
+
358  auto comparator = [](const SymbolType& first, const SymbolType& second) -> bool {
+
359  return first->get_definition_order() < second->get_definition_order();
+
360  };
+
361 
+
362  /// from symbols vector `vars`, remove all ion variables which are not ionic currents
+
363  auto remove_non_ioncur_vars = [](SymbolVectorType& vars, const CodegenInfo& info) -> void {
+
364  vars.erase(std::remove_if(vars.begin(),
+
365  vars.end(),
+
366  [&](SymbolType& s) {
+
367  return info.is_ion_variable(s->get_name()) &&
+
368  !info.is_ionic_current(s->get_name());
+
369  }),
+
370  vars.end());
+
371  };
+
372 
+
373  /// if `secondary` vector contains any symbol that exist in the `primary` then remove it
+
374  auto remove_var_exist = [](SymbolVectorType& primary, SymbolVectorType& secondary) -> void {
+
375  secondary.erase(std::remove_if(secondary.begin(),
+
376  secondary.end(),
+
377  [&primary](const SymbolType& tosearch) {
+
378  return std::find_if(primary.begin(),
+
379  primary.end(),
+
380  // compare by symbol name
+
381  [&tosearch](
+
382  const SymbolType& symbol) {
+
383  return tosearch->get_name() ==
+
384  symbol->get_name();
+
385  }) != primary.end();
+
386  }),
+
387  secondary.end());
+
388  };
+
389 
+
390  /**
+
391  * First come parameters which are range variables.
+
392  */
+
393  // clang-format off
+
394  auto with = NmodlType::range_var
+
395  | NmodlType::param_assign;
+
396  auto without = NmodlType::global_var
+
397  | NmodlType::pointer_var
+
398  | NmodlType::bbcore_pointer_var
+
399  | NmodlType::state_var;
+
400 
+
401  // clang-format on
+
402  info.range_parameter_vars = psymtab->get_variables(with, without);
+
403  remove_non_ioncur_vars(info.range_parameter_vars, info);
+
404  std::sort(info.range_parameter_vars.begin(), info.range_parameter_vars.end(), comparator);
+
405 
+
406  /**
+
407  * Second come assigned variables which are range variables.
+
408  */
+
409  // clang-format off
+
410  with = NmodlType::range_var
+
411  | NmodlType::assigned_definition;
+
412  without = NmodlType::global_var
+
413  | NmodlType::pointer_var
+
414  | NmodlType::bbcore_pointer_var
+
415  | NmodlType::state_var
+
416  | NmodlType::param_assign;
+
417 
+
418  // clang-format on
+
419  info.range_assigned_vars = psymtab->get_variables(with, without);
+
420  remove_non_ioncur_vars(info.range_assigned_vars, info);
+
421  std::sort(info.range_assigned_vars.begin(), info.range_assigned_vars.end(), comparator);
+
422 
+
423 
+
424  /**
+
425  * Third come state variables. All state variables are kind of range by default.
+
426  * Note that some mod files like CaDynamics_E2.mod use cai as state variable which
+
427  * appear in USEION read/write list. These variables are not considered in this
+
428  * variables because non ionic-current variables are removed and printed later.
+
429  */
+
430  // clang-format off
+
431  with = NmodlType::state_var;
+
432  without = NmodlType::global_var
+
433  | NmodlType::pointer_var
+
434  | NmodlType::bbcore_pointer_var;
+
435 
+
436  // clang-format on
+
437  info.state_vars = psymtab->get_variables(with, without);
+
438  std::sort(info.state_vars.begin(), info.state_vars.end(), comparator);
+
439 
+
440  /// range_state_vars is copy of state variables but without non ionic current variables
+
441  info.range_state_vars = info.state_vars;
+
442  remove_non_ioncur_vars(info.range_state_vars, info);
+
443 
+
444  /// Remaining variables are assigned and ion variables which are not in the previous 3 lists
+
445 
+
446  // clang-format off
+
447  with = NmodlType::assigned_definition
+
448  | NmodlType::read_ion_var
+
449  | NmodlType::write_ion_var;
+
450  without = NmodlType::global_var
+
451  | NmodlType::pointer_var
+
452  | NmodlType::bbcore_pointer_var
+
453  | NmodlType::extern_neuron_variable;
+
454  // clang-format on
+
455  const auto& variables = psymtab->get_variables_with_properties(with, false);
+
456  for (const auto& variable: variables) {
+
457  if (!variable->has_any_property(without)) {
+
458  info.assigned_vars.push_back(variable);
+
459  }
+
460  }
+
461 
+
462  /// make sure that variables already present in previous lists
+
463  /// are removed to avoid any duplication
+
464  remove_var_exist(info.range_parameter_vars, info.assigned_vars);
+
465  remove_var_exist(info.range_assigned_vars, info.assigned_vars);
+
466  remove_var_exist(info.range_state_vars, info.assigned_vars);
+
467 
+
468  /// sort variables with their definition order
+
469  std::sort(info.assigned_vars.begin(), info.assigned_vars.end(), comparator);
+
470 }
+
471 
+
472 
+ +
474  auto property = NmodlType::table_statement_var;
+
475  info.table_statement_variables = psymtab->get_variables_with_properties(property);
+
476  property = NmodlType::table_assigned_var;
+
477  info.table_assigned_variables = psymtab->get_variables_with_properties(property);
+
478 }
+
479 
+ +
481  // TODO: it would be nicer not to have this hardcoded list
+
482  using pair = std::pair<const char*, const char*>;
+
483  for (const auto& [var, type]: {pair{naming::CELSIUS_VARIABLE, "double"},
+
484  pair{"secondorder", "int"},
+
485  pair{"pi", "double"}}) {
+
486  auto sym = psymtab->lookup(var);
+
487  if (sym && (sym->get_read_count() || sym->get_write_count())) {
+
488  info.neuron_global_variables.emplace_back(std::move(sym), type);
+
489  }
+
490  }
+
491 }
+
492 
+
493 
+ +
495  const auto& type = node.get_type()->get_node_name();
+
496  if (type == naming::POINT_PROCESS) {
+
497  info.point_process = true;
+
498  }
+
499  if (type == naming::ARTIFICIAL_CELL) {
+
500  info.artificial_cell = true;
+
501  info.point_process = true;
+
502  }
+
503  info.mod_suffix = node.get_node_name();
+
504 }
+
505 
+ +
507  info.electrode_current = true;
508 }
509 
510 
- -
512  info.constructor_node = &node;
-
513  node.visit_children(*this);
-
514 }
-
515 
-
516 
- -
518  info.destructor_node = &node;
-
519  node.visit_children(*this);
-
520 }
-
521 
-
522 
- -
524  under_net_receive_block = true;
-
525  info.net_receive_node = &node;
-
526  info.num_net_receive_parameters = static_cast<int>(node.get_parameters().size());
-
527  node.visit_children(*this);
-
528  under_net_receive_block = false;
-
529 }
-
530 
+ +
512  if (under_net_receive_block) {
+
513  info.net_receive_initial_node = &node;
+
514  } else {
+
515  info.initial_node = &node;
+
516  }
+
517  node.visit_children(*this);
+
518 }
+
519 
+
520 
+ +
522  info.constructor_node = &node;
+
523  node.visit_children(*this);
+
524 }
+
525 
+
526 
+ +
528  info.destructor_node = &node;
+
529  node.visit_children(*this);
+
530 }
531 
- -
533  under_derivative_block = true;
-
534  node.visit_children(*this);
-
535  under_derivative_block = false;
-
536 }
-
537 
- -
539  info.derivimplicit_callbacks.push_back(&node);
-
540 }
+
532 
+ +
534  under_net_receive_block = true;
+
535  info.net_receive_node = &node;
+
536  info.num_net_receive_parameters = static_cast<int>(node.get_parameters().size());
+
537  node.visit_children(*this);
+
538  under_net_receive_block = false;
+
539 }
+
540 
541 
-
542 
- -
544  under_breakpoint_block = true;
-
545  info.breakpoint_node = &node;
-
546  node.visit_children(*this);
-
547  under_breakpoint_block = false;
-
548 }
-
549 
-
550 
- -
552  info.nrn_state_block = &node;
-
553  node.visit_children(*this);
-
554 }
-
555 
-
556 
- -
558  info.procedures.push_back(&node);
-
559  node.visit_children(*this);
-
560  if (table_statement_used) {
-
561  table_statement_used = false;
-
562  info.functions_with_table.push_back(&node);
-
563  }
+ +
543  under_derivative_block = true;
+
544  node.visit_children(*this);
+
545  under_derivative_block = false;
+
546 }
+
547 
+ +
549  info.derivimplicit_callbacks.push_back(&node);
+
550 }
+
551 
+
552 
+ +
554  under_breakpoint_block = true;
+
555  info.breakpoint_node = &node;
+
556  node.visit_children(*this);
+
557  under_breakpoint_block = false;
+
558 }
+
559 
+
560 
+ +
562  info.nrn_state_block = &node;
+
563  node.visit_children(*this);
564 }
565 
566 
- -
568  info.functions.push_back(&node);
-
569  node.visit_children(*this);
+ +
568  info.procedures.push_back(&node);
+
569  node.visit_children(*this);
570  if (table_statement_used) {
571  table_statement_used = false;
572  info.functions_with_table.push_back(&node);
@@ -670,213 +670,223 @@
574 }
575 
576 
- -
578  info.function_tables.push_back(&node);
-
579 }
-
580 
-
581 
- -
583  const ast::EigenNewtonSolverBlock& node) {
-
584  info.eigen_newton_solver_exist = true;
-
585  // Avoid extra declaration for `functor` corresponding to the DERIVATIVE block which is not
-
586  // printed to the generated CPP file
-
587  if (!under_derivative_block) {
-
588  const auto new_unique_functor_name = "functor_" + info.mod_suffix + "_" +
-
589  std::to_string(info.functor_names.size());
-
590  info.functor_names[&node] = new_unique_functor_name;
-
591  }
-
592  node.visit_children(*this);
-
593 }
-
594 
- -
596  const ast::EigenLinearSolverBlock& node) {
-
597  info.eigen_linear_solver_exist = true;
-
598  node.visit_children(*this);
-
599 }
-
600 
- -
602  auto name = node.get_node_name();
-
603  if (name == naming::NET_SEND_METHOD) {
-
604  info.net_send_used = true;
-
605  }
-
606  if (name == naming::NET_EVENT_METHOD) {
-
607  info.net_event_used = true;
-
608  }
+ +
578  info.functions.push_back(&node);
+
579  node.visit_children(*this);
+
580  if (table_statement_used) {
+
581  table_statement_used = false;
+
582  info.functions_with_table.push_back(&node);
+
583  }
+
584 }
+
585 
+
586 
+ +
588  info.function_tables.push_back(&node);
+
589 }
+
590 
+
591 
+ +
593  const ast::EigenNewtonSolverBlock& node) {
+
594  info.eigen_newton_solver_exist = true;
+
595  // Avoid extra declaration for `functor` corresponding to the DERIVATIVE block which is not
+
596  // printed to the generated CPP file
+
597  if (!under_derivative_block) {
+
598  const auto new_unique_functor_name = "functor_" + info.mod_suffix + "_" +
+
599  std::to_string(info.functor_names.size());
+
600  info.functor_names[&node] = new_unique_functor_name;
+
601  }
+
602  node.visit_children(*this);
+
603 }
+
604 
+ +
606  const ast::EigenLinearSolverBlock& node) {
+
607  info.eigen_linear_solver_exist = true;
+
608  node.visit_children(*this);
609 }
610 
-
611 
- -
613  const auto& ion = node.get_ion();
-
614  const auto& variable = node.get_conductance();
-
615  std::string ion_name;
-
616  if (ion) {
-
617  ion_name = ion->get_node_name();
+ +
612  auto name = node.get_node_name();
+
613  if (name == naming::NET_SEND_METHOD) {
+
614  info.net_send_used = true;
+
615  }
+
616  if (name == naming::NET_EVENT_METHOD) {
+
617  info.net_event_used = true;
618  }
-
619  info.conductances.push_back({ion_name, variable->get_node_name()});
-
620 }
+
619 }
+
620 
621 
-
622 
-
623 /**
-
624  * Visit statement block and find prime symbols appear in derivative block
-
625  *
-
626  * Equation statements in derivative block has prime on the lhs. The order
-
627  * of primes could be different that declaration state block. Also, not all
-
628  * state variables need to appear in equation block. In this case, we want
-
629  * to find out the the primes in the order of equation definition. This is
-
630  * just to keep the same order as neuron implementation.
-
631  *
-
632  * The primes are already solved and replaced by Dstate or name. And hence
-
633  * we need to check if the lhs variable is derived from prime name. If it's
-
634  * Dstate then we have to lookup state to find out corresponding symbol. This
-
635  * is because prime_variables_by_order should contain state variable name and
-
636  * not the one replaced by solver pass.
-
637  *
-
638  * \todo AST can have duplicate DERIVATIVE blocks if a mod file uses SOLVE
-
639  * statements in its INITIAL block (e.g. in case of kinetic schemes using
-
640  * `STEADYSTATE sparse` solver). Such duplicated DERIVATIVE blocks could
-
641  * be removed by `SolveBlockVisitor`, or we have to avoid visiting them
-
642  * here. See e.g. SH_na8st.mod test and original reduced_dentate .mod.
-
643  */
- -
645  const auto& statements = node.get_statements();
-
646  for (auto& statement: statements) {
-
647  statement->accept(*this);
-
648  if (under_derivative_block && assign_lhs &&
-
649  (assign_lhs->is_name() || assign_lhs->is_var_name())) {
-
650  auto name = assign_lhs->get_node_name();
-
651  auto symbol = psymtab->lookup(name);
-
652  if (symbol != nullptr) {
-
653  auto is_prime = symbol->has_any_property(NmodlType::prime_name);
-
654  auto from_state = symbol->has_any_status(Status::from_state);
-
655  if (is_prime || from_state) {
-
656  if (from_state) {
-
657  symbol = psymtab->lookup(name.substr(1, name.size()));
-
658  }
-
659  // See the \todo note above.
-
660  if (std::find_if(info.prime_variables_by_order.begin(),
-
661  info.prime_variables_by_order.end(),
-
662  [&](auto const& sym) {
-
663  return sym->get_name() == symbol->get_name();
-
664  }) == info.prime_variables_by_order.end()) {
-
665  info.prime_variables_by_order.push_back(symbol);
-
666  info.num_equations++;
-
667  }
-
668  }
-
669  }
-
670  }
-
671  assign_lhs = nullptr;
-
672  }
-
673 }
-
674 
- -
676  info.factor_definitions.push_back(&node);
-
677 }
-
678 
-
679 
- -
681  if (node.get_op().eval() == "=") {
-
682  assign_lhs = node.get_lhs();
-
683  }
-
684  node.get_lhs()->accept(*this);
-
685  node.get_rhs()->accept(*this);
-
686 }
-
687 
+ +
623  const auto& ion = node.get_ion();
+
624  const auto& variable = node.get_conductance();
+
625  std::string ion_name;
+
626  if (ion) {
+
627  ion_name = ion->get_node_name();
+
628  }
+
629  info.conductances.push_back({ion_name, variable->get_node_name()});
+
630 }
+
631 
+
632 
+
633 /**
+
634  * Visit statement block and find prime symbols appear in derivative block
+
635  *
+
636  * Equation statements in derivative block has prime on the lhs. The order
+
637  * of primes could be different that declaration state block. Also, not all
+
638  * state variables need to appear in equation block. In this case, we want
+
639  * to find out the the primes in the order of equation definition. This is
+
640  * just to keep the same order as neuron implementation.
+
641  *
+
642  * The primes are already solved and replaced by Dstate or name. And hence
+
643  * we need to check if the lhs variable is derived from prime name. If it's
+
644  * Dstate then we have to lookup state to find out corresponding symbol. This
+
645  * is because prime_variables_by_order should contain state variable name and
+
646  * not the one replaced by solver pass.
+
647  *
+
648  * \todo AST can have duplicate DERIVATIVE blocks if a mod file uses SOLVE
+
649  * statements in its INITIAL block (e.g. in case of kinetic schemes using
+
650  * `STEADYSTATE sparse` solver). Such duplicated DERIVATIVE blocks could
+
651  * be removed by `SolveBlockVisitor`, or we have to avoid visiting them
+
652  * here. See e.g. SH_na8st.mod test and original reduced_dentate .mod.
+
653  */
+ +
655  const auto& statements = node.get_statements();
+
656  for (auto& statement: statements) {
+
657  statement->accept(*this);
+
658  if (under_derivative_block && assign_lhs &&
+
659  (assign_lhs->is_name() || assign_lhs->is_var_name())) {
+
660  auto name = assign_lhs->get_node_name();
+
661  auto symbol = psymtab->lookup(name);
+
662  if (symbol != nullptr) {
+
663  auto is_prime = symbol->has_any_property(NmodlType::prime_name);
+
664  auto from_state = symbol->has_any_status(Status::from_state);
+
665  if (is_prime || from_state) {
+
666  if (from_state) {
+
667  symbol = psymtab->lookup(name.substr(1, name.size()));
+
668  }
+
669  // See the \todo note above.
+
670  if (std::find_if(info.prime_variables_by_order.begin(),
+
671  info.prime_variables_by_order.end(),
+
672  [&](auto const& sym) {
+
673  return sym->get_name() == symbol->get_name();
+
674  }) == info.prime_variables_by_order.end()) {
+
675  info.prime_variables_by_order.push_back(symbol);
+
676  info.num_equations++;
+
677  }
+
678  }
+
679  }
+
680  }
+
681  assign_lhs = nullptr;
+
682  }
+
683 }
+
684 
+ +
686  info.factor_definitions.push_back(&node);
+
687 }
688 
- -
690  info.bbcore_pointer_used = true;
-
691 }
-
692 
-
693 
- -
695  info.watch_count++;
+
689 
+ +
691  if (node.get_op().eval() == "=") {
+
692  assign_lhs = node.get_lhs();
+
693  }
+
694  node.get_lhs()->accept(*this);
+
695  node.get_rhs()->accept(*this);
696 }
697 
698 
- -
700  info.watch_statements.push_back(&node);
-
701  node.visit_children(*this);
-
702 }
+ +
700  info.bbcore_pointer_used = true;
+
701 }
+
702 
703 
-
704 
- -
706  info.for_netcon_used = true;
-
707 }
+ +
705  info.watch_count++;
+
706 }
+
707 
708 
-
709 
- -
711  info.table_count++;
-
712  table_statement_used = true;
-
713 }
+ +
710  info.watch_statements.push_back(&node);
+
711  node.visit_children(*this);
+
712 }
+
713 
714 
-
715 
- -
717  psymtab = node.get_symbol_table();
-
718  auto blocks = node.get_blocks();
-
719  for (auto& block: blocks) {
-
720  info.top_blocks.push_back(block.get());
-
721  if (block->is_verbatim()) {
-
722  info.top_verbatim_blocks.push_back(block.get());
-
723  }
-
724  }
-
725  node.visit_children(*this);
-
726  find_ion_variables(node); // Keep this before find_*_range_variables()
-
727  find_range_variables();
-
728  find_non_range_variables();
-
729  find_table_variables();
-
730  find_neuron_global_variables();
-
731 }
-
732 
-
733 
- -
735  node.accept(*this);
-
736  return info;
-
737 }
-
738 
- -
740  info.vectorize = false;
+ +
716  info.for_netcon_used = true;
+
717 }
+
718 
+
719 
+ +
721  info.table_count++;
+
722  table_statement_used = true;
+
723 }
+
724 
+
725 
+ +
727  psymtab = node.get_symbol_table();
+
728  auto blocks = node.get_blocks();
+
729  for (auto& block: blocks) {
+
730  info.top_blocks.push_back(block.get());
+
731  if (block->is_verbatim()) {
+
732  info.top_verbatim_blocks.push_back(block.get());
+
733  }
+
734  }
+
735  node.visit_children(*this);
+
736  find_ion_variables(node); // Keep this before find_*_range_variables()
+
737  find_range_variables();
+
738  find_non_range_variables();
+
739  find_table_variables();
+
740  find_neuron_global_variables();
741 }
742 
- -
744  info.vectorize = false;
-
745 }
-
746 
- -
748  info.vectorize = false;
-
749 }
-
750 
- -
752  info.changed_dt = node.get_value()->eval();
-
753 }
-
754 
-
755 /// visit verbatim block and find all symbols used
- -
757  const auto& text = node.get_statement()->eval();
-
758  // use C parser to get all tokens
- -
760  driver.scan_string(text);
-
761  const auto& tokens = driver.all_tokens();
-
762 
-
763  // check if the token exist in the symbol table
-
764  for (auto& token: tokens) {
-
765  if (info.variables_in_verbatim.find(token) == info.variables_in_verbatim.end()) {
-
766  auto symbol = psymtab->lookup(token);
-
767  if (symbol != nullptr) {
-
768  info.variables_in_verbatim.insert(token);
-
769  }
-
770  }
-
771  }
-
772 }
-
773 
- -
775  info.before_after_blocks.push_back(&node);
-
776 }
-
777 
- -
779  info.before_after_blocks.push_back(&node);
-
780 }
-
781 
-
782 } // namespace codegen
-
783 } // namespace nmodl
+
743 
+ +
745  node.accept(*this);
+
746  return info;
+
747 }
+
748 
+ +
750  info.vectorize = false;
+
751 }
+
752 
+ +
754  info.vectorize = false;
+
755 }
+
756 
+ +
758  info.vectorize = false;
+
759 }
+
760 
+ +
762  info.changed_dt = node.get_value()->eval();
+
763 }
+
764 
+
765 /// visit verbatim block and find all symbols used
+ +
767  const auto& text = node.get_statement()->eval();
+
768  // use C parser to get all tokens
+ +
770  driver.scan_string(text);
+
771  const auto& tokens = driver.all_tokens();
+
772 
+
773  // check if the token exist in the symbol table
+
774  for (auto& token: tokens) {
+
775  if (info.variables_in_verbatim.find(token) == info.variables_in_verbatim.end()) {
+
776  auto symbol = psymtab->lookup(token);
+
777  if (symbol != nullptr) {
+
778  info.variables_in_verbatim.insert(token);
+
779  }
+
780  }
+
781  }
+
782 }
+
783 
+ +
785  info.before_after_blocks.push_back(&node);
+
786 }
+
787 
+ +
789  info.before_after_blocks.push_back(&node);
+
790 }
+
791 
+
792 } // namespace codegen
+
793 } // namespace nmodl
std::string get_node_name() const override
Return name of the node.
Definition: ast.cpp:7061
@@ -884,51 +894,52 @@
Represents a BEFORE block in NMODL.
Represents a C code block.
Definition: verbatim.hpp:38
static constexpr char CELSIUS_VARIABLE[]
global temperature variable
-
void visit_eigen_newton_solver_block(const ast::EigenNewtonSolverBlock &node) override
visit node of type ast::EigenNewtonSolverBlock
-
void visit_eigen_linear_solver_block(const ast::EigenLinearSolverBlock &node) override
visit node of type ast::EigenLinearSolverBlock
- -
void visit_breakpoint_block(const ast::BreakpointBlock &node) override
visit node of type ast::BreakpointBlock
-
void visit_update_dt(const ast::UpdateDt &node) override
visit node of type ast::UpdateDt
+
void visit_eigen_newton_solver_block(const ast::EigenNewtonSolverBlock &node) override
visit node of type ast::EigenNewtonSolverBlock
+
void visit_eigen_linear_solver_block(const ast::EigenLinearSolverBlock &node) override
visit node of type ast::EigenLinearSolverBlock
+ +
void visit_breakpoint_block(const ast::BreakpointBlock &node) override
visit node of type ast::BreakpointBlock
+
void visit_update_dt(const ast::UpdateDt &node) override
visit node of type ast::UpdateDt
std::shared_ptr< Name > get_ion() const noexcept
Getter for member variable ConductanceHint::ion.
-
void visit_conductance_hint(const ast::ConductanceHint &node) override
visit node of type ast::ConductanceHint
+
void visit_conductance_hint(const ast::ConductanceHint &node) override
visit node of type ast::ConductanceHint
-
void visit_destructor_block(const ast::DestructorBlock &node) override
visit node of type ast::DestructorBlock
+
void visit_destructor_block(const ast::DestructorBlock &node) override
visit node of type ast::DestructorBlock
const ArgumentVector & get_parameters() const noexcept override
Getter for member variable NetReceiveBlock::parameters.
-
void visit_electrode_current(const ast::ElectrodeCurrent &node) override
visit node of type ast::ElectrodeCurrent
+
void visit_electrode_current(const ast::ElectrodeCurrent &node) override
visit node of type ast::ElectrodeCurrent
Represents CONDUCTANCE statement in NMODL.
+
std::optional< double > valence
ion valence
static constexpr char POINT_PROCESS[]
point process keyword in nmodl
std::vector< std::shared_ptr< symtab::Symbol > > SymbolVectorType
encapsulates code generation backend implementations
Definition: ast_common.hpp:26
-
void visit_program(const ast::Program &node) override
visit node of type ast::Program
-
void visit_function_block(const ast::FunctionBlock &node) override
visit node of type ast::FunctionBlock
+
void visit_program(const ast::Program &node) override
visit node of type ast::Program
+
void visit_function_block(const ast::FunctionBlock &node) override
visit node of type ast::FunctionBlock
std::shared_ptr< Name > get_conductance() const noexcept
Getter for member variable ConductanceHint::conductance.
-
Represent ions used in mod file.
+
Represent ions used in mod file.
std::shared_ptr< symtab::Symbol > SymbolType
-
void visit_discrete_block(const ast::DiscreteBlock &node) override
visit node of type ast::DiscreteBlock
-
void visit_function_call(const ast::FunctionCall &node) override
visit node of type ast::FunctionCall
+
void visit_discrete_block(const ast::DiscreteBlock &node) override
visit node of type ast::DiscreteBlock
+
void visit_function_call(const ast::FunctionCall &node) override
visit node of type ast::FunctionCall
Represents TABLE statement in NMODL.
Status
state during various compiler passes
Represents SUFFIX statement in NMODL.
Definition: suffix.hpp:38
-
void visit_factor_def(const ast::FactorDef &node) override
visit node of type ast::FactorDef
+
void visit_factor_def(const ast::FactorDef &node) override
visit node of type ast::FactorDef
void accept(visitor::Visitor &v) override
accept (or visit) the current AST node using provided visitor
Definition: ast.cpp:12918
-
Represent information collected from AST for code generation.
+
Represent information collected from AST for code generation.
void visit_children(visitor::Visitor &v) override
visit children i.e.
Definition: ast.cpp:10024
void visit_children(visitor::Visitor &v) override
visit children i.e.
Definition: ast.cpp:3976
-
void visit_for_netcon(const ast::ForNetcon &node) override
visit node of type ast::ForNetcon
+
void visit_for_netcon(const ast::ForNetcon &node) override
visit node of type ast::ForNetcon
void visit_children(visitor::Visitor &v) override
visit children i.e.
Definition: ast.cpp:4173
-
void visit_binary_expression(const ast::BinaryExpression &node) override
visit node of type ast::BinaryExpression
+
void visit_binary_expression(const ast::BinaryExpression &node) override
visit node of type ast::BinaryExpression
std::shared_ptr< String > get_statement() const noexcept
Getter for member variable Verbatim::statement.
Definition: verbatim.hpp:157
Class that binds all pieces together for parsing C verbatim blocks.
Definition: c11_driver.hpp:37
std::shared_ptr< Expression > get_rhs() const noexcept
Getter for member variable BinaryExpression::rhs.
static constexpr char ARTIFICIAL_CELL[]
artificial cell keyword in nmodl
Represent newton solver solution block based on Eigen.
Helper visitor to gather AST information to help code generation.
-
std::vector< std::string > writes
ion variables that are being written
-
void visit_statement_block(const ast::StatementBlock &node) override
Visit statement block and find prime symbols appear in derivative block.
+
std::vector< std::string > writes
ion variables that are being written
+
void visit_statement_block(const ast::StatementBlock &node) override
Visit statement block and find prime symbols appear in derivative block.
std::string get_node_name() const override
Return name of the node.
Definition: ast.cpp:11242
const StatementVector & get_statements() const noexcept
Getter for member variable StatementBlock::statements.
@@ -938,58 +949,58 @@
Represent WATCH statement in NMODL.
Represents a BREAKPOINT block in NMODL.
void visit_children(visitor::Visitor &v) override
visit children i.e.
Definition: ast.cpp:3249
-
bool need_style
if style semantic needed
+
bool need_style
if style semantic needed
nmodl::parser::UnitDriver driver
Definition: parser.cpp:28
std::shared_ptr< Double > get_value() const noexcept
Getter for member variable UpdateDt::value.
Definition: update_dt.hpp:157
-
void visit_table_statement(const ast::TableStatement &node) override
visit node of type ast::TableStatement
+
void visit_table_statement(const ast::TableStatement &node) override
visit node of type ast::TableStatement
Represents a DESTRUCTOR block in the NMODL.
Represents a CONSTRUCTOR block in the NMODL.
-
void visit_non_linear_block(const ast::NonLinearBlock &node) override
visit node of type ast::NonLinearBlock
-
void visit_after_block(const ast::AfterBlock &node) override
visit node of type ast::AfterBlock
-
void find_range_variables()
Find range variables i.e.
+
void visit_non_linear_block(const ast::NonLinearBlock &node) override
visit node of type ast::NonLinearBlock
+
void visit_after_block(const ast::AfterBlock &node) override
visit node of type ast::AfterBlock
+
void find_range_variables()
Find range variables i.e.
void visit_children(visitor::Visitor &v) override
visit children i.e.
Definition: ast.cpp:13377
-
bool is_intra_cell_conc(const std::string &text) const
Check if variable name is internal cell concentration.
-
void visit_watch(const ast::Watch &node) override
visit node of type ast::Watch
+
bool is_intra_cell_conc(const std::string &text) const
Check if variable name is internal cell concentration.
+
void visit_watch(const ast::Watch &node) override
visit node of type ast::Watch
std::string to_string(const T &obj)
void visit_children(visitor::Visitor &v) override
visit children i.e.
Definition: ast.cpp:12902
-
bool is_extra_cell_conc(const std::string &text) const
Check if variable name is external cell concentration.
+
bool is_extra_cell_conc(const std::string &text) const
Check if variable name is external cell concentration.
static void sort_with_mod2c_symbol_order(std::vector< SymbolType > &symbols)
How symbols are stored in NEURON? See notes written in markdown file.
-
void visit_watch_statement(const ast::WatchStatement &node) override
visit node of type ast::WatchStatement
+
void visit_watch_statement(const ast::WatchStatement &node) override
visit node of type ast::WatchStatement
const BinaryOperator & get_op() const noexcept
Getter for member variable BinaryExpression::op.
-
void visit_procedure_block(const ast::ProcedureBlock &node) override
visit node of type ast::ProcedureBlock
-
void visit_before_block(const ast::BeforeBlock &node) override
visit node of type ast::BeforeBlock
+
void visit_procedure_block(const ast::ProcedureBlock &node) override
visit node of type ast::ProcedureBlock
+
void visit_before_block(const ast::BeforeBlock &node) override
visit node of type ast::BeforeBlock
Represents DERIVATIVE block in the NMODL.
std::string eval() const
Return enum value in string form.
-
codegen::CodegenInfo analyze(const ast::Program &node)
run visitor and return information for code generation
+
codegen::CodegenInfo analyze(const ast::Program &node)
run visitor and return information for code generation
void visit_children(visitor::Visitor &v) override
visit children i.e.
Definition: ast.cpp:2905
Represent linear solver solution block based on Eigen.
std::vector< std::shared_ptr< const ast::Ast > > collect_nodes(const ast::Ast &node, const std::vector< ast::AstNodeType > &types)
traverse node recursively and collect nodes of given types
Statement to indicate a change in timestep in a given block.
Definition: update_dt.hpp:38
-
void visit_net_receive_block(const ast::NetReceiveBlock &node) override
visit node of type ast::NetReceiveBlock
- +
void visit_net_receive_block(const ast::NetReceiveBlock &node) override
visit node of type ast::NetReceiveBlock
+
Represents the coreneuron nrn_state callback function.
Represents block encapsulating list of statements.
NmodlType
NMODL variable properties.
-
void visit_linear_block(const ast::LinearBlock &node) override
visit node of type ast::LinearBlock
+
void visit_linear_block(const ast::LinearBlock &node) override
visit node of type ast::LinearBlock
const NodeVector & get_blocks() const noexcept
Getter for member variable Program::blocks.
Definition: program.hpp:216
void visit_children(visitor::Visitor &v) override
visit children i.e.
Definition: ast.cpp:4642
Represents LINEAR block in the NMODL.
Represent a callback to NEURON's derivimplicit solver.
-
void find_non_range_variables()
Find non-range variables i.e.
+
void find_non_range_variables()
Find non-range variables i.e.
void visit_children(visitor::Visitor &v) override
visit children i.e.
Definition: ast.cpp:13092
-
void visit_derivimplicit_callback(const ast::DerivimplicitCallback &node) override
visit node of type ast::DerivimplicitCallback
+
void visit_derivimplicit_callback(const ast::DerivimplicitCallback &node) override
visit node of type ast::DerivimplicitCallback
void find_ion_variables(const ast::Program &node)
Find all ions used in mod file.
Represents NONLINEAR block in the NMODL.
-
void visit_derivative_block(const ast::DerivativeBlock &node) override
visit node of type ast::DerivativeBlock
-
void visit_function_table_block(const ast::FunctionTableBlock &node) override
visit node of type ast::FunctionTableBlock
-
void visit_bbcore_pointer(const ast::BbcorePointer &node) override
visit node of type ast::BbcorePointer
+
void visit_derivative_block(const ast::DerivativeBlock &node) override
visit node of type ast::DerivativeBlock
+
void visit_function_table_block(const ast::FunctionTableBlock &node) override
visit node of type ast::FunctionTableBlock
+
void visit_bbcore_pointer(const ast::BbcorePointer &node) override
visit node of type ast::BbcorePointer
static constexpr char NET_EVENT_METHOD[]
net_event function call in nmodl
symtab::SymbolTable * get_symbol_table() const override
Return associated symbol table for the current ast node.
Definition: program.hpp:153
-
void visit_verbatim(const ast::Verbatim &node) override
visit verbatim block and find all symbols used
+
void visit_verbatim(const ast::Verbatim &node) override
visit verbatim block and find all symbols used
Represents BBCOREPOINTER statement in NMODL.
std::shared_ptr< Expression > get_lhs() const noexcept
Getter for member variable BinaryExpression::lhs.
static constexpr char AREA_VARIABLE[]
similar to node_area but user can explicitly declare it as area
@@ -998,17 +1009,17 @@
Represents a AFTER block in NMODL.
Definition: after_block.hpp:51
static constexpr char DIAM_VARIABLE[]
inbuilt neuron variable for diameter of the compartment
Represents ELECTRODE_CURRENT variables statement in NMODL.
-
void visit_initial_block(const ast::InitialBlock &node) override
visit node of type ast::InitialBlock
-
void visit_nrn_state_block(const ast::NrnStateBlock &node) override
visit node of type ast::NrnStateBlock
+
void visit_initial_block(const ast::InitialBlock &node) override
visit node of type ast::InitialBlock
+
void visit_nrn_state_block(const ast::NrnStateBlock &node) override
visit node of type ast::NrnStateBlock
Represents binary expression in the NMODL.
-
void visit_constructor_block(const ast::ConstructorBlock &node) override
visit node of type ast::ConstructorBlock
+
void visit_constructor_block(const ast::ConstructorBlock &node) override
visit node of type ast::ConstructorBlock
void visit_children(visitor::Visitor &v) override
visit children i.e.
Definition: ast.cpp:2989
Auto generated AST classes declaration.
-
std::vector< std::string > reads
ion variables that are being read
+
std::vector< std::string > reads
ion variables that are being read
static constexpr char NET_SEND_METHOD[]
net_send function call in nmodl
void visit_children(visitor::Visitor &v) override
visit children i.e.
Definition: ast.cpp:4362
void visit_children(visitor::Visitor &v) override
visit children i.e.
Definition: ast.cpp:2821
-
void visit_suffix(const ast::Suffix &node) override
visit node of type ast::Suffix
+
void visit_suffix(const ast::Suffix &node) override
visit node of type ast::Suffix
#include <fmt/format.h>
+#include <optional>
#include <string>
#include <unordered_map>
#include <unordered_set>
diff --git a/doxygen/codegen__info_8hpp_source.html b/doxygen/codegen__info_8hpp_source.html index c872190f2..e8d97ad63 100644 --- a/doxygen/codegen__info_8hpp_source.html +++ b/doxygen/codegen__info_8hpp_source.html @@ -109,743 +109,748 @@
13  */
14 
15 #include <fmt/format.h>
-
16 #include <string>
-
17 #include <unordered_map>
-
18 #include <unordered_set>
-
19 #include <utility>
-
20 
-
21 #include "ast/ast.hpp"
- -
23 #include "symtab/symbol_table.hpp"
-
24 
+
16 #include <optional>
+
17 #include <string>
+
18 #include <unordered_map>
+
19 #include <unordered_set>
+
20 #include <utility>
+
21 
+
22 #include "ast/ast.hpp"
+ +
24 #include "symtab/symbol_table.hpp"
25 
-
26 namespace nmodl {
-
27 namespace codegen {
-
28 
-
29 /**
-
30  * \addtogroup codegen_details
-
31  * \{
-
32  */
-
33 
-
34 /**
-
35  * \class Conductance
-
36  * \brief Represent conductance statements used in mod file
-
37  */
-
38 struct Conductance {
-
39  /// name of the ion
-
40  std::string ion;
-
41 
-
42  /// ion variable like intra/extra concentration
-
43  std::string variable;
-
44 };
-
45 
-
46 
-
47 /**
-
48  * \class Ion
-
49  * \brief Represent ions used in mod file
-
50  */
-
51 struct Ion {
-
52  /// name of the ion
-
53  std::string name;
-
54 
-
55  /// ion variables that are being read
-
56  std::vector<std::string> reads;
-
57 
-
58  /// ion variables that are being implicitly read
-
59  std::vector<std::string> implicit_reads;
-
60 
-
61  /// ion variables that are being written
-
62  std::vector<std::string> writes;
-
63 
-
64  /// if style semantic needed
-
65  bool need_style = false;
-
66 
-
67  Ion() = delete;
-
68 
-
69  explicit Ion(std::string name)
-
70  : name(std::move(name)) {}
-
71 
-
72  bool is_read(const std::string& name) const {
-
73  return std::find(reads.cbegin(), reads.cend(), name) != reads.cend() ||
-
74  std::find(implicit_reads.cbegin(), implicit_reads.cend(), name) !=
-
75  implicit_reads.cend();
-
76  }
-
77 
-
78  bool is_conc_read() const {
- +
26 
+
27 namespace nmodl {
+
28 namespace codegen {
+
29 
+
30 /**
+
31  * \addtogroup codegen_details
+
32  * \{
+
33  */
+
34 
+
35 /**
+
36  * \class Conductance
+
37  * \brief Represent conductance statements used in mod file
+
38  */
+
39 struct Conductance {
+
40  /// name of the ion
+
41  std::string ion;
+
42 
+
43  /// ion variable like intra/extra concentration
+
44  std::string variable;
+
45 };
+
46 
+
47 
+
48 /**
+
49  * \class Ion
+
50  * \brief Represent ions used in mod file
+
51  */
+
52 struct Ion {
+
53  /// name of the ion
+
54  std::string name;
+
55 
+
56  /// ion variables that are being read
+
57  std::vector<std::string> reads;
+
58 
+
59  /// ion variables that are being implicitly read
+
60  std::vector<std::string> implicit_reads;
+
61 
+
62  /// ion variables that are being written
+
63  std::vector<std::string> writes;
+
64 
+
65  /// ion valence
+
66  std::optional<double> valence;
+
67 
+
68  /// if style semantic needed
+
69  bool need_style = false;
+
70 
+
71  Ion() = delete;
+
72 
+
73  explicit Ion(std::string name)
+
74  : name(std::move(name)) {}
+
75 
+
76  bool is_read(const std::string& name) const {
+
77  return std::find(reads.cbegin(), reads.cend(), name) != reads.cend() ||
+
78  std::find(implicit_reads.cbegin(), implicit_reads.cend(), name) !=
+
79  implicit_reads.cend();
80  }
81 
-
82  bool is_interior_conc_read() const {
-
83  return is_read(fmt::format("{}i", name));
+
82  bool is_conc_read() const {
+
84  }
85 
-
86  bool is_exterior_conc_read() const {
-
87  return is_read(fmt::format("{}o", name));
+
86  bool is_interior_conc_read() const {
+
87  return is_read(fmt::format("{}i", name));
88  }
89 
-
90  bool is_written(const std::string& name) const {
-
91  return std::find(writes.cbegin(), writes.cend(), name) != writes.cend();
+
90  bool is_exterior_conc_read() const {
+
91  return is_read(fmt::format("{}o", name));
92  }
93 
-
94  bool is_conc_written() const {
- +
94  bool is_written(const std::string& name) const {
+
95  return std::find(writes.cbegin(), writes.cend(), name) != writes.cend();
96  }
97 
-
98  bool is_interior_conc_written() const {
-
99  return is_written(fmt::format("{}i", name));
+
98  bool is_conc_written() const {
+
100  }
101 
- -
103  return is_written(fmt::format("{}o", name));
+ +
103  return is_written(fmt::format("{}i", name));
104  }
105 
-
106  bool is_rev_read() const {
-
107  return is_read(fmt::format("e{}", name));
+ +
107  return is_written(fmt::format("{}o", name));
108  }
109 
-
110  bool is_rev_written() const {
-
111  return is_written(fmt::format("e{}", name));
+
110  bool is_rev_read() const {
+
111  return is_read(fmt::format("e{}", name));
112  }
-
113 
-
114  /**
-
115  * Check if variable name is a ionic current
-
116  *
-
117  * This is equivalent of IONCUR flag in mod2c.
-
118  * If it is read variable then also get NRNCURIN flag.
-
119  * If it is write variables then also get NRNCUROUT flag.
-
120  */
-
121  bool is_ionic_current(const std::string& text) const {
-
122  return text == ionic_current_name();
-
123  }
-
124 
-
125  /**
-
126  * Check if variable name is internal cell concentration
-
127  *
-
128  * This is equivalent of IONIN flag in mod2c.
-
129  */
-
130  bool is_intra_cell_conc(const std::string& text) const {
-
131  return text == intra_conc_name();
-
132  }
-
133 
-
134  /**
-
135  * Check if variable name is external cell concentration
-
136  *
-
137  * This is equivalent of IONOUT flag in mod2c.
-
138  */
-
139  bool is_extra_cell_conc(const std::string& text) const {
-
140  return text == extra_conc_name();
-
141  }
-
142 
-
143  /**
-
144  * Check if variable name is reveral potential
-
145  *
-
146  * Matches `ena` and `na_erev`.
-
147  */
-
148  bool is_rev_potential(const std::string& text) const {
-
149  return text == rev_potential_name() ||
- -
151  }
-
152 
-
153  /// check if it is either internal or external concentration
-
154  bool is_ionic_conc(const std::string& text) const {
-
155  return is_intra_cell_conc(text) || is_extra_cell_conc(text);
-
156  }
-
157 
-
158  /// Is the variable name `text` related to this ion?
-
159  ///
-
160  /// Example: For sodium this is true for any of `"ena"`, `"ina"`, `"nai"`
-
161  /// and `"nao"`; but not `ion_ina`, etc.
-
162  bool is_ionic_variable(const std::string& text) const {
-
163  return is_ionic_conc(text) || is_ionic_current(text) || is_rev_potential(text);
-
164  }
-
165 
-
166  /// Is the variable name `text` the style of this ion?
-
167  ///
-
168  /// Example: For sodium this is true for `"style_na"`.
-
169  bool is_style(const std::string& text) const {
-
170  return text == fmt::format("style_{}", name);
-
171  }
-
172 
-
173  bool is_current_derivative(const std::string& text) const {
-
174  return text == ("di" + name + "dv");
+
113 
+
114  bool is_rev_written() const {
+
115  return is_written(fmt::format("e{}", name));
+
116  }
+
117 
+
118  /**
+
119  * Check if variable name is a ionic current
+
120  *
+
121  * This is equivalent of IONCUR flag in mod2c.
+
122  * If it is read variable then also get NRNCURIN flag.
+
123  * If it is write variables then also get NRNCUROUT flag.
+
124  */
+
125  bool is_ionic_current(const std::string& text) const {
+
126  return text == ionic_current_name();
+
127  }
+
128 
+
129  /**
+
130  * Check if variable name is internal cell concentration
+
131  *
+
132  * This is equivalent of IONIN flag in mod2c.
+
133  */
+
134  bool is_intra_cell_conc(const std::string& text) const {
+
135  return text == intra_conc_name();
+
136  }
+
137 
+
138  /**
+
139  * Check if variable name is external cell concentration
+
140  *
+
141  * This is equivalent of IONOUT flag in mod2c.
+
142  */
+
143  bool is_extra_cell_conc(const std::string& text) const {
+
144  return text == extra_conc_name();
+
145  }
+
146 
+
147  /**
+
148  * Check if variable name is reveral potential
+
149  *
+
150  * Matches `ena` and `na_erev`.
+
151  */
+
152  bool is_rev_potential(const std::string& text) const {
+
153  return text == rev_potential_name() ||
+ +
155  }
+
156 
+
157  /// check if it is either internal or external concentration
+
158  bool is_ionic_conc(const std::string& text) const {
+
159  return is_intra_cell_conc(text) || is_extra_cell_conc(text);
+
160  }
+
161 
+
162  /// Is the variable name `text` related to this ion?
+
163  ///
+
164  /// Example: For sodium this is true for any of `"ena"`, `"ina"`, `"nai"`
+
165  /// and `"nao"`; but not `ion_ina`, etc.
+
166  bool is_ionic_variable(const std::string& text) const {
+
167  return is_ionic_conc(text) || is_ionic_current(text) || is_rev_potential(text);
+
168  }
+
169 
+
170  /// Is the variable name `text` the style of this ion?
+
171  ///
+
172  /// Example: For sodium this is true for `"style_na"`.
+
173  bool is_style(const std::string& text) const {
+
174  return text == fmt::format("style_{}", name);
175  }
176 
-
177  std::string intra_conc_name() const {
-
178  return name + "i";
+
177  bool is_current_derivative(const std::string& text) const {
+
178  return text == ("di" + name + "dv");
179  }
180 
-
181  std::string intra_conc_pointer_name() const {
- +
181  std::string intra_conc_name() const {
+
182  return name + "i";
183  }
184 
-
185  std::string extra_conc_name() const {
-
186  return name + "o";
+
185  std::string intra_conc_pointer_name() const {
+
187  }
188 
-
189  std::string extra_conc_pointer_name() const {
- +
189  std::string extra_conc_name() const {
+
190  return name + "o";
191  }
192 
-
193  std::string rev_potential_name() const {
-
194  return "e" + name;
+
193  std::string extra_conc_pointer_name() const {
+
195  }
196 
-
197  std::string rev_potential_pointer_name() const {
-
198  return naming::ION_VARNAME_PREFIX + name + "_erev";
+
197  std::string rev_potential_name() const {
+
198  return "e" + name;
199  }
200 
-
201  std::string ionic_current_name() const {
-
202  return "i" + name;
+
201  std::string rev_potential_pointer_name() const {
+
202  return naming::ION_VARNAME_PREFIX + name + "_erev";
203  }
204 
-
205  std::string ionic_current_pointer_name() const {
- +
205  std::string ionic_current_name() const {
+
206  return "i" + name;
207  }
208 
-
209  std::string current_derivative_name() const {
-
210  return "di" + name + "dv";
+
209  std::string ionic_current_pointer_name() const {
+
211  }
212 
-
213  std::string current_derivative_pointer_name() const {
- +
213  std::string current_derivative_name() const {
+
214  return "di" + name + "dv";
215  }
-
216 
-
217  /// for a given ion, return different variable names/properties
-
218  /// like internal/external concentration, reversal potential,
-
219  /// ionic current etc.
-
220  static std::vector<std::string> get_possible_variables(const std::string& ion_name) {
-
221  auto ion = Ion(ion_name);
-
222  return {ion.ionic_current_name(),
-
223  ion.intra_conc_name(),
-
224  ion.extra_conc_name(),
-
225  ion.rev_potential_name()};
-
226  }
-
227 
-
228  /// Variable index in the ion mechanism.
-
229  ///
-
230  /// For sodium (na), the `var_name` must be one of `ina`, `ena`, `nai`,
-
231  /// `nao` or `dinadv`. Replace `na` with the analogous for other ions.
-
232  ///
-
233  /// In NRN the order is:
-
234  /// 0: ena
-
235  /// 1: nai
-
236  /// 2: nao
-
237  /// 3: ina
-
238  /// 4: dinadv
-
239  int variable_index(const std::string& var_name) const {
-
240  if (is_rev_potential(var_name)) {
-
241  return 0;
-
242  }
-
243  if (is_intra_cell_conc(var_name)) {
-
244  return 1;
-
245  }
-
246  if (is_extra_cell_conc(var_name)) {
-
247  return 2;
-
248  }
-
249  if (is_ionic_current(var_name)) {
-
250  return 3;
-
251  }
-
252  if (is_current_derivative(var_name)) {
-
253  return 4;
-
254  }
-
255 
-
256  throw std::runtime_error(fmt::format("Invalid `var_name == {}`.", var_name));
-
257  }
-
258 };
+
216 
+
217  std::string current_derivative_pointer_name() const {
+ +
219  }
+
220 
+
221  /// for a given ion, return different variable names/properties
+
222  /// like internal/external concentration, reversal potential,
+
223  /// ionic current etc.
+
224  static std::vector<std::string> get_possible_variables(const std::string& ion_name) {
+
225  auto ion = Ion(ion_name);
+
226  return {ion.ionic_current_name(),
+
227  ion.intra_conc_name(),
+
228  ion.extra_conc_name(),
+
229  ion.rev_potential_name()};
+
230  }
+
231 
+
232  /// Variable index in the ion mechanism.
+
233  ///
+
234  /// For sodium (na), the `var_name` must be one of `ina`, `ena`, `nai`,
+
235  /// `nao` or `dinadv`. Replace `na` with the analogous for other ions.
+
236  ///
+
237  /// In NRN the order is:
+
238  /// 0: ena
+
239  /// 1: nai
+
240  /// 2: nao
+
241  /// 3: ina
+
242  /// 4: dinadv
+
243  int variable_index(const std::string& var_name) const {
+
244  if (is_rev_potential(var_name)) {
+
245  return 0;
+
246  }
+
247  if (is_intra_cell_conc(var_name)) {
+
248  return 1;
+
249  }
+
250  if (is_extra_cell_conc(var_name)) {
+
251  return 2;
+
252  }
+
253  if (is_ionic_current(var_name)) {
+
254  return 3;
+
255  }
+
256  if (is_current_derivative(var_name)) {
+
257  return 4;
+
258  }
259 
-
260 
-
261 /**
-
262  * \class IndexSemantics
-
263  * \brief Represent semantic information for index variable
-
264  */
- -
266  /// start position in the int array
-
267  int index;
-
268 
-
269  /// name/type of the variable (i.e. semantics)
-
270  std::string name;
-
271 
-
272  /// number of elements (typically one)
-
273  int size;
-
274 
-
275  IndexSemantics() = delete;
-
276  IndexSemantics(int index, std::string name, int size)
-
277  : index(index)
-
278  , name(std::move(name))
-
279  , size(size) {}
-
280 };
-
281 
-
282 
-
283 /**
-
284  * \class CodegenInfo
-
285  * \brief Represent information collected from AST for code generation
-
286  *
-
287  * Code generation passes require different information from AST. This
-
288  * information is gathered in this single class.
-
289  *
-
290  * \todo Need to store all Define i.e. macro definitions?
-
291  */
-
292 struct CodegenInfo {
-
293  /// name of mod file
-
294  std::string mod_file;
-
295 
-
296  /// name of the suffix
-
297  std::string mod_suffix;
-
298 
-
299  /// point process range and functions don't have suffix
-
300  std::string rsuffix;
-
301 
-
302  /// true if mod file is vectorizable (which should be always true for coreneuron)
-
303  /// But there are some blocks like LINEAR are not thread safe in neuron or mod2c
-
304  /// context. In this case vectorize is used to determine number of float variable
-
305  /// in the data array (e.g. v). For such non thread methods or blocks vectorize is
-
306  /// false.
-
307  bool vectorize = true;
-
308 
-
309  /// if mod file is thread safe (always true for coreneuron)
-
310  bool thread_safe = true;
-
311 
-
312  /// if mod file is point process
-
313  bool point_process = false;
-
314 
-
315  /// if mod file is artificial cell
-
316  bool artificial_cell = false;
-
317 
-
318  /// if electrode current specified
-
319  bool electrode_current = false;
-
320 
-
321  /// if thread thread call back routines need to register
- -
323 
-
324  /// if bbcore pointer is used
-
325  bool bbcore_pointer_used = false;
-
326 
-
327  /// if write concentration call required in initial block
-
328  bool write_concentration = false;
-
329 
-
330  /// if net_send function is used
-
331  bool net_send_used = false;
-
332 
-
333  /// if net_even function is used
-
334  bool net_event_used = false;
-
335 
-
336  /// if diam is used
-
337  bool diam_used = false;
-
338 
-
339  /// if area is used
-
340  bool area_used = false;
-
341 
-
342  /// if for_netcon is used
-
343  bool for_netcon_used = false;
-
344 
-
345  /// number of watch expressions
-
346  int watch_count = 0;
-
347 
-
348  /// number of table statements
-
349  int table_count = 0;
-
350 
-
351  /**
-
352  * thread_data_index indicates number of threads being allocated.
-
353  * For example, if there is derivimplicit method used, then two thread
-
354  * structures are created. When we print global variables then
-
355  * thread_data_index is used to indicate whats next thread id to use.
-
356  */
- -
358 
-
359  /**
-
360  * Top local variables are those local variables that appear in global scope.
-
361  * Thread structure is created for top local variables and doesn't thread id
-
362  * 0. For example, if derivimplicit method is used then thread id 0 is assigned
-
363  * to those structures first. And then next thread id is assigned for top local
-
364  * variables. The idea of thread is assignement is to have same order for variables
-
365  * between neuron and coreneuron.
-
366  */
-
367 
-
368  /// thread id for top local variables
- -
370 
-
371  /// total length of all top local variables
- -
373 
-
374  /// thread id for thread promoted variables
- -
376 
-
377  /// sum of length of thread promoted variables
- -
379 
-
380  /// thread id for derivimplicit variables
- -
382 
-
383  /// slist/dlist id for derivimplicit block
- -
385 
-
386  /// number of solve blocks in mod file
- -
388 
-
389  /// number of primes (all state variables not necessary to be prime)
-
390  int num_primes = 0;
-
391 
-
392  /// sum of length of all prime variables
-
393  int primes_size = 0;
-
394 
-
395  /// number of equations (i.e. statements) in derivative block
-
396  /// typically equal to number of primes
-
397  int num_equations = 0;
+
260  throw std::runtime_error(fmt::format("Invalid `var_name == {}`.", var_name));
+
261  }
+
262 };
+
263 
+
264 
+
265 /**
+
266  * \class IndexSemantics
+
267  * \brief Represent semantic information for index variable
+
268  */
+ +
270  /// start position in the int array
+
271  int index;
+
272 
+
273  /// name/type of the variable (i.e. semantics)
+
274  std::string name;
+
275 
+
276  /// number of elements (typically one)
+
277  int size;
+
278 
+
279  IndexSemantics() = delete;
+
280  IndexSemantics(int index, std::string name, int size)
+
281  : index(index)
+
282  , name(std::move(name))
+
283  , size(size) {}
+
284 };
+
285 
+
286 
+
287 /**
+
288  * \class CodegenInfo
+
289  * \brief Represent information collected from AST for code generation
+
290  *
+
291  * Code generation passes require different information from AST. This
+
292  * information is gathered in this single class.
+
293  *
+
294  * \todo Need to store all Define i.e. macro definitions?
+
295  */
+
296 struct CodegenInfo {
+
297  /// name of mod file
+
298  std::string mod_file;
+
299 
+
300  /// name of the suffix
+
301  std::string mod_suffix;
+
302 
+
303  /// point process range and functions don't have suffix
+
304  std::string rsuffix;
+
305 
+
306  /// true if mod file is vectorizable (which should be always true for coreneuron)
+
307  /// But there are some blocks like LINEAR are not thread safe in neuron or mod2c
+
308  /// context. In this case vectorize is used to determine number of float variable
+
309  /// in the data array (e.g. v). For such non thread methods or blocks vectorize is
+
310  /// false.
+
311  bool vectorize = true;
+
312 
+
313  /// if mod file is thread safe (always true for coreneuron)
+
314  bool thread_safe = true;
+
315 
+
316  /// if mod file is point process
+
317  bool point_process = false;
+
318 
+
319  /// if mod file is artificial cell
+
320  bool artificial_cell = false;
+
321 
+
322  /// if electrode current specified
+
323  bool electrode_current = false;
+
324 
+
325  /// if thread thread call back routines need to register
+ +
327 
+
328  /// if bbcore pointer is used
+
329  bool bbcore_pointer_used = false;
+
330 
+
331  /// if write concentration call required in initial block
+
332  bool write_concentration = false;
+
333 
+
334  /// if net_send function is used
+
335  bool net_send_used = false;
+
336 
+
337  /// if net_even function is used
+
338  bool net_event_used = false;
+
339 
+
340  /// if diam is used
+
341  bool diam_used = false;
+
342 
+
343  /// if area is used
+
344  bool area_used = false;
+
345 
+
346  /// if for_netcon is used
+
347  bool for_netcon_used = false;
+
348 
+
349  /// number of watch expressions
+
350  int watch_count = 0;
+
351 
+
352  /// number of table statements
+
353  int table_count = 0;
+
354 
+
355  /**
+
356  * thread_data_index indicates number of threads being allocated.
+
357  * For example, if there is derivimplicit method used, then two thread
+
358  * structures are created. When we print global variables then
+
359  * thread_data_index is used to indicate whats next thread id to use.
+
360  */
+ +
362 
+
363  /**
+
364  * Top local variables are those local variables that appear in global scope.
+
365  * Thread structure is created for top local variables and doesn't thread id
+
366  * 0. For example, if derivimplicit method is used then thread id 0 is assigned
+
367  * to those structures first. And then next thread id is assigned for top local
+
368  * variables. The idea of thread is assignement is to have same order for variables
+
369  * between neuron and coreneuron.
+
370  */
+
371 
+
372  /// thread id for top local variables
+ +
374 
+
375  /// total length of all top local variables
+ +
377 
+
378  /// thread id for thread promoted variables
+ +
380 
+
381  /// sum of length of thread promoted variables
+ +
383 
+
384  /// thread id for derivimplicit variables
+ +
386 
+
387  /// slist/dlist id for derivimplicit block
+ +
389 
+
390  /// number of solve blocks in mod file
+ +
392 
+
393  /// number of primes (all state variables not necessary to be prime)
+
394  int num_primes = 0;
+
395 
+
396  /// sum of length of all prime variables
+
397  int primes_size = 0;
398 
-
399  /// number of semantic variables
- -
401 
-
402  /// True if we have to emit CVODE code
-
403  /// TODO: Figure out when this needs to be true
-
404  bool emit_cvode = false;
+
399  /// number of equations (i.e. statements) in derivative block
+
400  /// typically equal to number of primes
+
401  int num_equations = 0;
+
402 
+
403  /// number of semantic variables
+
405 
-
406  /// derivative block
- -
408 
-
409  /// nrn_state block
- -
411 
-
412  /// net receive block for point process
- -
414 
-
415  /// number of arguments to net_receive block
- -
417 
-
418  /// initial block within net receive block
- -
420 
-
421  /// initial block
-
422  const ast::InitialBlock* initial_node = nullptr;
-
423 
-
424  /// constructor block
- -
426 
-
427  /// destructor block only for point process
- -
429 
-
430  /// all procedures defined in the mod file
-
431  std::vector<const ast::ProcedureBlock*> procedures;
-
432 
-
433  /// derivimplicit callbacks need to be emited
-
434  std::vector<const ast::DerivimplicitCallback*> derivimplicit_callbacks;
-
435 
-
436  /// all functions defined in the mod file
-
437  std::vector<const ast::FunctionBlock*> functions;
-
438 
-
439  /// all functions tables defined in the mod file
-
440  std::vector<const ast::FunctionTableBlock*> function_tables;
-
441 
-
442  /// all factors defined in the mod file
-
443  std::vector<const ast::FactorDef*> factor_definitions;
-
444 
-
445  /// ions used in the mod file
-
446  std::vector<Ion> ions;
-
447 
-
448  using SymbolType = std::shared_ptr<symtab::Symbol>;
-
449 
-
450  /// range variables which are parameter as well
-
451  std::vector<SymbolType> range_parameter_vars;
-
452 
-
453  /// range variables which are assigned variables as well
-
454  std::vector<SymbolType> range_assigned_vars;
-
455 
-
456  /// remaining assigned variables
-
457  std::vector<SymbolType> assigned_vars;
-
458 
-
459  /// all state variables
-
460  std::vector<SymbolType> state_vars;
-
461 
-
462  /// state variables excluding such useion read/write variables
-
463  /// that are not ionic currents. In neuron/mod2c these are stored
-
464  /// in the list "rangestate".
-
465  std::vector<SymbolType> range_state_vars;
-
466 
-
467  /// local variables in the global scope
-
468  std::vector<SymbolType> top_local_variables;
-
469 
-
470  /// pointer or bbcore pointer variables
-
471  std::vector<SymbolType> pointer_variables;
-
472 
-
473  /// RANDOM variables
-
474  std::vector<SymbolType> random_variables;
-
475 
-
476  /// index/offset for first pointer variable if exist
- -
478 
-
479  /// index/offset for first RANDOM variable if exist
- -
481 
-
482  /// tqitem index in integer variables
-
483  /// note that if tqitem doesn't exist then the default value should be 0
-
484  int tqitem_index = 0;
+
406  /// True if we have to emit CVODE code
+
407  /// TODO: Figure out when this needs to be true
+
408  bool emit_cvode = false;
+
409 
+
410  /// derivative block
+ +
412 
+
413  /// nrn_state block
+ +
415 
+
416  /// net receive block for point process
+ +
418 
+
419  /// number of arguments to net_receive block
+ +
421 
+
422  /// initial block within net receive block
+ +
424 
+
425  /// initial block
+
426  const ast::InitialBlock* initial_node = nullptr;
+
427 
+
428  /// constructor block
+ +
430 
+
431  /// destructor block only for point process
+ +
433 
+
434  /// all procedures defined in the mod file
+
435  std::vector<const ast::ProcedureBlock*> procedures;
+
436 
+
437  /// derivimplicit callbacks need to be emited
+
438  std::vector<const ast::DerivimplicitCallback*> derivimplicit_callbacks;
+
439 
+
440  /// all functions defined in the mod file
+
441  std::vector<const ast::FunctionBlock*> functions;
+
442 
+
443  /// all functions tables defined in the mod file
+
444  std::vector<const ast::FunctionTableBlock*> function_tables;
+
445 
+
446  /// all factors defined in the mod file
+
447  std::vector<const ast::FactorDef*> factor_definitions;
+
448 
+
449  /// ions used in the mod file
+
450  std::vector<Ion> ions;
+
451 
+
452  using SymbolType = std::shared_ptr<symtab::Symbol>;
+
453 
+
454  /// range variables which are parameter as well
+
455  std::vector<SymbolType> range_parameter_vars;
+
456 
+
457  /// range variables which are assigned variables as well
+
458  std::vector<SymbolType> range_assigned_vars;
+
459 
+
460  /// remaining assigned variables
+
461  std::vector<SymbolType> assigned_vars;
+
462 
+
463  /// all state variables
+
464  std::vector<SymbolType> state_vars;
+
465 
+
466  /// state variables excluding such useion read/write variables
+
467  /// that are not ionic currents. In neuron/mod2c these are stored
+
468  /// in the list "rangestate".
+
469  std::vector<SymbolType> range_state_vars;
+
470 
+
471  /// local variables in the global scope
+
472  std::vector<SymbolType> top_local_variables;
+
473 
+
474  /// pointer or bbcore pointer variables
+
475  std::vector<SymbolType> pointer_variables;
+
476 
+
477  /// RANDOM variables
+
478  std::vector<SymbolType> random_variables;
+
479 
+
480  /// index/offset for first pointer variable if exist
+ +
482 
+
483  /// index/offset for first RANDOM variable if exist
+
485 
-
486  /// updated dt to use with steadystate solver (in initial block)
-
487  /// empty string means no change in dt
-
488  std::string changed_dt;
+
486  /// tqitem index in integer variables
+
487  /// note that if tqitem doesn't exist then the default value should be 0
+
488  int tqitem_index = 0;
489 
-
490  /// global variables
-
491  std::vector<SymbolType> global_variables;
-
492 
-
493  /// constant variables
-
494  std::vector<SymbolType> constant_variables;
-
495 
-
496  /// thread variables (e.g. global variables promoted to thread)
-
497  std::vector<SymbolType> thread_variables;
-
498 
-
499  /// new one used in print_ion_types
-
500  std::vector<SymbolType> use_ion_variables;
-
501 
-
502  /// this is the order in which they appear in derivative block
-
503  /// this is required while printing them in initlist function
-
504  std::vector<SymbolType> prime_variables_by_order;
+
490  /// updated dt to use with steadystate solver (in initial block)
+
491  /// empty string means no change in dt
+
492  std::string changed_dt;
+
493 
+
494  /// global variables
+
495  std::vector<SymbolType> global_variables;
+
496 
+
497  /// constant variables
+
498  std::vector<SymbolType> constant_variables;
+
499 
+
500  /// thread variables (e.g. global variables promoted to thread)
+
501  std::vector<SymbolType> thread_variables;
+
502 
+
503  /// new one used in print_ion_types
+
504  std::vector<SymbolType> use_ion_variables;
505 
-
506  /// table variables
-
507  std::vector<SymbolType> table_statement_variables;
-
508  std::vector<SymbolType> table_assigned_variables;
+
506  /// this is the order in which they appear in derivative block
+
507  /// this is required while printing them in initlist function
+
508  std::vector<SymbolType> prime_variables_by_order;
509 
-
510  /// [Core]NEURON global variables used (e.g. celsius) and their types
-
511  std::vector<std::pair<SymbolType, std::string>> neuron_global_variables;
-
512 
-
513  /// function or procedures with table statement
-
514  std::vector<const ast::Block*> functions_with_table;
-
515 
-
516  /// represent conductance statements used in mod file
-
517  std::vector<Conductance> conductances;
-
518 
-
519  /// index variable semantic information
-
520  std::vector<IndexSemantics> semantics;
-
521 
-
522  /// non specific and ionic currents
-
523  std::vector<std::string> currents;
-
524 
-
525  /// all top level global blocks
-
526  std::vector<ast::Node*> top_blocks;
-
527 
-
528  /// all top level verbatim blocks
-
529  std::vector<ast::Node*> top_verbatim_blocks;
-
530 
-
531  /// all watch statements
-
532  std::vector<const ast::WatchStatement*> watch_statements;
-
533 
-
534  /// all before after blocks
-
535  std::vector<const ast::Block*> before_after_blocks;
-
536 
-
537  /// all variables/symbols used in the verbatim block
-
538  std::unordered_set<std::string> variables_in_verbatim;
-
539 
-
540  /// unique functor names for all the \c EigenNewtonSolverBlock s
-
541  std::unordered_map<const ast::EigenNewtonSolverBlock*, std::string> functor_names;
-
542 
-
543  /// true if eigen newton solver is used
- -
545 
-
546  /// true if eigen linear solver is used
- -
548 
-
549  /// if any ion has write variable
-
550  bool ion_has_write_variable() const noexcept;
-
551 
-
552  /// if given variable is ion write variable
-
553  bool is_ion_write_variable(const std::string& name) const noexcept;
-
554 
-
555  /// if given variable is ion read variable
-
556  bool is_ion_read_variable(const std::string& name) const noexcept;
-
557 
-
558  /// if either read or write variable
-
559  bool is_ion_variable(const std::string& name) const noexcept;
-
560 
-
561  /// if given variable is a current
-
562  bool is_current(const std::string& name) const noexcept;
-
563 
-
564  /// if given variable is a ionic current
-
565  bool is_ionic_current(const std::string& name) const noexcept;
-
566 
-
567  /// if given variable is a ionic concentration
-
568  bool is_ionic_conc(const std::string& name) const noexcept;
-
569 
-
570  /// if watch statements are used
-
571  bool is_watch_used() const noexcept {
-
572  return watch_count > 0;
-
573  }
-
574 
-
575  bool emit_table_thread() const noexcept {
-
576  return (table_count > 0 && vectorize == true);
+
510  /// table variables
+
511  std::vector<SymbolType> table_statement_variables;
+
512  std::vector<SymbolType> table_assigned_variables;
+
513 
+
514  /// [Core]NEURON global variables used (e.g. celsius) and their types
+
515  std::vector<std::pair<SymbolType, std::string>> neuron_global_variables;
+
516 
+
517  /// function or procedures with table statement
+
518  std::vector<const ast::Block*> functions_with_table;
+
519 
+
520  /// represent conductance statements used in mod file
+
521  std::vector<Conductance> conductances;
+
522 
+
523  /// index variable semantic information
+
524  std::vector<IndexSemantics> semantics;
+
525 
+
526  /// non specific and ionic currents
+
527  std::vector<std::string> currents;
+
528 
+
529  /// all top level global blocks
+
530  std::vector<ast::Node*> top_blocks;
+
531 
+
532  /// all top level verbatim blocks
+
533  std::vector<ast::Node*> top_verbatim_blocks;
+
534 
+
535  /// all watch statements
+
536  std::vector<const ast::WatchStatement*> watch_statements;
+
537 
+
538  /// all before after blocks
+
539  std::vector<const ast::Block*> before_after_blocks;
+
540 
+
541  /// all variables/symbols used in the verbatim block
+
542  std::unordered_set<std::string> variables_in_verbatim;
+
543 
+
544  /// unique functor names for all the \c EigenNewtonSolverBlock s
+
545  std::unordered_map<const ast::EigenNewtonSolverBlock*, std::string> functor_names;
+
546 
+
547  /// true if eigen newton solver is used
+ +
549 
+
550  /// true if eigen linear solver is used
+ +
552 
+
553  /// if any ion has write variable
+
554  bool ion_has_write_variable() const noexcept;
+
555 
+
556  /// if given variable is ion write variable
+
557  bool is_ion_write_variable(const std::string& name) const noexcept;
+
558 
+
559  /// if given variable is ion read variable
+
560  bool is_ion_read_variable(const std::string& name) const noexcept;
+
561 
+
562  /// if either read or write variable
+
563  bool is_ion_variable(const std::string& name) const noexcept;
+
564 
+
565  /// if given variable is a current
+
566  bool is_current(const std::string& name) const noexcept;
+
567 
+
568  /// if given variable is a ionic current
+
569  bool is_ionic_current(const std::string& name) const noexcept;
+
570 
+
571  /// if given variable is a ionic concentration
+
572  bool is_ionic_conc(const std::string& name) const noexcept;
+
573 
+
574  /// if watch statements are used
+
575  bool is_watch_used() const noexcept {
+
576  return watch_count > 0;
577  }
-
578 
-
579  /// if legacy derivimplicit solver from coreneuron to be used
-
580  inline bool derivimplicit_used() const {
-
581  return !derivimplicit_callbacks.empty();
-
582  }
-
583 
-
584  bool function_uses_table(const std::string& name) const noexcept;
-
585 
-
586  /// true if EigenNewtonSolver is used in nrn_state block
- -
588 
-
589  /// true if WatchStatement uses voltage v variable
- -
591 
-
592  /// if we need a call back to wrote_conc in neuron/coreneuron
-
593  bool require_wrote_conc = false;
-
594 };
+
578 
+
579  bool emit_table_thread() const noexcept {
+
580  return (table_count > 0 && vectorize == true);
+
581  }
+
582 
+
583  /// if legacy derivimplicit solver from coreneuron to be used
+
584  inline bool derivimplicit_used() const {
+
585  return !derivimplicit_callbacks.empty();
+
586  }
+
587 
+
588  bool function_uses_table(const std::string& name) const noexcept;
+
589 
+
590  /// true if EigenNewtonSolver is used in nrn_state block
+ +
592 
+
593  /// true if WatchStatement uses voltage v variable
+
595 
-
596 /** \} */ // end of codegen_backends
-
597 
-
598 } // namespace codegen
-
599 } // namespace nmodl
+
596  /// if we need a call back to wrote_conc in neuron/coreneuron
+
597  bool require_wrote_conc = false;
+
598 };
+
599 
+
600 /** \} */ // end of codegen_backends
+
601 
+
602 } // namespace codegen
+
603 } // namespace nmodl
-
std::vector< const ast::FunctionBlock * > functions
all functions defined in the mod file
+
std::vector< const ast::FunctionBlock * > functions
all functions defined in the mod file
-
bool emit_cvode
True if we have to emit CVODE code TODO: Figure out when this needs to be true.
-
int num_net_receive_parameters
number of arguments to net_receive block
-
std::string ion
name of the ion
+
bool emit_cvode
True if we have to emit CVODE code TODO: Figure out when this needs to be true.
+
int num_net_receive_parameters
number of arguments to net_receive block
+
std::string ion
name of the ion
bool ion_has_write_variable() const noexcept
if any ion has write variable
-
int tqitem_index
tqitem index in integer variables note that if tqitem doesn't exist then the default value should be ...
-
bool is_read(const std::string &name) const
-
std::vector< ast::Node * > top_verbatim_blocks
all top level verbatim blocks
-
bool for_netcon_used
if for_netcon is used
-
const ast::NetReceiveBlock * net_receive_node
net receive block for point process
-
std::vector< Ion > ions
ions used in the mod file
-
static std::vector< std::string > get_possible_variables(const std::string &ion_name)
for a given ion, return different variable names/properties like internal/external concentration,...
-
bool diam_used
if diam is used
-
bool thread_callback_register
if thread thread call back routines need to register
-
int watch_count
number of watch expressions
-
std::vector< const ast::DerivimplicitCallback * > derivimplicit_callbacks
derivimplicit callbacks need to be emited
-
bool is_rev_written() const
-
int derivimplicit_list_num
slist/dlist id for derivimplicit block
-
int thread_data_index
thread_data_index indicates number of threads being allocated.
-
bool derivimplicit_used() const
if legacy derivimplicit solver from coreneuron to be used
-
std::string rsuffix
point process range and functions don't have suffix
-
bool is_interior_conc_written() const
-
std::vector< SymbolType > table_statement_variables
table variables
+
int tqitem_index
tqitem index in integer variables note that if tqitem doesn't exist then the default value should be ...
+
bool is_read(const std::string &name) const
+
std::vector< ast::Node * > top_verbatim_blocks
all top level verbatim blocks
+
bool for_netcon_used
if for_netcon is used
+
const ast::NetReceiveBlock * net_receive_node
net receive block for point process
+
std::vector< Ion > ions
ions used in the mod file
+
static std::vector< std::string > get_possible_variables(const std::string &ion_name)
for a given ion, return different variable names/properties like internal/external concentration,...
+
bool diam_used
if diam is used
+
bool thread_callback_register
if thread thread call back routines need to register
+
int watch_count
number of watch expressions
+
std::vector< const ast::DerivimplicitCallback * > derivimplicit_callbacks
derivimplicit callbacks need to be emited
+
bool is_rev_written() const
+
int derivimplicit_list_num
slist/dlist id for derivimplicit block
+
int thread_data_index
thread_data_index indicates number of threads being allocated.
+
bool derivimplicit_used() const
if legacy derivimplicit solver from coreneuron to be used
+
std::string rsuffix
point process range and functions don't have suffix
+
bool is_interior_conc_written() const
+
std::vector< SymbolType > table_statement_variables
table variables
-
const ast::InitialBlock * initial_node
initial block
-
int num_primes
number of primes (all state variables not necessary to be prime)
-
std::vector< SymbolType > table_assigned_variables
-
bool net_send_used
if net_send function is used
-
bool is_ionic_variable(const std::string &text) const
Is the variable name text related to this ion?
+
const ast::InitialBlock * initial_node
initial block
+
int num_primes
number of primes (all state variables not necessary to be prime)
+
std::vector< SymbolType > table_assigned_variables
+
bool net_send_used
if net_send function is used
+
std::optional< double > valence
ion valence
+
bool is_ionic_variable(const std::string &text) const
Is the variable name text related to this ion?
encapsulates code generation backend implementations
Definition: ast_common.hpp:26
-
Represent ions used in mod file.
+
Represent ions used in mod file.
Implement classes for representing symbol table at block and file scope.
-
const ast::ConstructorBlock * constructor_node
constructor block
-
std::string extra_conc_name() const
-
int top_local_thread_size
total length of all top local variables
-
std::string name
name of the ion
+
const ast::ConstructorBlock * constructor_node
constructor block
+
std::string extra_conc_name() const
+
int top_local_thread_size
total length of all top local variables
+
std::string name
name of the ion
bool is_voltage_used_by_watch_statements() const
true if WatchStatement uses voltage v variable
-
std::string changed_dt
updated dt to use with steadystate solver (in initial block) empty string means no change in dt
-
bool is_style(const std::string &text) const
Is the variable name text the style of this ion?
-
std::vector< SymbolType > constant_variables
constant variables
-
std::string rev_potential_name() const
-
std::unordered_map< const ast::EigenNewtonSolverBlock *, std::string > functor_names
unique functor names for all the EigenNewtonSolverBlock s
-
bool bbcore_pointer_used
if bbcore pointer is used
-
std::string mod_suffix
name of the suffix
-
std::vector< const ast::ProcedureBlock * > procedures
all procedures defined in the mod file
-
Represent information collected from AST for code generation.
-
std::vector< SymbolType > global_variables
global variables
-
std::string extra_conc_pointer_name() const
-
std::string rev_potential_pointer_name() const
-
int table_count
number of table statements
-
int first_pointer_var_index
index/offset for first pointer variable if exist
-
bool thread_safe
if mod file is thread safe (always true for coreneuron)
-
std::string intra_conc_name() const
-
std::vector< std::string > writes
ion variables that are being written
+
std::string changed_dt
updated dt to use with steadystate solver (in initial block) empty string means no change in dt
+
bool is_style(const std::string &text) const
Is the variable name text the style of this ion?
+
std::vector< SymbolType > constant_variables
constant variables
+
std::string rev_potential_name() const
+
std::unordered_map< const ast::EigenNewtonSolverBlock *, std::string > functor_names
unique functor names for all the EigenNewtonSolverBlock s
+
bool bbcore_pointer_used
if bbcore pointer is used
+
std::string mod_suffix
name of the suffix
+
std::vector< const ast::ProcedureBlock * > procedures
all procedures defined in the mod file
+
Represent information collected from AST for code generation.
+
std::vector< SymbolType > global_variables
global variables
+
std::string extra_conc_pointer_name() const
+
std::string rev_potential_pointer_name() const
+
int table_count
number of table statements
+
int first_pointer_var_index
index/offset for first pointer variable if exist
+
bool thread_safe
if mod file is thread safe (always true for coreneuron)
+
std::string intra_conc_name() const
+
std::vector< std::string > writes
ion variables that are being written
-
std::vector< SymbolType > state_vars
all state variables
-
std::vector< const ast::WatchStatement * > watch_statements
all watch statements
-
int semantic_variable_count
number of semantic variables
-
int thread_var_data_size
sum of length of thread promoted variables
+
std::vector< SymbolType > state_vars
all state variables
+
std::vector< const ast::WatchStatement * > watch_statements
all watch statements
+
int semantic_variable_count
number of semantic variables
+
int thread_var_data_size
sum of length of thread promoted variables
Represents a INITIAL block in the NMODL.
-
std::vector< IndexSemantics > semantics
index variable semantic information
-
bool artificial_cell
if mod file is artificial cell
-
bool area_used
if area is used
-
bool is_rev_potential(const std::string &text) const
Check if variable name is reveral potential.
-
IndexSemantics(int index, std::string name, int size)
-
std::string name
name/type of the variable (i.e. semantics)
+
std::vector< IndexSemantics > semantics
index variable semantic information
+
bool artificial_cell
if mod file is artificial cell
+
bool area_used
if area is used
+
bool is_rev_potential(const std::string &text) const
Check if variable name is reveral potential.
+
IndexSemantics(int index, std::string name, int size)
+
std::string name
name/type of the variable (i.e. semantics)
Represents a BREAKPOINT block in NMODL.
-
std::vector< SymbolType > top_local_variables
local variables in the global scope
-
bool need_style
if style semantic needed
-
int num_solve_blocks
number of solve blocks in mod file
+
std::vector< SymbolType > top_local_variables
local variables in the global scope
+
bool need_style
if style semantic needed
+
int num_solve_blocks
number of solve blocks in mod file
Represents a DESTRUCTOR block in the NMODL.
-
bool eigen_linear_solver_exist
true if eigen linear solver is used
-
std::vector< SymbolType > thread_variables
thread variables (e.g. global variables promoted to thread)
+
bool eigen_linear_solver_exist
true if eigen linear solver is used
+
std::vector< SymbolType > thread_variables
thread variables (e.g. global variables promoted to thread)
Represents a CONSTRUCTOR block in the NMODL.
-
std::vector< ast::Node * > top_blocks
all top level global blocks
+
std::vector< ast::Node * > top_blocks
all top level global blocks
bool is_ionic_current(const std::string &name) const noexcept
if given variable is a ionic current
-
std::string current_derivative_pointer_name() const
-
std::unordered_set< std::string > variables_in_verbatim
all variables/symbols used in the verbatim block
-
bool require_wrote_conc
if we need a call back to wrote_conc in neuron/coreneuron
-
bool is_exterior_conc_written() const
-
Represent semantic information for index variable.
-
bool is_intra_cell_conc(const std::string &text) const
Check if variable name is internal cell concentration.
-
int size
number of elements (typically one)
-
const ast::BreakpointBlock * breakpoint_node
derivative block
-
bool eigen_newton_solver_exist
true if eigen newton solver is used
-
bool is_extra_cell_conc(const std::string &text) const
Check if variable name is external cell concentration.
-
std::vector< std::string > currents
non specific and ionic currents
-
bool is_conc_read() const
-
int first_random_var_index
index/offset for first RANDOM variable if exist
-
bool point_process
if mod file is point process
-
std::string ionic_current_pointer_name() const
-
const ast::NrnStateBlock * nrn_state_block
nrn_state block
-
bool vectorize
true if mod file is vectorizable (which should be always true for coreneuron) But there are some bloc...
-
std::string variable
ion variable like intra/extra concentration
-
std::string mod_file
name of mod file
-
std::vector< SymbolType > range_assigned_vars
range variables which are assigned variables as well
-
std::vector< const ast::Block * > functions_with_table
function or procedures with table statement
-
bool is_conc_written() const
-
bool is_ionic_conc(const std::string &text) const
check if it is either internal or external concentration
+
std::string current_derivative_pointer_name() const
+
std::unordered_set< std::string > variables_in_verbatim
all variables/symbols used in the verbatim block
+
bool require_wrote_conc
if we need a call back to wrote_conc in neuron/coreneuron
+
bool is_exterior_conc_written() const
+
Represent semantic information for index variable.
+
bool is_intra_cell_conc(const std::string &text) const
Check if variable name is internal cell concentration.
+
int size
number of elements (typically one)
+
const ast::BreakpointBlock * breakpoint_node
derivative block
+
bool eigen_newton_solver_exist
true if eigen newton solver is used
+
bool is_extra_cell_conc(const std::string &text) const
Check if variable name is external cell concentration.
+
std::vector< std::string > currents
non specific and ionic currents
+
bool is_conc_read() const
+
int first_random_var_index
index/offset for first RANDOM variable if exist
+
bool point_process
if mod file is point process
+
std::string ionic_current_pointer_name() const
+
const ast::NrnStateBlock * nrn_state_block
nrn_state block
+
bool vectorize
true if mod file is vectorizable (which should be always true for coreneuron) But there are some bloc...
+
std::string variable
ion variable like intra/extra concentration
+
std::string mod_file
name of mod file
+
std::vector< SymbolType > range_assigned_vars
range variables which are assigned variables as well
+
std::vector< const ast::Block * > functions_with_table
function or procedures with table statement
+
bool is_conc_written() const
+
bool is_ionic_conc(const std::string &text) const
check if it is either internal or external concentration
bool is_ion_write_variable(const std::string &name) const noexcept
if given variable is ion write variable
-
std::vector< const ast::FunctionTableBlock * > function_tables
all functions tables defined in the mod file
-
int primes_size
sum of length of all prime variables
+
std::vector< const ast::FunctionTableBlock * > function_tables
all functions tables defined in the mod file
+
int primes_size
sum of length of all prime variables
Auto generated AST classes declaration.
bool function_uses_table(const std::string &name) const noexcept
-
bool net_event_used
if net_even function is used
-
int variable_index(const std::string &var_name) const
Variable index in the ion mechanism.
-
int derivimplicit_var_thread_id
thread id for derivimplicit variables
+
bool net_event_used
if net_even function is used
+
int variable_index(const std::string &var_name) const
Variable index in the ion mechanism.
+
int derivimplicit_var_thread_id
thread id for derivimplicit variables
Represents the coreneuron nrn_state callback function.
-
std::vector< Conductance > conductances
represent conductance statements used in mod file
-
int index
start position in the int array
-
bool emit_table_thread() const noexcept
-
std::vector< std::pair< SymbolType, std::string > > neuron_global_variables
[Core]NEURON global variables used (e.g. celsius) and their types
-
bool is_written(const std::string &name) const
-
bool electrode_current
if electrode current specified
-
std::string current_derivative_name() const
-
bool is_current_derivative(const std::string &text) const
-
bool is_interior_conc_read() const
-
std::vector< std::string > implicit_reads
ion variables that are being implicitly read
-
const ast::InitialBlock * net_receive_initial_node
initial block within net receive block
+
std::vector< Conductance > conductances
represent conductance statements used in mod file
+
int index
start position in the int array
+
bool emit_table_thread() const noexcept
+
std::vector< std::pair< SymbolType, std::string > > neuron_global_variables
[Core]NEURON global variables used (e.g. celsius) and their types
+
bool is_written(const std::string &name) const
+
bool electrode_current
if electrode current specified
+
std::string current_derivative_name() const
+
bool is_current_derivative(const std::string &text) const
+
bool is_interior_conc_read() const
+
std::vector< std::string > implicit_reads
ion variables that are being implicitly read
+
const ast::InitialBlock * net_receive_initial_node
initial block within net receive block
bool is_ion_read_variable(const std::string &name) const noexcept
if given variable is ion read variable
-
bool is_exterior_conc_read() const
-
std::vector< const ast::FactorDef * > factor_definitions
all factors defined in the mod file
-
std::vector< SymbolType > prime_variables_by_order
this is the order in which they appear in derivative block this is required while printing them in in...
-
std::vector< SymbolType > pointer_variables
pointer or bbcore pointer variables
-
bool is_watch_used() const noexcept
if watch statements are used
-
int thread_var_thread_id
thread id for thread promoted variables
+
bool is_exterior_conc_read() const
+
std::vector< const ast::FactorDef * > factor_definitions
all factors defined in the mod file
+
std::vector< SymbolType > prime_variables_by_order
this is the order in which they appear in derivative block this is required while printing them in in...
+
std::vector< SymbolType > pointer_variables
pointer or bbcore pointer variables
+
bool is_watch_used() const noexcept
if watch statements are used
+
int thread_var_thread_id
thread id for thread promoted variables
bool nrn_state_has_eigen_solver_block() const
true if EigenNewtonSolver is used in nrn_state block
-
std::vector< SymbolType > range_parameter_vars
range variables which are parameter as well
-
int top_local_thread_id
Top local variables are those local variables that appear in global scope.
+
std::vector< SymbolType > range_parameter_vars
range variables which are parameter as well
+
int top_local_thread_id
Top local variables are those local variables that appear in global scope.
static bool ends_with(const std::string &haystack, const std::string &needle)
Check if haystack ends with needle.
-
Represent conductance statements used in mod file.
-
std::shared_ptr< symtab::Symbol > SymbolType
-
const ast::DestructorBlock * destructor_node
destructor block only for point process
-
std::vector< const ast::Block * > before_after_blocks
all before after blocks
+
Represent conductance statements used in mod file.
+
std::shared_ptr< symtab::Symbol > SymbolType
+
const ast::DestructorBlock * destructor_node
destructor block only for point process
+
std::vector< const ast::Block * > before_after_blocks
all before after blocks
bool is_ionic_conc(const std::string &name) const noexcept
if given variable is a ionic concentration
-
int num_equations
number of equations (i.e.
+
int num_equations
number of equations (i.e.
bool is_ion_variable(const std::string &name) const noexcept
if either read or write variable
-
std::vector< SymbolType > use_ion_variables
new one used in print_ion_types
-
bool is_rev_read() const
+
std::vector< SymbolType > use_ion_variables
new one used in print_ion_types
+
bool is_rev_read() const
bool is_current(const std::string &name) const noexcept
if given variable is a current
-
std::vector< SymbolType > assigned_vars
remaining assigned variables
-
std::string ionic_current_name() const
-
bool write_concentration
if write concentration call required in initial block
-
std::vector< SymbolType > random_variables
RANDOM variables.
-
std::vector< std::string > reads
ion variables that are being read
-
std::vector< SymbolType > range_state_vars
state variables excluding such useion read/write variables that are not ionic currents.
-
bool is_ionic_current(const std::string &text) const
Check if variable name is a ionic current.
-
Ion(std::string name)
-
std::string intra_conc_pointer_name() const
+
std::vector< SymbolType > assigned_vars
remaining assigned variables
+
std::string ionic_current_name() const
+
bool write_concentration
if write concentration call required in initial block
+
std::vector< SymbolType > random_variables
RANDOM variables.
+
std::vector< std::string > reads
ion variables that are being read
+
std::vector< SymbolType > range_state_vars
state variables excluding such useion read/write variables that are not ionic currents.
+
bool is_ionic_current(const std::string &text) const
Check if variable name is a ionic current.
+
Ion(std::string name)
+
std::string intra_conc_pointer_name() const
static constexpr char ION_VARNAME_PREFIX[]
prefix for ion variable
diff --git a/doxygen/codegen__neuron__cpp__visitor_8hpp_source.html b/doxygen/codegen__neuron__cpp__visitor_8hpp_source.html index 948480082..83c5b158b 100644 --- a/doxygen/codegen__neuron__cpp__visitor_8hpp_source.html +++ b/doxygen/codegen__neuron__cpp__visitor_8hpp_source.html @@ -833,124 +833,124 @@
737 } // namespace nmodl
-
void print_nrn_destructor() override
Print nrn_destructor function definition.
-
void print_nrn_cur_non_conductance_kernel() override
Print the nrn_cur kernel without NMODL conductance keyword provisions.
-
std::string py_function_signature(const std::string &function_or_procedure_name) const
Get the signature of the npy <func_or_proc_name> function.
+
void print_nrn_destructor() override
Print nrn_destructor function definition.
+
void print_nrn_cur_non_conductance_kernel() override
Print the nrn_cur kernel without NMODL conductance keyword provisions.
+
std::string py_function_signature(const std::string &function_or_procedure_name) const
Get the signature of the npy <func_or_proc_name> function.
Helper to represent information about index/int variables.
-
void print_nrn_cur() override
Print nrn_cur / current update function definition.
-
void print_macro_definitions()
Print all NEURON macros.
+
void print_nrn_cur() override
Print nrn_cur / current update function definition.
+
void print_macro_definitions()
Print all NEURON macros.
CodegenCppVisitor(std::string mod_filename, const std::string &output_dir, std::string float_type, const bool optimize_ionvar_copies, std::unique_ptr< nmodl::utils::Blame > blame)
Constructs the C++ code generator visitor.
-
void print_net_event_call(const ast::FunctionCall &node) override
Print call to net_event.
-
void print_neuron_includes()
Print includes from NEURON.
-
void print_nrn_init(bool skip_init_check=true)
Print the nrn_init function definition.
-
void print_hoc_py_wrapper_function_body(const ast::Block *function_or_procedure_block, InterpreterWrapper wrapper_type)
-
std::string internal_method_arguments() override
Arguments for functions that are defined and used internally.
-
void print_nrn_alloc() override
Print nrn_alloc function definition.
+
void print_net_event_call(const ast::FunctionCall &node) override
Print call to net_event.
+
void print_neuron_includes()
Print includes from NEURON.
+
void print_nrn_init(bool skip_init_check=true)
Print the nrn_init function definition.
+
void print_hoc_py_wrapper_function_body(const ast::Block *function_or_procedure_block, InterpreterWrapper wrapper_type)
+
std::string internal_method_arguments() override
Arguments for functions that are defined and used internally.
+
void print_nrn_alloc() override
Print nrn_alloc function definition.
-
std::string register_mechanism_arguments() const override
Arguments for register_mech or point_register_mech function.
-
int position_of_int_var(const std::string &name) const override
Determine the position in the data array for a given int variable.
- -
std::string table_thread_function_name() const
Name of the threaded table checking function.
-
bool optimize_ion_variable_copies() const override
Check if ion variable copies should be avoided.
-
std::string hoc_function_name(const std::string &function_or_procedure_name) const
All functions and procedures need a hoc <func_or_proc_name> to be available to the HOC interpreter.
+
std::string register_mechanism_arguments() const override
Arguments for register_mech or point_register_mech function.
+
int position_of_int_var(const std::string &name) const override
Determine the position in the data array for a given int variable.
+ +
std::string table_thread_function_name() const
Name of the threaded table checking function.
+
bool optimize_ion_variable_copies() const override
Check if ion variable copies should be avoided.
+
std::string hoc_function_name(const std::string &function_or_procedure_name) const
All functions and procedures need a hoc <func_or_proc_name> to be available to the HOC interpreter.
encapsulates code generation backend implementations
Definition: ast_common.hpp:26
-
std::string global_variable_name(const SymbolType &symbol, bool use_instance=true) const override
Determine the variable name for a global variable given its symbol.
-
Represent ions used in mod file.
-
std::string nrn_thread_internal_arguments() override
Arguments for "_threadargs_" macro in neuron implementation.
+
std::string global_variable_name(const SymbolType &symbol, bool use_instance=true) const override
Determine the variable name for a global variable given its symbol.
+
Represent ions used in mod file.
+
std::string nrn_thread_internal_arguments() override
Arguments for "_threadargs_" macro in neuron implementation.
Implement classes for representing symbol table at block and file scope.
-
std::string backend_name() const override
Name of the code generation backend.
-
std::string process_verbatim_text(std::string const &text) override
Process a verbatim block for possible variable renaming.
- -
void print_g_unused() const override
Set g_unused (conductance) for NRN_PRCELLSTATE feature.
-
void visit_watch_statement(const ast::WatchStatement &node) override
TODO: Edit for NEURON.
-
void print_net_send_call(const ast::FunctionCall &node) override
Print call to net_send.
-
void print_namespace_end() override
Print end of namespaces.
-
void print_net_move_call(const ast::FunctionCall &node) override
Print call to net_move.
-
std::string thread_variable_name(const ThreadVariableInfo &var_info, bool use_instance=true) const
Determine the C++ string to print for thread variables.
+
std::string backend_name() const override
Name of the code generation backend.
+
std::string process_verbatim_text(std::string const &text) override
Process a verbatim block for possible variable renaming.
+ +
void print_g_unused() const override
Set g_unused (conductance) for NRN_PRCELLSTATE feature.
+
void visit_watch_statement(const ast::WatchStatement &node) override
TODO: Edit for NEURON.
+
void print_net_send_call(const ast::FunctionCall &node) override
Print call to net_send.
+
void print_namespace_end() override
Print end of namespaces.
+
void print_net_move_call(const ast::FunctionCall &node) override
Print call to net_move.
+
std::string thread_variable_name(const ThreadVariableInfo &var_info, bool use_instance=true) const
Determine the C++ string to print for thread variables.
parser::NmodlParser::symbol_type SymbolType
Definition: nmodl_utils.hpp:26
-
void print_nrn_state() override
Print nrn_state / state update function definition.
-
void print_initial_block(const ast::InitialBlock *node)
Print the initial block.
-
void print_global_function_common_code(BlockType type, const std::string &function_name="") override
Print common code for global functions like nrn_init, nrn_cur and nrn_state.
-
std::string float_variable_name(const SymbolType &symbol, bool use_instance) const override
Determine the name of a float variable given its symbol.
-
void print_function(const ast::FunctionBlock &node) override
Print NMODL function in target backend code.
- -
void print_v_unused() const override
Set v_unused (voltage) for NRN_PRCELLSTATE feature.
- -
ParamVector functor_params() override
The parameters of the Newton solver "functor".
+
void print_nrn_state() override
Print nrn_state / state update function definition.
+
void print_initial_block(const ast::InitialBlock *node)
Print the initial block.
+
void print_global_function_common_code(BlockType type, const std::string &function_name="") override
Print common code for global functions like nrn_init, nrn_cur and nrn_state.
+
std::string float_variable_name(const SymbolType &symbol, bool use_instance) const override
Determine the name of a float variable given its symbol.
+
void print_function(const ast::FunctionBlock &node) override
Print NMODL function in target backend code.
+ +
void print_v_unused() const override
Set v_unused (voltage) for NRN_PRCELLSTATE feature.
+ +
ParamVector functor_params() override
The parameters of the Newton solver "functor".
Visitor for printing C++ code compatible with legacy api of CoreNEURON
Base class for all block scoped nodes.
Definition: block.hpp:41
Represents a INITIAL block in the NMODL.
-
void print_point_process_function_definitions()
Print POINT_PROCESS related functions Wrap external NEURON functions related to POINT_PROCESS mechani...
+
void print_point_process_function_definitions()
Print POINT_PROCESS related functions Wrap external NEURON functions related to POINT_PROCESS mechani...
Represent WATCH statement in NMODL.
-
void print_neuron_global_variable_declarations()
Print extern declarations for neuron global variables.
+
void print_neuron_global_variable_declarations()
Print extern declarations for neuron global variables.
Represents a BREAKPOINT block in NMODL.
-
void print_nrn_cur_conductance_kernel(const ast::BreakpointBlock &node) override
Print the nrn_cur kernel with NMODL conductance keyword provisions.
-
std::string int_variable_name(const IndexVariableInfo &symbol, const std::string &name, bool use_instance) const override
Determine the name of an int variable given its symbol.
+
void print_nrn_cur_conductance_kernel(const ast::BreakpointBlock &node) override
Print the nrn_cur kernel with NMODL conductance keyword provisions.
+
std::string int_variable_name(const IndexVariableInfo &symbol, const std::string &name, bool use_instance) const override
Determine the name of an int variable given its symbol.
InterpreterWrapper
Enum to switch between HOC and Python wrappers for functions and procedures defined in mechanisms.
-
void print_namespace_begin() override
Print start of namespaces.
+
void print_namespace_begin() override
Print start of namespaces.
-
void print_global_variables_for_hoc() override
Print byte arrays that register scalar and vector variables for hoc interface.
-
void print_standard_includes() override
Print standard C/C++ includes.
+
void print_global_variables_for_hoc() override
Print byte arrays that register scalar and vector variables for hoc interface.
+
void print_standard_includes() override
Print standard C/C++ includes.
std::vector< ThreadVariableInfo > codegen_thread_variables
GLOBAL variables in THREADSAFE MOD files that are not read-only are converted to thread variables.
-
void print_mechanism_range_var_structure(bool print_initializers) override
Print the structure that wraps all range and int variables required for the NMODL.
-
void print_procedure(const ast::ProcedureBlock &node) override
Print NMODL procedure in target backend code.
-
void add_variable_tqitem(std::vector< IndexVariableInfo > &variables) override
Add the variable tqitem during get_int_variables.
+
void print_mechanism_range_var_structure(bool print_initializers) override
Print the structure that wraps all range and int variables required for the NMODL.
+
void print_procedure(const ast::ProcedureBlock &node) override
Print NMODL procedure in target backend code.
+
void add_variable_tqitem(std::vector< IndexVariableInfo > &variables) override
Add the variable tqitem during get_int_variables.
Helper class for printing C/C++ code.
-
std::string hoc_function_signature(const std::string &function_or_procedure_name) const
Get the signature of the hoc <func_or_proc_name> function.
-
void print_namespace_start() override
Prints the start of the neuron namespace.
-
void print_thread_variables_structure(bool print_initializers)
Print the data structure used to access thread variables.
-
void print_compute_functions() override
Print all compute functions for every backend.
-
void print_thread_memory_callbacks()
Print thread variable (de-)initialization functions.
-
void print_nrn_cur_kernel(const ast::BreakpointBlock &node) override
Print main body of nrn_cur function.
-
void print_mechanism_register() override
Print the mechanism registration function.
-
void print_nrn_jacob()
Print nrn_jacob function definition.
+
std::string hoc_function_signature(const std::string &function_or_procedure_name) const
Get the signature of the hoc <func_or_proc_name> function.
+
void print_namespace_start() override
Prints the start of the neuron namespace.
+
void print_thread_variables_structure(bool print_initializers)
Print the data structure used to access thread variables.
+
void print_compute_functions() override
Print all compute functions for every backend.
+
void print_thread_memory_callbacks()
Print thread variable (de-)initialization functions.
+
void print_nrn_cur_kernel(const ast::BreakpointBlock &node) override
Print main body of nrn_cur function.
+
void print_mechanism_register() override
Print the mechanism registration function.
+
void print_nrn_jacob()
Print nrn_jacob function definition.
Various types to store code generation specific information.
-
void print_fast_imem_calculation() override
Print fast membrane current calculation code.
-
void print_data_structures(bool print_initializers) override
Print all classes.
-
void print_sdlists_init(bool print_initializers) override
-
const std::string external_method_arguments() noexcept override
Arguments for external functions called from generated code.
-
std::string py_function_name(const std::string &function_or_procedure_name) const
In non POINT_PROCESS mechanisms all functions and procedures need a py <func_or_proc_name> to be avai...
+
void print_fast_imem_calculation() override
Print fast membrane current calculation code.
+
void print_data_structures(bool print_initializers) override
Print all classes.
+
void print_sdlists_init(bool print_initializers) override
+
const std::string external_method_arguments() noexcept override
Arguments for external functions called from generated code.
+
std::string py_function_name(const std::string &function_or_procedure_name) const
In non POINT_PROCESS mechanisms all functions and procedures need a py <func_or_proc_name> to be avai...
size_t offset
The global variables ahead of this one require offset doubles to store.
-
void print_node_data_structure(bool print_initializers)
Print the structure that wraps all node variables required for the NMODL.
+
void print_node_data_structure(bool print_initializers)
Print the structure that wraps all node variables required for the NMODL.
-
void print_make_instance() const
Print make_*_instance.
-
void print_atomic_reduction_pragma() override
Print atomic update pragma for reduction statements.
-
void print_namespace_stop() override
Prints the end of the neuron namespace.
-
void print_setdata_functions()
Print NEURON functions related to setting global variables of the mechanism.
+
void print_make_instance() const
Print make_*_instance.
+
void print_atomic_reduction_pragma() override
Print atomic update pragma for reduction statements.
+
void print_namespace_stop() override
Prints the end of the neuron namespace.
+
void print_setdata_functions()
Print NEURON functions related to setting global variables of the mechanism.
Represents ion write statement during code generation.
-
void print_mechanism_variables_macros()
Print mechanism variables' related macros.
+
void print_mechanism_variables_macros()
Print mechanism variables' related macros.
Visitor for printing C++ code compatible with legacy api of NEURON
-
void print_nrn_constructor() override
Print nrn_constructor function definition.
-
void print_check_table_function_prototypes()
Print all check_* function declarations.
+
void print_nrn_constructor() override
Print nrn_constructor function definition.
+
void print_check_table_function_prototypes()
Print all check_* function declarations.
Implement logger based on spdlog library.
BlockType
Helper to represent various block types.
size_t index
There index global variables ahead of this one.
-
void print_headers_include() override
Print all includes.
-
const ParamVector external_method_parameters(bool table=false) noexcept override
Parameters for functions in generated code that are called back from external code.
-
void print_function_or_procedure(const ast::Block &node, const std::string &name, const std::unordered_set< CppObjectSpecifier > &specifiers={ CppObjectSpecifier::Inline}) override
Print nmodl function or procedure (common code)
+
void print_headers_include() override
Print all includes.
+
const ParamVector external_method_parameters(bool table=false) noexcept override
Parameters for functions in generated code that are called back from external code.
+
void print_function_or_procedure(const ast::Block &node, const std::string &name, const std::unordered_set< CppObjectSpecifier > &specifiers={ CppObjectSpecifier::Inline}) override
Print nmodl function or procedure (common code)
const std::shared_ptr< symtab::Symbol > symbol
-
void print_nrn_current(const ast::BreakpointBlock &node) override
Print the nrn_current kernel.
-
int position_of_float_var(const std::string &name) const override
Determine the position in the data array for a given float variable.
-
std::string get_variable_name(const std::string &name, bool use_instance=true) const override
Determine variable name in the structure of mechanism properties.
+
void print_nrn_current(const ast::BreakpointBlock &node) override
Print the nrn_current kernel.
+
int position_of_float_var(const std::string &name) const override
Determine the position in the data array for a given float variable.
+
std::string get_variable_name(const std::string &name, bool use_instance=true) const override
Determine variable name in the structure of mechanism properties.
Visitor for printing C++ code compatible with legacy api of CoreNEURON
-
void print_make_node_data() const
Print make_*_node_data.
-
std::string simulator_name() override
Name of the simulator the code was generated for.
-
void print_function_procedure_helper(const ast::Block &node) override
Common helper function to help printing function or procedure blocks.
-
void add_variable_point_process(std::vector< IndexVariableInfo > &variables) override
Add the variable point_process during get_int_variables.
-
std::string nrn_thread_arguments() const override
Arguments for "_threadargs_" macro in neuron implementation.
+
void print_make_node_data() const
Print make_*_node_data.
+
std::string simulator_name() override
Name of the simulator the code was generated for.
+
void print_function_procedure_helper(const ast::Block &node) override
Common helper function to help printing function or procedure blocks.
+
void add_variable_point_process(std::vector< IndexVariableInfo > &variables) override
Add the variable point_process during get_int_variables.
+
std::string nrn_thread_arguments() const override
Arguments for "_threadargs_" macro in neuron implementation.
void print_net_receive_registration()
Print code to register the call-back for the NET_RECEIVE block.
-
void print_codegen_routines() override
Print entry point to code generation.
-
void append_conc_write_statements(std::vector< ShadowUseStatement > &statements, const Ion &ion, const std::string &concentration) override
Generate Function call statement for nrn_wrote_conc.
-
ParamVector internal_method_parameters() override
Parameters for internally defined functions.
-
void print_net_receive()
Print net_receive call-back.
-
void print_function_prototypes() override
Print function and procedures prototype declaration.
-
void print_mechanism_global_var_structure(bool print_initializers) override
Print the structure that wraps all global variables used in the NMODL.
-
void print_global_macros()
Print NEURON global variable macros.
+
void print_codegen_routines() override
Print entry point to code generation.
+
void append_conc_write_statements(std::vector< ShadowUseStatement > &statements, const Ion &ion, const std::string &concentration) override
Generate Function call statement for nrn_wrote_conc.
+
ParamVector internal_method_parameters() override
Parameters for internally defined functions.
+
void print_net_receive()
Print net_receive call-back.
+
void print_function_prototypes() override
Print function and procedures prototype declaration.
+
void print_mechanism_global_var_structure(bool print_initializers) override
Print the structure that wraps all global variables used in the NMODL.
+
void print_global_macros()
Print NEURON global variable macros.
std::vector< std::tuple< std::string, std::string, std::string, std::string > > ParamVector
A vector of parameters represented by a 4-tuple of strings:
Concrete visitor for all AST classes.
diff --git a/doxygen/functions_func_t.html b/doxygen/functions_func_t.html index b8faeb482..96e4311ca 100644 --- a/doxygen/functions_func_t.html +++ b/doxygen/functions_func_t.html @@ -93,12 +93,12 @@  

- t -

    -
  • table_function_prefix() -: nmodl::codegen::CodegenCppVisitor -
  • table_thread_function_name() : nmodl::codegen::CodegenNeuronCppVisitor
  • +
  • table_update_function_name() +: nmodl::codegen::CodegenCppVisitor +
  • TableStatement() : nmodl::ast::TableStatement
  • diff --git a/doxygen/functions_s.html b/doxygen/functions_s.html index 364d483c9..91693afc9 100644 --- a/doxygen/functions_s.html +++ b/doxygen/functions_s.html @@ -1038,7 +1038,7 @@

    - s -

      , nmodl::codegen::ThreadVariableInfo
    • Symbol() -: nmodl::symtab::Symbol +: nmodl::symtab::Symbol
    • symbol_count() : nmodl::symtab::SymbolTable diff --git a/doxygen/functions_t.html b/doxygen/functions_t.html index 91a66fcb3..df660ea1d 100644 --- a/doxygen/functions_t.html +++ b/doxygen/functions_t.html @@ -104,9 +104,6 @@

      - t -

      • table_count : nmodl::codegen::CodegenInfo
      • -
      • table_function_prefix() -: nmodl::codegen::CodegenCppVisitor -
      • table_statement_used : nmodl::codegen::CodegenHelperVisitor
      • @@ -116,6 +113,9 @@

        - t -

        • table_thread_function_name() : nmodl::codegen::CodegenNeuronCppVisitor
        • +
        • table_update_function_name() +: nmodl::codegen::CodegenCppVisitor +
        • table_vars : nmodl::ast::TableStatement
        • diff --git a/doxygen/functions_v.html b/doxygen/functions_v.html index 2c57c7035..22bb172c9 100644 --- a/doxygen/functions_v.html +++ b/doxygen/functions_v.html @@ -100,7 +100,10 @@

          - v -

            : nmodl::ast::Useion
          • Valence() -: nmodl::ast::Valence +: nmodl::ast::Valence +
          • +
          • valence +: nmodl::codegen::Ion
          • value : nmodl::ast::BABlockType @@ -416,7 +419,7 @@

            - v -

              , nmodl::ast::BlockComment , nmodl::ast::Boolean , nmodl::ast::BreakpointBlock -, nmodl::ast::Compartment +, nmodl::ast::Compartment , nmodl::ast::ConductanceHint , nmodl::ast::Conserve , nmodl::ast::ConstantBlock diff --git a/doxygen/functions_vars_v.html b/doxygen/functions_vars_v.html index e15a80557..88011597e 100644 --- a/doxygen/functions_vars_v.html +++ b/doxygen/functions_vars_v.html @@ -98,6 +98,7 @@

              - v -

              • valence : nmodl::ast::Useion +, nmodl::codegen::Ion
              • value : nmodl::ast::BABlockType diff --git a/doxygen/group__codegen__backends.html b/doxygen/group__codegen__backends.html index 127ba6c22..91ecc1f03 100644 --- a/doxygen/group__codegen__backends.html +++ b/doxygen/group__codegen__backends.html @@ -186,7 +186,7 @@

                Definition at line 1507 of file codegen_cpp_visitor.hpp.

                +

                Definition at line 1509 of file codegen_cpp_visitor.hpp.

                @@ -249,7 +249,7 @@

                Definition at line 1487 of file codegen_cpp_visitor.hpp.

                +

                Definition at line 1489 of file codegen_cpp_visitor.hpp.

                diff --git a/doxygen/group__codegen__backends.js b/doxygen/group__codegen__backends.js index e9b491f0f..d60da792b 100644 --- a/doxygen/group__codegen__backends.js +++ b/doxygen/group__codegen__backends.js @@ -311,7 +311,7 @@ var group__codegen__backends = [ "setup", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ae333398890c61148ec60cb52c3d28c10", null ], [ "simulator_name", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a8b8b75dcd53ae8e3a641f18cb00bee1d", null ], [ "statement_to_skip", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a789dae2310c3496443a8a51c26cc8b71", null ], - [ "table_function_prefix", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ab516d94c30f043b502152544cde2d563", null ], + [ "table_update_function_name", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a93358fcb6712a4ac8c1565529821b340", null ], [ "thread_variables_struct", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a1c3e5aa67b1f486463340b8102b95e81", null ], [ "update_if_ion_variable_name", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aba3a9521ace5f09f4d2263e4401b33ee", null ], [ "update_index_semantics", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ae0d8d4e346e244c764911c0c64c2ac1c", null ], diff --git a/doxygen/group__codegen__details.js b/doxygen/group__codegen__details.js index 2b400960c..6ab6f9ead 100644 --- a/doxygen/group__codegen__details.js +++ b/doxygen/group__codegen__details.js @@ -106,6 +106,7 @@ var group__codegen__details = [ "name", "structnmodl_1_1codegen_1_1_ion.html#a1ef3560064c6ec5b850f6e9f2b345190", null ], [ "need_style", "structnmodl_1_1codegen_1_1_ion.html#a5fef7a697395c4ccf380fed9a7fff241", null ], [ "reads", "structnmodl_1_1codegen_1_1_ion.html#ad3b1eb176f8e00671fb36cc625ad0f49", null ], + [ "valence", "structnmodl_1_1codegen_1_1_ion.html#ab464eca5bf873be2df1ea2aaea2f0533", null ], [ "writes", "structnmodl_1_1codegen_1_1_ion.html#ae116633adc4f16ce78feae5b4d2f8a12", null ] ] ], [ "IndexSemantics", "structnmodl_1_1codegen_1_1_index_semantics.html", [ diff --git a/doxygen/namespacenmodl_1_1codegen.html b/doxygen/namespacenmodl_1_1codegen.html index 47f78c71c..7e60a72f5 100644 --- a/doxygen/namespacenmodl_1_1codegen.html +++ b/doxygen/namespacenmodl_1_1codegen.html @@ -315,7 +315,7 @@

                x[id] = _args[1];

                So, the R in AST needs to be renamed with _args[1].

                -

                Definition at line 2195 of file codegen_neuron_cpp_visitor.cpp.

                +

                Definition at line 2187 of file codegen_neuron_cpp_visitor.cpp.

                diff --git a/doxygen/navtreedata.js b/doxygen/navtreedata.js index 1fa9545ec..86d14f3dc 100644 --- a/doxygen/navtreedata.js +++ b/doxygen/navtreedata.js @@ -96,8 +96,8 @@ var NAVTREEINDEX = "model_8hpp.html", "pyembed_8cpp_source.html", "structnmodl_1_1codegen_1_1_codegen_info.html#af61629cf3b042744e0ae3655e807e52a", -"symbol__properties_8hpp.html#ad9b6b8559b36d0a500ef5110badcc4dbacb2f7556254f071fb944800a31272b6b", -"verbatim__visitor_8hpp.html" +"symbol__properties_8hpp.html#ad9b6b8559b36d0a500ef5110badcc4dbacb1e09d4f29a44bf586491796c2373e5", +"verbatim__visitor_8cpp_source.html" ]; var SYNCONMSG = 'click to disable panel synchronisation'; diff --git a/doxygen/navtreeindex16.js b/doxygen/navtreeindex16.js index f17297580..2eef87e1e 100644 --- a/doxygen/navtreeindex16.js +++ b/doxygen/navtreeindex16.js @@ -36,6 +36,7 @@ var NAVTREEINDEX16 = "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a913c33933a32feca0f0389cee637a293":[0,1,0,3,20], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a91fdec443327720111f0b8ecad783c87":[0,1,0,3,106], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a92bfb8a4daec705014f8e871fb0feacb":[0,1,0,3,69], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a93358fcb6712a4ac8c1565529821b340":[0,1,0,3,130], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a93592e117e3283a0b2e0a5aa647bc155":[0,1,0,3,105], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a936ed1973fb19388fd20fa09f0f9d8bb":[0,1,0,3,136], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a946c6fc559c23573210285ed47e28570":[0,1,0,3,155], @@ -57,7 +58,6 @@ var NAVTREEINDEX16 = "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aada5b6eeb7fd6f21a4ce2c68da1e2994":[0,1,0,3,9], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aadbceff0e1e871a3b7fb3730faf07f3e":[0,1,0,3,87], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aaf72cbf7288677fa045647df13322804":[0,1,0,3,108], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ab516d94c30f043b502152544cde2d563":[0,1,0,3,130], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ab58b5680bc2f8e2e0fb8f693c5c1d8e4":[0,1,0,3,3], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ab6dee6fac7e1fe99df8101f225c06cda":[0,1,0,3,46], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ab89f79a9fc8322d65051575bfb102904":[0,1,0,3,17], diff --git a/doxygen/navtreeindex26.js b/doxygen/navtreeindex26.js index 43302ee6c..c8a124b50 100644 --- a/doxygen/navtreeindex26.js +++ b/doxygen/navtreeindex26.js @@ -31,8 +31,8 @@ var NAVTREEINDEX26 = "functions_e.html":[2,3,0,4], "functions_enum.html":[2,3,4], "functions_f.html":[2,3,0,5], -"functions_func.html":[2,3,1,0], "functions_func.html":[2,3,1], +"functions_func.html":[2,3,1,0], "functions_func_b.html":[2,3,1,1], "functions_func_c.html":[2,3,1,2], "functions_func_d.html":[2,3,1,3], @@ -72,8 +72,8 @@ var NAVTREEINDEX26 = "functions_type.html":[2,3,3], "functions_u.html":[2,3,0,19], "functions_v.html":[2,3,0,20], -"functions_vars.html":[2,3,2], "functions_vars.html":[2,3,2,0], +"functions_vars.html":[2,3,2], "functions_vars_b.html":[2,3,2,1], "functions_vars_c.html":[2,3,2,2], "functions_vars_d.html":[2,3,2,3], @@ -108,8 +108,8 @@ var NAVTREEINDEX26 = "global__var__visitor_8cpp_source.html":[3,0,1,11,8], "global__var__visitor_8hpp.html":[3,0,1,11,9], "global__var__visitor_8hpp_source.html":[3,0,1,11,9], -"globals.html":[3,1,0], "globals.html":[3,1,0,0], +"globals.html":[3,1,0], "globals_b.html":[3,1,0,1], "globals_c.html":[3,1,0,2], "globals_d.html":[3,1,0,3], @@ -136,8 +136,8 @@ var NAVTREEINDEX26 = "group__ast__class.html#ga02bcc1d4e04171fbf1fcccaf39bc0ed2":[0,0,1,257], "group__ast__class.html#ga05e0889bf71fb5b456293ae784a4830c":[0,0,1,4,36], "group__ast__class.html#ga05e0889bf71fb5b456293ae784a4830c":[0,0,1,158], -"group__ast__class.html#ga05f32148d8554d6bc8781950f0b85ac7":[0,0,1,4,58], "group__ast__class.html#ga05f32148d8554d6bc8781950f0b85ac7":[0,0,1,180], +"group__ast__class.html#ga05f32148d8554d6bc8781950f0b85ac7":[0,0,1,4,58], "group__ast__class.html#ga079817547a0614589146a2be9b03a3bb":[0,0,1,4,133], "group__ast__class.html#ga079817547a0614589146a2be9b03a3bb":[0,0,1,255], "group__ast__class.html#ga0881593dfbe4aaeabdadce8288f37bf6":[0,0,1,4,136], @@ -152,8 +152,8 @@ var NAVTREEINDEX26 = "group__ast__class.html#ga0d48ad506faa8de6dca6d5182c7d7352":[0,0,1,4,120], "group__ast__class.html#ga0e489400312bdda6525ce3b9c1a15278":[0,0,1,4,5], "group__ast__class.html#ga0e489400312bdda6525ce3b9c1a15278":[0,0,1,127], -"group__ast__class.html#ga0eb03b97fd845ed86649d29e0952f571":[0,0,1,212], "group__ast__class.html#ga0eb03b97fd845ed86649d29e0952f571":[0,0,1,4,90], +"group__ast__class.html#ga0eb03b97fd845ed86649d29e0952f571":[0,0,1,212], "group__ast__class.html#ga0f2057e5ee6d098bea109648bcc226bd":[0,0,1,4,128], "group__ast__class.html#ga0f2057e5ee6d098bea109648bcc226bd":[0,0,1,250], "group__ast__class.html#ga11d5227fc22968f004fcaf055b2e7cb0":[0,0,1,215], @@ -164,8 +164,8 @@ var NAVTREEINDEX26 = "group__ast__class.html#ga15183feacb4e7aa62fbe7e1371b33620":[0,0,1,197], "group__ast__class.html#ga153cbb003a93974756d7842f01679902":[0,0,1,4,11], "group__ast__class.html#ga153cbb003a93974756d7842f01679902":[0,0,1,133], -"group__ast__class.html#ga171f5d1d942dd88351be072191077e47":[0,0,1,4,106], "group__ast__class.html#ga171f5d1d942dd88351be072191077e47":[0,0,1,228], +"group__ast__class.html#ga171f5d1d942dd88351be072191077e47":[0,0,1,4,106], "group__ast__class.html#ga1769502899ac4dcbfe36a7f340edcd02":[0,0,1,4,129], "group__ast__class.html#ga1769502899ac4dcbfe36a7f340edcd02":[0,0,1,251], "group__ast__class.html#ga17c42e3c60a25fe417647c5937b682c9":[0,0,1,4,15], @@ -174,22 +174,22 @@ var NAVTREEINDEX26 = "group__ast__class.html#ga1a3804b66c6c3c0e23fe0b08c9ce229e":[0,0,1,254], "group__ast__class.html#ga1a627463ee876f902fb2baa0775ec966":[0,0,1,4,32], "group__ast__class.html#ga1a627463ee876f902fb2baa0775ec966":[0,0,1,154], -"group__ast__class.html#ga1b5521cd31ec4d26c0ec8a039bf7a9c9":[0,0,1,157], "group__ast__class.html#ga1b5521cd31ec4d26c0ec8a039bf7a9c9":[0,0,1,4,35], -"group__ast__class.html#ga1f324c705485dbbeffcee8401aa1d097":[0,0,1,235], +"group__ast__class.html#ga1b5521cd31ec4d26c0ec8a039bf7a9c9":[0,0,1,157], "group__ast__class.html#ga1f324c705485dbbeffcee8401aa1d097":[0,0,1,4,113], -"group__ast__class.html#ga20fd0174b3cb40617279a34dc49d7d67":[0,0,1,4,118], +"group__ast__class.html#ga1f324c705485dbbeffcee8401aa1d097":[0,0,1,235], "group__ast__class.html#ga20fd0174b3cb40617279a34dc49d7d67":[0,0,1,240], -"group__ast__class.html#ga259f83364b843c691a85687f247244e7":[0,0,1,186], +"group__ast__class.html#ga20fd0174b3cb40617279a34dc49d7d67":[0,0,1,4,118], "group__ast__class.html#ga259f83364b843c691a85687f247244e7":[0,0,1,4,64], +"group__ast__class.html#ga259f83364b843c691a85687f247244e7":[0,0,1,186], "group__ast__class.html#ga26205d58d3a56e11a1af97124b07a68e":[0,0,1,204], "group__ast__class.html#ga26205d58d3a56e11a1af97124b07a68e":[0,0,1,4,82], "group__ast__class.html#ga2a8ed6832a20d3b6e5b400b6cb772ca8":[0,0,1,4,109], "group__ast__class.html#ga2a8ed6832a20d3b6e5b400b6cb772ca8":[0,0,1,231], "group__ast__class.html#ga2a96d8e7cc4dd454135b86ffd4c456e7":[0,0,1,4,122], "group__ast__class.html#ga2a96d8e7cc4dd454135b86ffd4c456e7":[0,0,1,244], -"group__ast__class.html#ga2ab319dfd9eaa87327dfb00c2c006b5f":[0,0,1,217], "group__ast__class.html#ga2ab319dfd9eaa87327dfb00c2c006b5f":[0,0,1,4,95], +"group__ast__class.html#ga2ab319dfd9eaa87327dfb00c2c006b5f":[0,0,1,217], "group__ast__class.html#ga2d617bed8d16f6e386c7994fe14e1dcb":[0,0,1,175], "group__ast__class.html#ga2d617bed8d16f6e386c7994fe14e1dcb":[0,0,1,4,53], "group__ast__class.html#ga2eec2446794afeca55a7dbc822fd99ba":[0,0,1,4,69], @@ -204,8 +204,8 @@ var NAVTREEINDEX26 = "group__ast__class.html#ga3e1362838ed4cc6d1ab04e6a9fc86bf2":[0,0,1,230], "group__ast__class.html#ga3f92f72529d03053ab51c41b38a29897":[0,0,1,4,71], "group__ast__class.html#ga3f92f72529d03053ab51c41b38a29897":[0,0,1,193], -"group__ast__class.html#ga4303bc795f23f0909cd1ac655c098ed4":[0,0,1,141], "group__ast__class.html#ga4303bc795f23f0909cd1ac655c098ed4":[0,0,1,4,19], +"group__ast__class.html#ga4303bc795f23f0909cd1ac655c098ed4":[0,0,1,141], "group__ast__class.html#ga4892777c5b32b112d588b05d07f28549":[0,0,1,4,14], "group__ast__class.html#ga4892777c5b32b112d588b05d07f28549":[0,0,1,136], "group__ast__class.html#ga4ac0e01057626ba84f0511ea12370956":[0,0,1,4,40], @@ -216,10 +216,10 @@ var NAVTREEINDEX26 = "group__ast__class.html#ga4efd89b3e621b205a36fb120b62b954b":[0,0,1,245], "group__ast__class.html#ga507524f2adabb5ace4f6943b0708448e":[0,0,1,4,84], "group__ast__class.html#ga507524f2adabb5ace4f6943b0708448e":[0,0,1,206], -"group__ast__class.html#ga5315152cdb0f8c1dcc759cdb1baef2e0":[0,0,1,4,131], "group__ast__class.html#ga5315152cdb0f8c1dcc759cdb1baef2e0":[0,0,1,253], -"group__ast__class.html#ga53d7bf2c18bac0edb78e1123e947988e":[0,0,1,222], +"group__ast__class.html#ga5315152cdb0f8c1dcc759cdb1baef2e0":[0,0,1,4,131], "group__ast__class.html#ga53d7bf2c18bac0edb78e1123e947988e":[0,0,1,4,100], +"group__ast__class.html#ga53d7bf2c18bac0edb78e1123e947988e":[0,0,1,222], "group__ast__class.html#ga55e9704837cf41c797642b1f7c102dfc":[0,0,1,4,0], "group__ast__class.html#ga55e9704837cf41c797642b1f7c102dfc":[0,0,1,125], "group__ast__class.html#ga571f5c2475e8e6fbfd898f82e710960a":[0,0,1,4,39], @@ -228,26 +228,26 @@ var NAVTREEINDEX26 = "group__ast__class.html#ga5b2f7b1f3e25a7d8f70d21368f7c4bcc":[0,0,1,129], "group__ast__class.html#ga5bbb1d563621926d689f8480d243d909":[0,0,1,4,4], "group__ast__class.html#ga5bbb1d563621926d689f8480d243d909":[0,0,1,126], -"group__ast__class.html#ga5eed5c6969860fdf373a7b23dcf0653b":[0,0,1,190], "group__ast__class.html#ga5eed5c6969860fdf373a7b23dcf0653b":[0,0,1,4,68], +"group__ast__class.html#ga5eed5c6969860fdf373a7b23dcf0653b":[0,0,1,190], "group__ast__class.html#ga6105e91f1ce07693b9df1e0162d8f5a4":[0,0,1,4,134], "group__ast__class.html#ga6105e91f1ce07693b9df1e0162d8f5a4":[0,0,1,256], "group__ast__class.html#ga630659747411ec7b03685256c92dab8f":[0,0,1,226], "group__ast__class.html#ga630659747411ec7b03685256c92dab8f":[0,0,1,4,104], -"group__ast__class.html#ga63717e8a77ff61eb334fd3389a3c354b":[0,0,1,4,107], "group__ast__class.html#ga63717e8a77ff61eb334fd3389a3c354b":[0,0,1,229], -"group__ast__class.html#ga656b6af0e85f80cdaa43212b01108b42":[0,0,1,135], +"group__ast__class.html#ga63717e8a77ff61eb334fd3389a3c354b":[0,0,1,4,107], "group__ast__class.html#ga656b6af0e85f80cdaa43212b01108b42":[0,0,1,4,13], +"group__ast__class.html#ga656b6af0e85f80cdaa43212b01108b42":[0,0,1,135], "group__ast__class.html#ga684e856f3a95a7ec25941fdf5ebf53e3":[0,0,1,4,12], "group__ast__class.html#ga684e856f3a95a7ec25941fdf5ebf53e3":[0,0,1,134], "group__ast__class.html#ga693ff03c7dd81449e7b42ee2efa51c17":[0,0,1,176], "group__ast__class.html#ga693ff03c7dd81449e7b42ee2efa51c17":[0,0,1,4,54], "group__ast__class.html#ga6a8e5076ce68736223774b02972fdfa8":[0,0,1,4,28], "group__ast__class.html#ga6a8e5076ce68736223774b02972fdfa8":[0,0,1,150], -"group__ast__class.html#ga6b742ca0ae8a6ed172f258af20a33cf7":[0,0,1,214], "group__ast__class.html#ga6b742ca0ae8a6ed172f258af20a33cf7":[0,0,1,4,92], +"group__ast__class.html#ga6b742ca0ae8a6ed172f258af20a33cf7":[0,0,1,214], "group__ast__class.html#ga6ca54bc2ec0698aa5a485be7c653781d":[0,0,1,4,141], "group__ast__class.html#ga6ca54bc2ec0698aa5a485be7c653781d":[0,0,1,263], -"group__ast__class.html#ga6d8c02bfb7a35cf3ac7858e61f24bf00":[0,0,1,4,46], -"group__ast__class.html#ga6d8c02bfb7a35cf3ac7858e61f24bf00":[0,0,1,168] +"group__ast__class.html#ga6d8c02bfb7a35cf3ac7858e61f24bf00":[0,0,1,168], +"group__ast__class.html#ga6d8c02bfb7a35cf3ac7858e61f24bf00":[0,0,1,4,46] }; diff --git a/doxygen/navtreeindex27.js b/doxygen/navtreeindex27.js index 0f684732f..ea32e837c 100644 --- a/doxygen/navtreeindex27.js +++ b/doxygen/navtreeindex27.js @@ -1,23 +1,23 @@ var NAVTREEINDEX27 = { -"group__ast__class.html#ga6eadddbece7bcde0e0198e61b707d4c4":[0,0,1,4,119], "group__ast__class.html#ga6eadddbece7bcde0e0198e61b707d4c4":[0,0,1,241], +"group__ast__class.html#ga6eadddbece7bcde0e0198e61b707d4c4":[0,0,1,4,119], "group__ast__class.html#ga738d9e9a7e344c5086e37cffc4be1d2f":[0,0,1,220], "group__ast__class.html#ga738d9e9a7e344c5086e37cffc4be1d2f":[0,0,1,4,98], "group__ast__class.html#ga7955eda5565d690e7acfaead092c56aa":[0,0,1,4,3], "group__ast__class.html#ga7955eda5565d690e7acfaead092c56aa":[0,0,1,124], -"group__ast__class.html#ga7bb648c89549d0a1440c348da8db48cd":[0,0,1,4,78], "group__ast__class.html#ga7bb648c89549d0a1440c348da8db48cd":[0,0,1,200], +"group__ast__class.html#ga7bb648c89549d0a1440c348da8db48cd":[0,0,1,4,78], "group__ast__class.html#ga7f8b85b161e9540da809bccbf8b667d0":[0,0,1,4,114], "group__ast__class.html#ga7f8b85b161e9540da809bccbf8b667d0":[0,0,1,236], -"group__ast__class.html#ga8805d1aa088c3daac32ec6f4313cf060":[0,0,1,239], "group__ast__class.html#ga8805d1aa088c3daac32ec6f4313cf060":[0,0,1,4,117], +"group__ast__class.html#ga8805d1aa088c3daac32ec6f4313cf060":[0,0,1,239], "group__ast__class.html#ga894e17b916a5edfde8e6b624e9085ae1":[0,0,1,4,85], "group__ast__class.html#ga894e17b916a5edfde8e6b624e9085ae1":[0,0,1,207], "group__ast__class.html#ga89dc3a73bef71b1d9dd6f379e4ca7801":[0,0,1,221], "group__ast__class.html#ga89dc3a73bef71b1d9dd6f379e4ca7801":[0,0,1,4,99], -"group__ast__class.html#ga8a32b8ca9796d4c6ff51fd651c1e410a":[0,0,1,4,115], "group__ast__class.html#ga8a32b8ca9796d4c6ff51fd651c1e410a":[0,0,1,237], +"group__ast__class.html#ga8a32b8ca9796d4c6ff51fd651c1e410a":[0,0,1,4,115], "group__ast__class.html#ga8ae7b3772077532d180c376c149ca59b":[0,0,1,4,137], "group__ast__class.html#ga8ae7b3772077532d180c376c149ca59b":[0,0,1,259], "group__ast__class.html#ga8b7765bb1b32cac9e1d3cef796b747ac":[0,0,1,4,138], @@ -44,8 +44,8 @@ var NAVTREEINDEX27 = "group__ast__class.html#gaa55f3ea9308348d5140290e34c4b06dd":[0,0,1,209], "group__ast__class.html#gaa680ed2587655b4f6b771db6584b22cc":[0,0,1,196], "group__ast__class.html#gaa680ed2587655b4f6b771db6584b22cc":[0,0,1,4,74], -"group__ast__class.html#gaa7d7dc200bbee1fe9619323965a1715e":[0,0,1,188], "group__ast__class.html#gaa7d7dc200bbee1fe9619323965a1715e":[0,0,1,4,66], +"group__ast__class.html#gaa7d7dc200bbee1fe9619323965a1715e":[0,0,1,188], "group__ast__class.html#gaa7e0498bd12a174ddff55d9f4987c0b6":[0,0,1,218], "group__ast__class.html#gaa7e0498bd12a174ddff55d9f4987c0b6":[0,0,1,4,96], "group__ast__class.html#gaa892d22eb06997da03dc7a433f14ba1e":[0,0,1,4,125], @@ -58,16 +58,16 @@ var NAVTREEINDEX27 = "group__ast__class.html#gaac556bedee72f6f87391147af12cfb14":[0,0,1,264], "group__ast__class.html#gaad130e3dba2180cd1f12d7e3925f6802":[0,0,1,198], "group__ast__class.html#gaad130e3dba2180cd1f12d7e3925f6802":[0,0,1,4,76], -"group__ast__class.html#gaade2043ac7883b4d0873b473042f930d":[0,0,1,238], "group__ast__class.html#gaade2043ac7883b4d0873b473042f930d":[0,0,1,4,116], +"group__ast__class.html#gaade2043ac7883b4d0873b473042f930d":[0,0,1,238], "group__ast__class.html#gaafdc39f0529d0879f741f525181bb756":[0,0,1,4,26], "group__ast__class.html#gaafdc39f0529d0879f741f525181bb756":[0,0,1,148], -"group__ast__class.html#gaafe0391f61c4d985226cf91abf6d0ea6":[0,0,1,183], "group__ast__class.html#gaafe0391f61c4d985226cf91abf6d0ea6":[0,0,1,4,61], -"group__ast__class.html#gab0ca0546b6c94aa502549453ff611811":[0,0,1,195], +"group__ast__class.html#gaafe0391f61c4d985226cf91abf6d0ea6":[0,0,1,183], "group__ast__class.html#gab0ca0546b6c94aa502549453ff611811":[0,0,1,4,73], -"group__ast__class.html#gab2ab7390c9aa9a581525ec7b2a8ddb64":[0,0,1,210], +"group__ast__class.html#gab0ca0546b6c94aa502549453ff611811":[0,0,1,195], "group__ast__class.html#gab2ab7390c9aa9a581525ec7b2a8ddb64":[0,0,1,4,88], +"group__ast__class.html#gab2ab7390c9aa9a581525ec7b2a8ddb64":[0,0,1,210], "group__ast__class.html#gab2f01c121a37f709051e291fed2cc6e1":[0,0,1,187], "group__ast__class.html#gab2f01c121a37f709051e291fed2cc6e1":[0,0,1,4,65], "group__ast__class.html#gab35a10b4c8f5ca2515f0bb122853e447":[0,0,1,4,38], @@ -94,8 +94,8 @@ var NAVTREEINDEX27 = "group__ast__class.html#gac38a02afaac3a75f0c66f0d351bf9c04":[0,0,1,4,50], "group__ast__class.html#gac58c77a74f980986b6588a285c12d408":[0,0,1,185], "group__ast__class.html#gac58c77a74f980986b6588a285c12d408":[0,0,1,4,63], -"group__ast__class.html#gac59852558ed3eaf48643738b5a00f1ad":[0,0,1,4,111], "group__ast__class.html#gac59852558ed3eaf48643738b5a00f1ad":[0,0,1,233], +"group__ast__class.html#gac59852558ed3eaf48643738b5a00f1ad":[0,0,1,4,111], "group__ast__class.html#gac6117017139fe43441831581205b087b":[0,0,1,123], "group__ast__class.html#gac6117017139fe43441831581205b087b":[0,0,1,4,2], "group__ast__class.html#gac774fd9ccb62cfdba927225ef59a4de3":[0,0,1,225], @@ -118,32 +118,32 @@ var NAVTREEINDEX27 = "group__ast__class.html#gacf97186289f358ea51959f4285f870cb":[0,0,1,169], "group__ast__class.html#gad0fc98ce521337690e9715bbc8e52848":[0,0,1,4,79], "group__ast__class.html#gad0fc98ce521337690e9715bbc8e52848":[0,0,1,201], -"group__ast__class.html#gad1f90104022d3c27fc1111d3d75a7057":[0,0,1,189], "group__ast__class.html#gad1f90104022d3c27fc1111d3d75a7057":[0,0,1,4,67], +"group__ast__class.html#gad1f90104022d3c27fc1111d3d75a7057":[0,0,1,189], "group__ast__class.html#gad3aeaf59438aab6d10b5b6eca24ee7b2":[0,0,1,152], "group__ast__class.html#gad3aeaf59438aab6d10b5b6eca24ee7b2":[0,0,1,4,30], "group__ast__class.html#gad7bcccf631ed5bf00705df5d1c0e5669":[0,0,1,194], "group__ast__class.html#gad7bcccf631ed5bf00705df5d1c0e5669":[0,0,1,4,72], -"group__ast__class.html#gad7e9018d9c607b42fcec41da33ef7ffc":[0,0,1,4,17], "group__ast__class.html#gad7e9018d9c607b42fcec41da33ef7ffc":[0,0,1,139], +"group__ast__class.html#gad7e9018d9c607b42fcec41da33ef7ffc":[0,0,1,4,17], "group__ast__class.html#gad9186bccf4349f4dc1b42448422151a5":[0,0,1,266], "group__ast__class.html#gad9186bccf4349f4dc1b42448422151a5":[0,0,1,4,1], "group__ast__class.html#gad920434f140f771242aed6060526a3ba":[0,0,1,4,24], "group__ast__class.html#gad920434f140f771242aed6060526a3ba":[0,0,1,146], "group__ast__class.html#gad920ec3fd8147522e85d67bfacb8ebdd":[0,0,1,159], "group__ast__class.html#gad920ec3fd8147522e85d67bfacb8ebdd":[0,0,1,4,37], -"group__ast__class.html#gada2c56cc8f8f252d8ebed343eb863985":[0,0,1,262], "group__ast__class.html#gada2c56cc8f8f252d8ebed343eb863985":[0,0,1,4,140], +"group__ast__class.html#gada2c56cc8f8f252d8ebed343eb863985":[0,0,1,262], "group__ast__class.html#gadaf9e897c21c83aa9fd6984a839aeaf1":[0,0,1,216], "group__ast__class.html#gadaf9e897c21c83aa9fd6984a839aeaf1":[0,0,1,4,94], "group__ast__class.html#gade58bfc61f86b2713d50b523aee0c92f":[0,0,1,181], "group__ast__class.html#gade58bfc61f86b2713d50b523aee0c92f":[0,0,1,4,59], -"group__ast__class.html#gae0579e9d3a6f697fcd4ab022eba3ed6d":[0,0,1,4,101], "group__ast__class.html#gae0579e9d3a6f697fcd4ab022eba3ed6d":[0,0,1,223], +"group__ast__class.html#gae0579e9d3a6f697fcd4ab022eba3ed6d":[0,0,1,4,101], "group__ast__class.html#gae12e18a06af2fd43a83356f1cd75b66d":[0,0,1,4,81], "group__ast__class.html#gae12e18a06af2fd43a83356f1cd75b66d":[0,0,1,203], -"group__ast__class.html#gae136e55afd10a9c0a4f7de0134ab4593":[0,0,1,4,77], "group__ast__class.html#gae136e55afd10a9c0a4f7de0134ab4593":[0,0,1,199], +"group__ast__class.html#gae136e55afd10a9c0a4f7de0134ab4593":[0,0,1,4,77], "group__ast__class.html#gae1ca73bd18179c2c3a1c3a2751043437":[0,0,1,4,130], "group__ast__class.html#gae1ca73bd18179c2c3a1c3a2751043437":[0,0,1,252], "group__ast__class.html#gae2d80677a97c3b1ac8690d73c74be890":[0,0,1,4,57], @@ -156,8 +156,8 @@ var NAVTREEINDEX27 = "group__ast__class.html#gae8ed322d9d79b71a4dd96252e8266a3f":[0,0,1,4,49], "group__ast__class.html#gaea4ef0d9fa16aa06d9167dd81f411913":[0,0,1,234], "group__ast__class.html#gaea4ef0d9fa16aa06d9167dd81f411913":[0,0,1,4,112], -"group__ast__class.html#gaed858f15cec95707094262eff7f96003":[0,0,1,4,121], "group__ast__class.html#gaed858f15cec95707094262eff7f96003":[0,0,1,243], +"group__ast__class.html#gaed858f15cec95707094262eff7f96003":[0,0,1,4,121], "group__ast__class.html#gaee1e3d29559569a7dc809ba13fac4d80":[0,0,1,4,31], "group__ast__class.html#gaee1e3d29559569a7dc809ba13fac4d80":[0,0,1,153], "group__ast__class.html#gaefcd48a1c371deac5a65b9ccf68a3cdf":[0,0,1,4,83], @@ -168,10 +168,10 @@ var NAVTREEINDEX27 = "group__ast__class.html#gaf59c475a99ee7363dc08790004763366":[0,0,1,4,56], "group__ast__class.html#gaf9abed7526427801c191fbaa4fae2e94":[0,0,1,144], "group__ast__class.html#gaf9abed7526427801c191fbaa4fae2e94":[0,0,1,4,22], -"group__ast__class.html#gafca2d0b12ebffe60535c7527189cc089":[0,0,1,140], "group__ast__class.html#gafca2d0b12ebffe60535c7527189cc089":[0,0,1,4,18], -"group__ast__class.html#gafedb2d6f0c7f3ea73c34947fed8a2d6b":[0,0,1,147], +"group__ast__class.html#gafca2d0b12ebffe60535c7527189cc089":[0,0,1,140], "group__ast__class.html#gafedb2d6f0c7f3ea73c34947fed8a2d6b":[0,0,1,4,25], +"group__ast__class.html#gafedb2d6f0c7f3ea73c34947fed8a2d6b":[0,0,1,147], "group__ast__prop.html":[0,0,0], "group__ast__prop.html#ga0296e9888cfe8fbbdfefcd752bba3ef0":[0,0,0,1], "group__ast__prop.html#ga132ea63177a1f70f366ea0edb09dfa14":[0,0,0,2], diff --git a/doxygen/navtreeindex28.js b/doxygen/navtreeindex28.js index f10049f89..cbffeb045 100644 --- a/doxygen/navtreeindex28.js +++ b/doxygen/navtreeindex28.js @@ -209,8 +209,8 @@ var NAVTREEINDEX28 = "group__codegen__backends.html":[0,1,0], "group__codegen__backends.html#ga743bcd56c5822a14381fd87fe586ed6c":[0,1,0,3,120], "group__codegen__backends.html#ga743bcd56c5822a14381fd87fe586ed6c":[0,1,0,7], -"group__codegen__backends.html#gabf8cfdf6adba4da78b0d92b81d9ff160":[0,1,0,3,78], "group__codegen__backends.html#gabf8cfdf6adba4da78b0d92b81d9ff160":[0,1,0,6], +"group__codegen__backends.html#gabf8cfdf6adba4da78b0d92b81d9ff160":[0,1,0,3,78], "group__codegen__details.html":[0,1,1], "group__codegen__details.html#ga2d0a1f473f039b495e9cc349c3b57dbb":[0,1,1,8], "group__codegen__details.html#ga8e2cdb825b828ca3fab27731ac2a83c2":[0,1,1,9], diff --git a/doxygen/navtreeindex29.js b/doxygen/navtreeindex29.js index 5d59e7866..877a966ef 100644 --- a/doxygen/navtreeindex29.js +++ b/doxygen/navtreeindex29.js @@ -12,33 +12,33 @@ var NAVTREEINDEX29 = "group__token__test.html#ga0da85adf566fc93b8d173fa4117ccb74":[3,0,2,0,3,0,3], "group__token__test.html#ga46008ea4532600b05a677394c6600055":[3,0,2,0,3,0,2], "group__token__test.html#ga46008ea4532600b05a677394c6600055":[0,2,1,2], -"group__token__test.html#ga752aa45201ab43cc2d13b3ce5a5f1144":[3,0,2,0,3,0,1], "group__token__test.html#ga752aa45201ab43cc2d13b3ce5a5f1144":[0,2,1,1], -"group__token__test.html#ga9cd6cc464d230725aacf2bf9d41d364e":[3,0,2,0,3,0,0], +"group__token__test.html#ga752aa45201ab43cc2d13b3ce5a5f1144":[3,0,2,0,3,0,1], "group__token__test.html#ga9cd6cc464d230725aacf2bf9d41d364e":[0,2,1,0], +"group__token__test.html#ga9cd6cc464d230725aacf2bf9d41d364e":[3,0,2,0,3,0,0], "group__units.html":[0,6], "group__units.html#ga08e9b606cb5ea92658765b82a886f2f8":[0,6,8], "group__units.html#ga08e9b606cb5ea92658765b82a886f2f8":[0,6,1,4], -"group__units.html#ga141975968d2f0eef8cfc36d80e8962c8":[0,6,0,0], "group__units.html#ga141975968d2f0eef8cfc36d80e8962c8":[0,6,13], +"group__units.html#ga141975968d2f0eef8cfc36d80e8962c8":[0,6,0,0], "group__units.html#ga20d9e1e26895ee030dff6ddb27124548":[0,6,15], "group__units.html#ga20d9e1e26895ee030dff6ddb27124548":[0,6,1,7], "group__units.html#ga31bdaa723dc74c12a9bf1a652561d6e7":[0,6,1,9], "group__units.html#ga31bdaa723dc74c12a9bf1a652561d6e7":[0,6,19], -"group__units.html#ga330f86b461ce0320cd23e935b710be05":[0,6,20], "group__units.html#ga330f86b461ce0320cd23e935b710be05":[0,6,1,10], -"group__units.html#ga3a8c3503da97aeee3d242ddafb52774a":[0,6,21], +"group__units.html#ga330f86b461ce0320cd23e935b710be05":[0,6,20], "group__units.html#ga3a8c3503da97aeee3d242ddafb52774a":[0,6,1,11], +"group__units.html#ga3a8c3503da97aeee3d242ddafb52774a":[0,6,21], "group__units.html#ga4014c46fced93378dee7846b57211f6e":[0,6,1,8], "group__units.html#ga4014c46fced93378dee7846b57211f6e":[0,6,18], -"group__units.html#ga53666d277469c1f00a3b0fd26a094178":[0,6,1,5], "group__units.html#ga53666d277469c1f00a3b0fd26a094178":[0,6,9], -"group__units.html#ga5beb2f005efacceb06427827ef45bf15":[0,6,0,2], +"group__units.html#ga53666d277469c1f00a3b0fd26a094178":[0,6,1,5], "group__units.html#ga5beb2f005efacceb06427827ef45bf15":[0,6,6], +"group__units.html#ga5beb2f005efacceb06427827ef45bf15":[0,6,0,2], "group__units.html#ga7ffa76ac1fa5595a4aa1f0f703b34717":[0,6,10], "group__units.html#ga7ffa76ac1fa5595a4aa1f0f703b34717":[0,6,1,6], -"group__units.html#gaaae2d7f1693c0e7abc23003e753d65ec":[0,6,11], "group__units.html#gaaae2d7f1693c0e7abc23003e753d65ec":[0,6,1,0], +"group__units.html#gaaae2d7f1693c0e7abc23003e753d65ec":[0,6,11], "group__units.html#gaac93a10252a81387387be4571bbed890":[0,6,1,2], "group__units.html#gaac93a10252a81387387be4571bbed890":[0,6,5], "group__units.html#gabab997408892d209edc2e6207bcf6b3a":[0,6,14], @@ -46,8 +46,8 @@ var NAVTREEINDEX29 = "group__units.html#gac26c7781e0924f73bac6a856f2c80217":[0,6,17], "group__units.html#gacf73317c537bff91a6631c0c4f4cded0":[0,6,0,3], "group__units.html#gacf73317c537bff91a6631c0c4f4cded0":[0,6,16], -"group__units.html#gae0d4c7dbd75815ee53391809a8dac74d":[0,6,1,1], "group__units.html#gae0d4c7dbd75815ee53391809a8dac74d":[0,6,12], +"group__units.html#gae0d4c7dbd75815ee53391809a8dac74d":[0,6,1,1], "group__units.html#gae62d367c779588c163dcfe9cdd9efa37":[0,6,1,3], "group__units.html#gae62d367c779588c163dcfe9cdd9efa37":[0,6,7], "group__utils.html":[0,7], diff --git a/doxygen/navtreeindex30.js b/doxygen/navtreeindex30.js index 678698498..3fde39c4a 100644 --- a/doxygen/navtreeindex30.js +++ b/doxygen/navtreeindex30.js @@ -46,41 +46,41 @@ var NAVTREEINDEX30 = "namespacemembers_v.html":[1,1,0,21], "namespacemembers_vars.html":[1,1,2], "namespacemembers_w.html":[1,1,0,22], -"namespacenmodl.html":[2,0,0], "namespacenmodl.html":[1,0,0], +"namespacenmodl.html":[2,0,0], "namespacenmodl_1_1ast.html":[2,0,0,0], "namespacenmodl_1_1ast.html":[1,0,0,0], -"namespacenmodl_1_1codegen.html":[1,0,0,1], "namespacenmodl_1_1codegen.html":[2,0,0,1], +"namespacenmodl_1_1codegen.html":[1,0,0,1], "namespacenmodl_1_1codegen_1_1naming.html":[1,0,0,1,0], "namespacenmodl_1_1codegen_1_1utils.html":[1,0,0,1,1], "namespacenmodl_1_1crout.html":[1,0,0,2], -"namespacenmodl_1_1details.html":[2,0,0,2], "namespacenmodl_1_1details.html":[1,0,0,3], +"namespacenmodl_1_1details.html":[2,0,0,2], "namespacenmodl_1_1docstring.html":[1,0,0,4], "namespacenmodl_1_1newton.html":[1,0,0,5], -"namespacenmodl_1_1parser.html":[2,0,0,3], "namespacenmodl_1_1parser.html":[1,0,0,6], -"namespacenmodl_1_1parser_1_1diffeq.html":[2,0,0,3,0], +"namespacenmodl_1_1parser.html":[2,0,0,3], "namespacenmodl_1_1parser_1_1diffeq.html":[1,0,0,6,0], -"namespacenmodl_1_1printer.html":[2,0,0,4], +"namespacenmodl_1_1parser_1_1diffeq.html":[2,0,0,3,0], "namespacenmodl_1_1printer.html":[1,0,0,7], -"namespacenmodl_1_1pybind__wrappers.html":[2,0,0,5], +"namespacenmodl_1_1printer.html":[2,0,0,4], "namespacenmodl_1_1pybind__wrappers.html":[1,0,0,8], +"namespacenmodl_1_1pybind__wrappers.html":[2,0,0,5], "namespacenmodl_1_1stringutils.html":[1,0,0,9], -"namespacenmodl_1_1symtab.html":[2,0,0,6], "namespacenmodl_1_1symtab.html":[1,0,0,10], +"namespacenmodl_1_1symtab.html":[2,0,0,6], "namespacenmodl_1_1symtab_1_1syminfo.html":[1,0,0,10,0], "namespacenmodl_1_1test__utils.html":[1,0,0,11], "namespacenmodl_1_1test__utils.html":[2,0,0,7], -"namespacenmodl_1_1units.html":[1,0,0,12], "namespacenmodl_1_1units.html":[2,0,0,8], -"namespacenmodl_1_1utils.html":[2,0,0,9], +"namespacenmodl_1_1units.html":[1,0,0,12], "namespacenmodl_1_1utils.html":[1,0,0,13], -"namespacenmodl_1_1visitor.html":[1,0,0,14], +"namespacenmodl_1_1utils.html":[2,0,0,9], "namespacenmodl_1_1visitor.html":[2,0,0,10], -"namespacenmodl_1_1visitor_1_1test.html":[2,0,0,10,0], +"namespacenmodl_1_1visitor.html":[1,0,0,14], "namespacenmodl_1_1visitor_1_1test.html":[1,0,0,14,0], +"namespacenmodl_1_1visitor_1_1test.html":[2,0,0,10,0], "namespaces.html":[1,0], "net__receive__block_8hpp.html":[3,0,0,0,0,0,73], "net__receive__block_8hpp_source.html":[3,0,0,0,0,0,73], diff --git a/doxygen/navtreeindex32.js b/doxygen/navtreeindex32.js index f993c9093..8f6d5bdc4 100644 --- a/doxygen/navtreeindex32.js +++ b/doxygen/navtreeindex32.js @@ -43,6 +43,7 @@ var NAVTREEINDEX32 = "structnmodl_1_1codegen_1_1_ion.html#a9b13f7ab5a817a785f4b75c34fc72291":[0,1,1,4,14], "structnmodl_1_1codegen_1_1_ion.html#a9e2ad52d0e3f00d7a758adc32833a5b2":[0,1,1,4,10], "structnmodl_1_1codegen_1_1_ion.html#a9e729a414c3ad2bfa935f76bdb40c32c":[0,1,1,4,3], +"structnmodl_1_1codegen_1_1_ion.html#ab464eca5bf873be2df1ea2aaea2f0533":[0,1,1,4,36], "structnmodl_1_1codegen_1_1_ion.html#ab5f7c01c16f44a6fed509aa56a524b55":[0,1,1,4,20], "structnmodl_1_1codegen_1_1_ion.html#ac16894db9591de9041e762e2cdecf964":[0,1,1,4,16], "structnmodl_1_1codegen_1_1_ion.html#acd8624aa31dffe4fcf3fbac9efc844d3":[0,1,1,4,0], @@ -52,7 +53,7 @@ var NAVTREEINDEX32 = "structnmodl_1_1codegen_1_1_ion.html#ad6ce8906bf59466495c5eac14d65b8eb":[0,1,1,4,8], "structnmodl_1_1codegen_1_1_ion.html#ada67cc12f0a686ee8eae126a0be1de71":[0,1,1,4,11], "structnmodl_1_1codegen_1_1_ion.html#adf29df9cb4393fab74e526725bdf7a3e":[0,1,1,4,26], -"structnmodl_1_1codegen_1_1_ion.html#ae116633adc4f16ce78feae5b4d2f8a12":[0,1,1,4,36], +"structnmodl_1_1codegen_1_1_ion.html#ae116633adc4f16ce78feae5b4d2f8a12":[0,1,1,4,37], "structnmodl_1_1codegen_1_1_ion.html#ae566e76a08f09207d99784251bdf6e17":[0,1,1,4,18], "structnmodl_1_1codegen_1_1_ion.html#ae98e70455f4c6bf1829597a9363ebde5":[0,1,1,4,31], "structnmodl_1_1codegen_1_1_ion.html#aeac91fdeb32fe2648df924c958f4c9de":[0,1,1,4,29], @@ -248,6 +249,5 @@ var NAVTREEINDEX32 = "symbol__properties_8hpp.html#ad9b6b8559b36d0a500ef5110badcc4dbab42b3dbb719197d22c748fc74ac64ba4":[3,0,1,8,4,3,5], "symbol__properties_8hpp.html#ad9b6b8559b36d0a500ef5110badcc4dbac4ba8c72426a2ce5d391710cb72d933a":[3,0,1,8,4,3,26], "symbol__properties_8hpp.html#ad9b6b8559b36d0a500ef5110badcc4dbac89e419cdec37c6436386d0ccee1096a":[3,0,1,8,4,3,4], -"symbol__properties_8hpp.html#ad9b6b8559b36d0a500ef5110badcc4dbac8de66f1a4787fe20ffdde46def4be3a":[3,0,1,8,4,3,23], -"symbol__properties_8hpp.html#ad9b6b8559b36d0a500ef5110badcc4dbacb1e09d4f29a44bf586491796c2373e5":[3,0,1,8,4,3,9] +"symbol__properties_8hpp.html#ad9b6b8559b36d0a500ef5110badcc4dbac8de66f1a4787fe20ffdde46def4be3a":[3,0,1,8,4,3,23] }; diff --git a/doxygen/navtreeindex33.js b/doxygen/navtreeindex33.js index 9b80b3299..ede865a68 100644 --- a/doxygen/navtreeindex33.js +++ b/doxygen/navtreeindex33.js @@ -1,5 +1,6 @@ var NAVTREEINDEX33 = { +"symbol__properties_8hpp.html#ad9b6b8559b36d0a500ef5110badcc4dbacb1e09d4f29a44bf586491796c2373e5":[3,0,1,8,4,3,9], "symbol__properties_8hpp.html#ad9b6b8559b36d0a500ef5110badcc4dbacb2f7556254f071fb944800a31272b6b":[3,0,1,8,4,3,17], "symbol__properties_8hpp.html#ad9b6b8559b36d0a500ef5110badcc4dbad1aabe136ab0db3618d96fc8bd0465b9":[3,0,1,8,4,3,7], "symbol__properties_8hpp.html#ad9b6b8559b36d0a500ef5110badcc4dbae5ca58838df33f0052301461a6c39606":[3,0,1,8,4,3,2], @@ -248,6 +249,5 @@ var NAVTREEINDEX33 = "verbatim__var__rename__visitor_8cpp_source.html":[3,0,1,11,53], "verbatim__var__rename__visitor_8hpp.html":[3,0,1,11,54], "verbatim__var__rename__visitor_8hpp_source.html":[3,0,1,11,54], -"verbatim__visitor_8cpp.html":[3,0,1,11,55], -"verbatim__visitor_8cpp_source.html":[3,0,1,11,55] +"verbatim__visitor_8cpp.html":[3,0,1,11,55] }; diff --git a/doxygen/navtreeindex34.js b/doxygen/navtreeindex34.js index 2168c4402..0f9b5f2d9 100644 --- a/doxygen/navtreeindex34.js +++ b/doxygen/navtreeindex34.js @@ -1,5 +1,6 @@ var NAVTREEINDEX34 = { +"verbatim__visitor_8cpp_source.html":[3,0,1,11,55], "verbatim__visitor_8hpp.html":[3,0,1,11,56], "verbatim__visitor_8hpp_source.html":[3,0,1,11,56], "visitor_8hpp.html":[3,0,0,0,0,1,12], diff --git a/doxygen/search/all_12.js b/doxygen/search/all_12.js index 587c5a1c6..6f4e48105 100644 --- a/doxygen/search/all_12.js +++ b/doxygen/search/all_12.js @@ -215,7 +215,7 @@ var searchData= ['suffixvector_2186',['SuffixVector',['../group__ast__vec__type.html#gafcd60e4a0a5c7f255fe5fcb69597fb35',1,'nmodl::ast']]], ['supported_5foperator_2187',['supported_operator',['../namespacenmodl_1_1visitor.html#aa775165f6c6c1db295051ae061ff0b1c',1,'nmodl::visitor']]], ['symbol_20table_20implementation_2188',['Symbol Table Implementation',['../group__sym__tab.html',1,'']]], - ['symbol_2189',['Symbol',['../classnmodl_1_1symtab_1_1_symbol.html',1,'nmodl::symtab::Symbol'],['../structnmodl_1_1codegen_1_1_index_variable_info.html#aa758ad489a95368096dc249c6ab3ee8b',1,'nmodl::codegen::IndexVariableInfo::symbol()'],['../structnmodl_1_1codegen_1_1_thread_variable_info.html#abc9630b4d163325befc9933855e05d22',1,'nmodl::codegen::ThreadVariableInfo::symbol()'],['../classnmodl_1_1symtab_1_1_symbol.html#a9fd3a6f2797bdd975ca612f80e03b57c',1,'nmodl::symtab::Symbol::Symbol()=delete'],['../classnmodl_1_1symtab_1_1_symbol.html#a07f2cffb271c1acaf32fc3f2018a3efb',1,'nmodl::symtab::Symbol::Symbol(std::string name)'],['../classnmodl_1_1symtab_1_1_symbol.html#aadc314effdeb0f5b74388f67fbddc38e',1,'nmodl::symtab::Symbol::Symbol(std::string name, ast::Ast *node)'],['../classnmodl_1_1symtab_1_1_symbol.html#a116dc2108fa86ea9124d003c6571dab4',1,'nmodl::symtab::Symbol::Symbol(std::string name, ModToken token)'],['../classnmodl_1_1symtab_1_1_symbol.html#a426c02460d6c06c12442f7bd2b28c541',1,'nmodl::symtab::Symbol::Symbol(std::string name, ast::Ast *node, ModToken token)']]], + ['symbol_2189',['Symbol',['../classnmodl_1_1symtab_1_1_symbol.html',1,'nmodl::symtab::Symbol'],['../classnmodl_1_1symtab_1_1_symbol.html#a9fd3a6f2797bdd975ca612f80e03b57c',1,'nmodl::symtab::Symbol::Symbol()=delete'],['../classnmodl_1_1symtab_1_1_symbol.html#a07f2cffb271c1acaf32fc3f2018a3efb',1,'nmodl::symtab::Symbol::Symbol(std::string name)'],['../classnmodl_1_1symtab_1_1_symbol.html#aadc314effdeb0f5b74388f67fbddc38e',1,'nmodl::symtab::Symbol::Symbol(std::string name, ast::Ast *node)'],['../classnmodl_1_1symtab_1_1_symbol.html#a116dc2108fa86ea9124d003c6571dab4',1,'nmodl::symtab::Symbol::Symbol(std::string name, ModToken token)'],['../classnmodl_1_1symtab_1_1_symbol.html#a426c02460d6c06c12442f7bd2b28c541',1,'nmodl::symtab::Symbol::Symbol(std::string name, ast::Ast *node, ModToken token)'],['../structnmodl_1_1codegen_1_1_index_variable_info.html#aa758ad489a95368096dc249c6ab3ee8b',1,'nmodl::codegen::IndexVariableInfo::symbol()'],['../structnmodl_1_1codegen_1_1_thread_variable_info.html#abc9630b4d163325befc9933855e05d22',1,'nmodl::codegen::ThreadVariableInfo::symbol()']]], ['symbol_2ecpp_2190',['symbol.cpp',['../symbol_8cpp.html',1,'']]], ['symbol_2ehpp_2191',['symbol.hpp',['../symbol_8hpp.html',1,'']]], ['symbol_5fcount_2192',['symbol_count',['../classnmodl_1_1symtab_1_1_symbol_table.html#a43ce9164f7b419c9d5b8b819f7234769',1,'nmodl::symtab::SymbolTable']]], diff --git a/doxygen/search/all_13.js b/doxygen/search/all_13.js index fe629bed6..6ef78be6a 100644 --- a/doxygen/search/all_13.js +++ b/doxygen/search/all_13.js @@ -7,13 +7,13 @@ var searchData= ['table_5fcount_2225',['table_count',['../structnmodl_1_1codegen_1_1_codegen_info.html#a918d0786e809668ee7de36228f5d06b5',1,'nmodl::codegen::CodegenInfo']]], ['table_5fdata_2ecpp_2226',['table_data.cpp',['../table__data_8cpp.html',1,'']]], ['table_5fdata_2ehpp_2227',['table_data.hpp',['../table__data_8hpp.html',1,'']]], - ['table_5ffunction_5fprefix_2228',['table_function_prefix',['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ab516d94c30f043b502152544cde2d563',1,'nmodl::codegen::CodegenCppVisitor']]], - ['table_5fstatement_2229',['TABLE_STATEMENT',['../group__ast__type.html#ggac392e49849e60c05e42ea02c7b445033ac1ed6189f0da9398dcbc9c2ee3ea0e73',1,'nmodl::ast']]], - ['table_5fstatement_2ehpp_2230',['table_statement.hpp',['../table__statement_8hpp.html',1,'']]], - ['table_5fstatement_5fused_2231',['table_statement_used',['../classnmodl_1_1codegen_1_1_codegen_helper_visitor.html#a1ab87012c2eac94f31e917cab518e805',1,'nmodl::codegen::CodegenHelperVisitor']]], - ['table_5fstatement_5fvar_2232',['table_statement_var',['../namespacenmodl_1_1symtab_1_1syminfo.html#ad9b6b8559b36d0a500ef5110badcc4dba3e077c5b82b2fc5254c4e87d790223b5',1,'nmodl::symtab::syminfo']]], - ['table_5fstatement_5fvariables_2233',['table_statement_variables',['../structnmodl_1_1codegen_1_1_codegen_info.html#a91beaa484a3ecdbc9e3c3c5b8fb30381',1,'nmodl::codegen::CodegenInfo']]], - ['table_5fthread_5ffunction_5fname_2234',['table_thread_function_name',['../classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a000f92fb0976845c64c6eda08255e8bd',1,'nmodl::codegen::CodegenNeuronCppVisitor']]], + ['table_5fstatement_2228',['TABLE_STATEMENT',['../group__ast__type.html#ggac392e49849e60c05e42ea02c7b445033ac1ed6189f0da9398dcbc9c2ee3ea0e73',1,'nmodl::ast']]], + ['table_5fstatement_2ehpp_2229',['table_statement.hpp',['../table__statement_8hpp.html',1,'']]], + ['table_5fstatement_5fused_2230',['table_statement_used',['../classnmodl_1_1codegen_1_1_codegen_helper_visitor.html#a1ab87012c2eac94f31e917cab518e805',1,'nmodl::codegen::CodegenHelperVisitor']]], + ['table_5fstatement_5fvar_2231',['table_statement_var',['../namespacenmodl_1_1symtab_1_1syminfo.html#ad9b6b8559b36d0a500ef5110badcc4dba3e077c5b82b2fc5254c4e87d790223b5',1,'nmodl::symtab::syminfo']]], + ['table_5fstatement_5fvariables_2232',['table_statement_variables',['../structnmodl_1_1codegen_1_1_codegen_info.html#a91beaa484a3ecdbc9e3c3c5b8fb30381',1,'nmodl::codegen::CodegenInfo']]], + ['table_5fthread_5ffunction_5fname_2233',['table_thread_function_name',['../classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a000f92fb0976845c64c6eda08255e8bd',1,'nmodl::codegen::CodegenNeuronCppVisitor']]], + ['table_5fupdate_5ffunction_5fname_2234',['table_update_function_name',['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a93358fcb6712a4ac8c1565529821b340',1,'nmodl::codegen::CodegenCppVisitor']]], ['table_5fvars_2235',['table_vars',['../classnmodl_1_1ast_1_1_table_statement.html#a7a558daf9153f0da122c196c37b31c5e',1,'nmodl::ast::TableStatement']]], ['tabledata_2236',['TableData',['../structnmodl_1_1utils_1_1_table_data.html',1,'nmodl::utils']]], ['tablerowtype_2237',['TableRowType',['../structnmodl_1_1utils_1_1_table_data.html#acc5dd038c1055d590465a29931f94c8a',1,'nmodl::utils::TableData']]], diff --git a/doxygen/search/all_15.js b/doxygen/search/all_15.js index 797a521c8..feb7f5c46 100644 --- a/doxygen/search/all_15.js +++ b/doxygen/search/all_15.js @@ -1,10 +1,10 @@ var searchData= [ ['v_2401',['v',['../struct_class_info.html#ad96673848ab1ba13aabf89ecf1abd6db',1,'ClassInfo']]], - ['valence_2402',['Valence',['../classnmodl_1_1ast_1_1_valence.html',1,'nmodl::ast::Valence'],['../classnmodl_1_1ast_1_1_useion.html#a03c0207cb2f2d4213868a726e0f56929',1,'nmodl::ast::Useion::valence()'],['../classnmodl_1_1ast_1_1_valence.html#acbd1671653f567543a9e225643a0cc89',1,'nmodl::ast::Valence::Valence(Name *type, Double *value)'],['../classnmodl_1_1ast_1_1_valence.html#afb67d26bb621d2788662c5d0d4044181',1,'nmodl::ast::Valence::Valence(std::shared_ptr< Name > type, std::shared_ptr< Double > value)'],['../classnmodl_1_1ast_1_1_valence.html#af9c9657b95a55238325b4b9cce302099',1,'nmodl::ast::Valence::Valence(const Valence &obj)'],['../group__ast__type.html#ggac392e49849e60c05e42ea02c7b445033ad4c282fc67c65a77faf3d6bf6128a069',1,'nmodl::ast::VALENCE()']]], + ['valence_2402',['Valence',['../classnmodl_1_1ast_1_1_valence.html',1,'nmodl::ast::Valence'],['../classnmodl_1_1ast_1_1_valence.html#acbd1671653f567543a9e225643a0cc89',1,'nmodl::ast::Valence::Valence(Name *type, Double *value)'],['../classnmodl_1_1ast_1_1_valence.html#afb67d26bb621d2788662c5d0d4044181',1,'nmodl::ast::Valence::Valence(std::shared_ptr< Name > type, std::shared_ptr< Double > value)'],['../classnmodl_1_1ast_1_1_valence.html#af9c9657b95a55238325b4b9cce302099',1,'nmodl::ast::Valence::Valence(const Valence &obj)'],['../structnmodl_1_1codegen_1_1_ion.html#ab464eca5bf873be2df1ea2aaea2f0533',1,'nmodl::codegen::Ion::valence()'],['../classnmodl_1_1ast_1_1_useion.html#a03c0207cb2f2d4213868a726e0f56929',1,'nmodl::ast::Useion::valence()'],['../group__ast__type.html#ggac392e49849e60c05e42ea02c7b445033ad4c282fc67c65a77faf3d6bf6128a069',1,'nmodl::ast::VALENCE()']]], ['valence_2ehpp_2403',['valence.hpp',['../valence_8hpp.html',1,'']]], ['valencevector_2404',['ValenceVector',['../group__ast__vec__type.html#ga94c1f13db006ede6849398172ec460fa',1,'nmodl::ast']]], - ['value_2405',['VALUE',['../classnmodl_1_1visitor_1_1_sympy_replace_solutions_visitor.html#a1e49fcb9c416a45a1607f335948228c1aecc2e9c313faddb07e7da223c1dc5c3f',1,'nmodl::visitor::SympyReplaceSolutionsVisitor::VALUE()'],['../classnmodl_1_1symtab_1_1_symbol.html#a4e14d5164984b47f5ea181c02960da6d',1,'nmodl::symtab::Symbol::value()'],['../classnmodl_1_1visitor_1_1_index_remover.html#a2476ea703ce84b841cff7b1815c23842',1,'nmodl::visitor::IndexRemover::value()'],['../classnmodl_1_1ast_1_1_b_a_block_type.html#a9b1b8934600e5fb3a84ef30de53be456',1,'nmodl::ast::BABlockType::value()'],['../classnmodl_1_1ast_1_1_binary_operator.html#a78e2a8807bdd3bdbd7d1138cab6e82aa',1,'nmodl::ast::BinaryOperator::value()'],['../classnmodl_1_1ast_1_1_boolean.html#afafd2493834bf8ff249ea1acbd73b732',1,'nmodl::ast::Boolean::value()'],['../classnmodl_1_1ast_1_1_constant_var.html#a69b7ca36ad10013d7a336506fdf106f4',1,'nmodl::ast::ConstantVar::value()'],['../classnmodl_1_1ast_1_1_define.html#ad4c6d62eb31386e7143d7cef296d0dc5',1,'nmodl::ast::Define::value()'],['../classnmodl_1_1ast_1_1_double.html#adcaf1c4901d81bdc10bef90a53937a56',1,'nmodl::ast::Double::value()'],['../classnmodl_1_1ast_1_1_double_unit.html#a4aec1f2ed586edfbda972face6555117',1,'nmodl::ast::DoubleUnit::value()'],['../classnmodl_1_1ast_1_1_factor_def.html#a7df2f637e432cc3ca5c377619b14ea60',1,'nmodl::ast::FactorDef::value()'],['../classnmodl_1_1ast_1_1_float.html#a16a77a1795222a7b1e6528ad87b23000',1,'nmodl::ast::Float::value()'],['../classnmodl_1_1ast_1_1_integer.html#aeaec2b9afaf14f054c246485e6d15f58',1,'nmodl::ast::Integer::value()'],['../classnmodl_1_1ast_1_1_name.html#ab42bb69ed518812d11f1c193cf947987',1,'nmodl::ast::Name::value()'],['../classnmodl_1_1ast_1_1_param_assign.html#ae23e63d7e3ed3b3afcff22a85c1e46a8',1,'nmodl::ast::ParamAssign::value()'],['../classnmodl_1_1ast_1_1_prime_name.html#a34474c780de39af9f7c0f8243c343735',1,'nmodl::ast::PrimeName::value()'],['../classnmodl_1_1ast_1_1_react_var_name.html#a9c42b533bb1a2efb538d52125fd3ccd2',1,'nmodl::ast::ReactVarName::value()'],['../classnmodl_1_1ast_1_1_reaction_operator.html#a39c15647f7aa4b38e4e56a05c71d4884',1,'nmodl::ast::ReactionOperator::value()'],['../classnmodl_1_1ast_1_1_string.html#adbf40ddad32c859cb81d54f2851e60c1',1,'nmodl::ast::String::value()'],['../classnmodl_1_1ast_1_1_unary_operator.html#accb254bd4dc77c1bd0cb9b4b777591c2',1,'nmodl::ast::UnaryOperator::value()'],['../classnmodl_1_1ast_1_1_unit_state.html#adc0687ac6fae48fa57cd3c807b1f008a',1,'nmodl::ast::UnitState::value()'],['../classnmodl_1_1ast_1_1_update_dt.html#a3c17ff2383d8df31dae0c34abb4fe390',1,'nmodl::ast::UpdateDt::value()'],['../classnmodl_1_1ast_1_1_valence.html#a98c5477463b20add89219dadcda80def',1,'nmodl::ast::Valence::value()'],['../classnmodl_1_1ast_1_1_watch.html#a720c9ed1bf7eff4c79d6fd55420b7a33',1,'nmodl::ast::Watch::value()']]], + ['value_2405',['value',['../classnmodl_1_1symtab_1_1_symbol.html#a4e14d5164984b47f5ea181c02960da6d',1,'nmodl::symtab::Symbol::value()'],['../classnmodl_1_1visitor_1_1_index_remover.html#a2476ea703ce84b841cff7b1815c23842',1,'nmodl::visitor::IndexRemover::value()'],['../classnmodl_1_1ast_1_1_b_a_block_type.html#a9b1b8934600e5fb3a84ef30de53be456',1,'nmodl::ast::BABlockType::value()'],['../classnmodl_1_1ast_1_1_binary_operator.html#a78e2a8807bdd3bdbd7d1138cab6e82aa',1,'nmodl::ast::BinaryOperator::value()'],['../classnmodl_1_1ast_1_1_boolean.html#afafd2493834bf8ff249ea1acbd73b732',1,'nmodl::ast::Boolean::value()'],['../classnmodl_1_1ast_1_1_constant_var.html#a69b7ca36ad10013d7a336506fdf106f4',1,'nmodl::ast::ConstantVar::value()'],['../classnmodl_1_1ast_1_1_define.html#ad4c6d62eb31386e7143d7cef296d0dc5',1,'nmodl::ast::Define::value()'],['../classnmodl_1_1ast_1_1_double.html#adcaf1c4901d81bdc10bef90a53937a56',1,'nmodl::ast::Double::value()'],['../classnmodl_1_1ast_1_1_double_unit.html#a4aec1f2ed586edfbda972face6555117',1,'nmodl::ast::DoubleUnit::value()'],['../classnmodl_1_1ast_1_1_factor_def.html#a7df2f637e432cc3ca5c377619b14ea60',1,'nmodl::ast::FactorDef::value()'],['../classnmodl_1_1ast_1_1_float.html#a16a77a1795222a7b1e6528ad87b23000',1,'nmodl::ast::Float::value()'],['../classnmodl_1_1ast_1_1_integer.html#aeaec2b9afaf14f054c246485e6d15f58',1,'nmodl::ast::Integer::value()'],['../classnmodl_1_1ast_1_1_name.html#ab42bb69ed518812d11f1c193cf947987',1,'nmodl::ast::Name::value()'],['../classnmodl_1_1ast_1_1_param_assign.html#ae23e63d7e3ed3b3afcff22a85c1e46a8',1,'nmodl::ast::ParamAssign::value()'],['../classnmodl_1_1ast_1_1_prime_name.html#a34474c780de39af9f7c0f8243c343735',1,'nmodl::ast::PrimeName::value()'],['../classnmodl_1_1ast_1_1_react_var_name.html#a9c42b533bb1a2efb538d52125fd3ccd2',1,'nmodl::ast::ReactVarName::value()'],['../classnmodl_1_1ast_1_1_reaction_operator.html#a39c15647f7aa4b38e4e56a05c71d4884',1,'nmodl::ast::ReactionOperator::value()'],['../classnmodl_1_1ast_1_1_string.html#adbf40ddad32c859cb81d54f2851e60c1',1,'nmodl::ast::String::value()'],['../classnmodl_1_1ast_1_1_unary_operator.html#accb254bd4dc77c1bd0cb9b4b777591c2',1,'nmodl::ast::UnaryOperator::value()'],['../classnmodl_1_1ast_1_1_unit_state.html#adc0687ac6fae48fa57cd3c807b1f008a',1,'nmodl::ast::UnitState::value()'],['../classnmodl_1_1ast_1_1_update_dt.html#a3c17ff2383d8df31dae0c34abb4fe390',1,'nmodl::ast::UpdateDt::value()'],['../classnmodl_1_1ast_1_1_valence.html#a98c5477463b20add89219dadcda80def',1,'nmodl::ast::Valence::value()'],['../classnmodl_1_1ast_1_1_watch.html#a720c9ed1bf7eff4c79d6fd55420b7a33',1,'nmodl::ast::Watch::value()'],['../classnmodl_1_1visitor_1_1_sympy_replace_solutions_visitor.html#a1e49fcb9c416a45a1607f335948228c1aecc2e9c313faddb07e7da223c1dc5c3f',1,'nmodl::visitor::SympyReplaceSolutionsVisitor::VALUE()']]], ['values_2406',['values',['../structnmodl_1_1utils_1_1_perf_stat.html#a73b03ee433317593a5a8112f58aa0163',1,'nmodl::utils::PerfStat']]], ['var2dependants_2407',['var2dependants',['../structnmodl_1_1visitor_1_1_sympy_replace_solutions_visitor_1_1_statement_dispenser.html#a64b0e5e760e0c33abe7fa555d77e9da0',1,'nmodl::visitor::SympyReplaceSolutionsVisitor::StatementDispenser']]], ['var2statement_2408',['var2statement',['../structnmodl_1_1visitor_1_1_sympy_replace_solutions_visitor_1_1_statement_dispenser.html#a5349e9d8a2ef3e8bbbd22a23a55eea36',1,'nmodl::visitor::SympyReplaceSolutionsVisitor::StatementDispenser']]], diff --git a/doxygen/search/functions_13.js b/doxygen/search/functions_13.js index dcc683ef7..1ee03ecf6 100644 --- a/doxygen/search/functions_13.js +++ b/doxygen/search/functions_13.js @@ -1,7 +1,7 @@ var searchData= [ - ['table_5ffunction_5fprefix_4464',['table_function_prefix',['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ab516d94c30f043b502152544cde2d563',1,'nmodl::codegen::CodegenCppVisitor']]], - ['table_5fthread_5ffunction_5fname_4465',['table_thread_function_name',['../classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a000f92fb0976845c64c6eda08255e8bd',1,'nmodl::codegen::CodegenNeuronCppVisitor']]], + ['table_5fthread_5ffunction_5fname_4464',['table_thread_function_name',['../classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a000f92fb0976845c64c6eda08255e8bd',1,'nmodl::codegen::CodegenNeuronCppVisitor']]], + ['table_5fupdate_5ffunction_5fname_4465',['table_update_function_name',['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a93358fcb6712a4ac8c1565529821b340',1,'nmodl::codegen::CodegenCppVisitor']]], ['tablestatement_4466',['TableStatement',['../classnmodl_1_1ast_1_1_table_statement.html#a1a07ea6a85c67fd6442bd77cc8f7898a',1,'nmodl::ast::TableStatement::TableStatement(const NameVector &table_vars, const NameVector &depend_vars, Expression *from, Expression *to, Integer *with)'],['../classnmodl_1_1ast_1_1_table_statement.html#a5f62c7e0bb898f7cf601fcf299cc0e3b',1,'nmodl::ast::TableStatement::TableStatement(const NameVector &table_vars, const NameVector &depend_vars, std::shared_ptr< Expression > from, std::shared_ptr< Expression > to, std::shared_ptr< Integer > with)'],['../classnmodl_1_1ast_1_1_table_statement.html#a7ec0e5e312be760bbfdd6580c12c977d',1,'nmodl::ast::TableStatement::TableStatement(const TableStatement &obj)']]], ['tag_5fall_5fstatements_4467',['tag_all_statements',['../structnmodl_1_1visitor_1_1_sympy_replace_solutions_visitor_1_1_statement_dispenser.html#a9f1ff596846becd2a2f42861d524f5da',1,'nmodl::visitor::SympyReplaceSolutionsVisitor::StatementDispenser']]], ['tag_5fdependant_5fstatements_4468',['tag_dependant_statements',['../structnmodl_1_1visitor_1_1_sympy_replace_solutions_visitor_1_1_statement_dispenser.html#aa1b038a1a5a13d89b2d148d9c3f46e85',1,'nmodl::visitor::SympyReplaceSolutionsVisitor::StatementDispenser']]], diff --git a/doxygen/search/variables_13.js b/doxygen/search/variables_13.js index e4b4fc137..f1a93632a 100644 --- a/doxygen/search/variables_13.js +++ b/doxygen/search/variables_13.js @@ -1,7 +1,7 @@ var searchData= [ ['v_5334',['v',['../struct_class_info.html#ad96673848ab1ba13aabf89ecf1abd6db',1,'ClassInfo']]], - ['valence_5335',['valence',['../classnmodl_1_1ast_1_1_useion.html#a03c0207cb2f2d4213868a726e0f56929',1,'nmodl::ast::Useion']]], + ['valence_5335',['valence',['../structnmodl_1_1codegen_1_1_ion.html#ab464eca5bf873be2df1ea2aaea2f0533',1,'nmodl::codegen::Ion::valence()'],['../classnmodl_1_1ast_1_1_useion.html#a03c0207cb2f2d4213868a726e0f56929',1,'nmodl::ast::Useion::valence()']]], ['value_5336',['value',['../classnmodl_1_1symtab_1_1_symbol.html#a4e14d5164984b47f5ea181c02960da6d',1,'nmodl::symtab::Symbol::value()'],['../classnmodl_1_1visitor_1_1_index_remover.html#a2476ea703ce84b841cff7b1815c23842',1,'nmodl::visitor::IndexRemover::value()'],['../classnmodl_1_1ast_1_1_b_a_block_type.html#a9b1b8934600e5fb3a84ef30de53be456',1,'nmodl::ast::BABlockType::value()'],['../classnmodl_1_1ast_1_1_binary_operator.html#a78e2a8807bdd3bdbd7d1138cab6e82aa',1,'nmodl::ast::BinaryOperator::value()'],['../classnmodl_1_1ast_1_1_boolean.html#afafd2493834bf8ff249ea1acbd73b732',1,'nmodl::ast::Boolean::value()'],['../classnmodl_1_1ast_1_1_constant_var.html#a69b7ca36ad10013d7a336506fdf106f4',1,'nmodl::ast::ConstantVar::value()'],['../classnmodl_1_1ast_1_1_define.html#ad4c6d62eb31386e7143d7cef296d0dc5',1,'nmodl::ast::Define::value()'],['../classnmodl_1_1ast_1_1_double.html#adcaf1c4901d81bdc10bef90a53937a56',1,'nmodl::ast::Double::value()'],['../classnmodl_1_1ast_1_1_double_unit.html#a4aec1f2ed586edfbda972face6555117',1,'nmodl::ast::DoubleUnit::value()'],['../classnmodl_1_1ast_1_1_factor_def.html#a7df2f637e432cc3ca5c377619b14ea60',1,'nmodl::ast::FactorDef::value()'],['../classnmodl_1_1ast_1_1_float.html#a16a77a1795222a7b1e6528ad87b23000',1,'nmodl::ast::Float::value()'],['../classnmodl_1_1ast_1_1_integer.html#aeaec2b9afaf14f054c246485e6d15f58',1,'nmodl::ast::Integer::value()'],['../classnmodl_1_1ast_1_1_name.html#ab42bb69ed518812d11f1c193cf947987',1,'nmodl::ast::Name::value()'],['../classnmodl_1_1ast_1_1_param_assign.html#ae23e63d7e3ed3b3afcff22a85c1e46a8',1,'nmodl::ast::ParamAssign::value()'],['../classnmodl_1_1ast_1_1_prime_name.html#a34474c780de39af9f7c0f8243c343735',1,'nmodl::ast::PrimeName::value()'],['../classnmodl_1_1ast_1_1_react_var_name.html#a9c42b533bb1a2efb538d52125fd3ccd2',1,'nmodl::ast::ReactVarName::value()'],['../classnmodl_1_1ast_1_1_reaction_operator.html#a39c15647f7aa4b38e4e56a05c71d4884',1,'nmodl::ast::ReactionOperator::value()'],['../classnmodl_1_1ast_1_1_string.html#adbf40ddad32c859cb81d54f2851e60c1',1,'nmodl::ast::String::value()'],['../classnmodl_1_1ast_1_1_unary_operator.html#accb254bd4dc77c1bd0cb9b4b777591c2',1,'nmodl::ast::UnaryOperator::value()'],['../classnmodl_1_1ast_1_1_unit_state.html#adc0687ac6fae48fa57cd3c807b1f008a',1,'nmodl::ast::UnitState::value()'],['../classnmodl_1_1ast_1_1_update_dt.html#a3c17ff2383d8df31dae0c34abb4fe390',1,'nmodl::ast::UpdateDt::value()'],['../classnmodl_1_1ast_1_1_valence.html#a98c5477463b20add89219dadcda80def',1,'nmodl::ast::Valence::value()'],['../classnmodl_1_1ast_1_1_watch.html#a720c9ed1bf7eff4c79d6fd55420b7a33',1,'nmodl::ast::Watch::value()']]], ['var2dependants_5337',['var2dependants',['../structnmodl_1_1visitor_1_1_sympy_replace_solutions_visitor_1_1_statement_dispenser.html#a64b0e5e760e0c33abe7fa555d77e9da0',1,'nmodl::visitor::SympyReplaceSolutionsVisitor::StatementDispenser']]], ['var2statement_5338',['var2statement',['../structnmodl_1_1visitor_1_1_sympy_replace_solutions_visitor_1_1_statement_dispenser.html#a5349e9d8a2ef3e8bbbd22a23a55eea36',1,'nmodl::visitor::SympyReplaceSolutionsVisitor::StatementDispenser']]], diff --git a/doxygen/src_2codegen_2codegen__coreneuron__cpp__visitor_8cpp_source.html b/doxygen/src_2codegen_2codegen__coreneuron__cpp__visitor_8cpp_source.html index a15714a36..86530d017 100644 --- a/doxygen/src_2codegen_2codegen__coreneuron__cpp__visitor_8cpp_source.html +++ b/doxygen/src_2codegen_2codegen__coreneuron__cpp__visitor_8cpp_source.html @@ -514,7 +514,7 @@
                418  printer->add_line("double v = 0;");
                419 
                420  for (const auto& function: info.functions_with_table) {
                -
                421  auto method_name_str = method_name(table_function_prefix() + function->get_node_name());
                +
                421  auto method_name_str = table_update_function_name(function->get_node_name());
                422  auto arguments = internal_method_arguments();
                423  printer->fmt_line("{}({});", method_name_str, arguments);
                424  }
                @@ -3331,7 +3331,7 @@
                virtual void print_dt_update_to_device() const
                Print the code to update dt from host to device.
                virtual void print_net_init_acc_serial_annotation_block_end()
                Print accelerator kernels end annotation for net_init kernel.
                const ParamVector external_method_parameters(bool table=false) noexcept override
                Parameters for functions in generated code that are called back from external code.
                -
                Represent ions used in mod file.
                +
                Represent ions used in mod file.
                static constexpr char NRN_CONSTRUCTOR_METHOD[]
                nrn_constructor method in generated code
                void print_net_init()
                Print initial block in the net receive block.
                void print_net_event_call(const ast::FunctionCall &node) override
                Print call to net_event.
                @@ -3340,7 +3340,7 @@
                void print_send_event_move()
                Print send event move block used in net receive as well as watch.
                void append_conc_write_statements(std::vector< ShadowUseStatement > &statements, const Ion &ion, const std::string &concentration) override
                Generate Function call statement for nrn_wrote_conc.
                -
                std::string name
                name of the ion
                +
                std::string name
                name of the ion
                static constexpr char NTHREAD_DT_VARIABLE[]
                dt variable in neuron thread structure
                Map different tokens from lexer to token types.
                void print_atomic_reduction_pragma() override
                Print atomic update pragma for reduction statements.
                @@ -3398,15 +3398,15 @@
                void visit_for_netcon(const ast::ForNetcon &node) override
                visit node of type ast::ForNetcon
                void print_compute_functions() override
                Print all compute functions for every backend.
                void print_nrn_cur_conductance_kernel(const ast::BreakpointBlock &node) override
                Print the nrn_cur kernel with NMODL conductance keyword provisions.
                -
                Represent semantic information for index variable.
                -
                bool is_intra_cell_conc(const std::string &text) const
                Check if variable name is internal cell concentration.
                +
                Represent semantic information for index variable.
                +
                bool is_intra_cell_conc(const std::string &text) const
                Check if variable name is internal cell concentration.
                virtual void print_memory_allocation_routine() const
                Print memory allocation routine.
                std::string to_string(const T &obj)
                void print_check_table_thread_function()
                Print check_table functions.
                virtual bool is_initial_block() const noexcept
                Check if the ast node is an instance of ast::InitialBlock.
                Definition: ast.cpp:124
                @ NetReceive
                net_receive block
                -
                bool is_extra_cell_conc(const std::string &text) const
                Check if variable name is external cell concentration.
                +
                bool is_extra_cell_conc(const std::string &text) const
                Check if variable name is external cell concentration.
                void print_namespace_begin() override
                Print start of namespaces.
                std::string backend_name() const override
                Name of the code generation backend.
                static constexpr char NRN_INIT_METHOD[]
                nrn_init method in generated code
                diff --git a/doxygen/src_2codegen_2codegen__info_8cpp_source.html b/doxygen/src_2codegen_2codegen__info_8cpp_source.html index 7902c1781..b229a94ff 100644 --- a/doxygen/src_2codegen_2codegen__info_8cpp_source.html +++ b/doxygen/src_2codegen_2codegen__info_8cpp_source.html @@ -207,7 +207,7 @@
                bool ion_has_write_variable() const noexcept
                if any ion has write variable
                -
                std::vector< Ion > ions
                ions used in the mod file
                +
                std::vector< Ion > ions
                ions used in the mod file
                encapsulates code generation backend implementations
                Definition: ast_common.hpp:26
                Check if variable is used in given block.
                Utility functions for visitors implementation.
                diff --git a/doxygen/src_2codegen_2codegen__neuron__cpp__visitor_8cpp.html b/doxygen/src_2codegen_2codegen__neuron__cpp__visitor_8cpp.html index 42983aa13..daeb040de 100644 --- a/doxygen/src_2codegen_2codegen__neuron__cpp__visitor_8cpp.html +++ b/doxygen/src_2codegen_2codegen__neuron__cpp__visitor_8cpp.html @@ -102,6 +102,7 @@ #include <chrono>
                #include <cmath>
                #include <ctime>
                +#include <optional>
                #include <regex>
                #include <stdexcept>
                #include "ast/all.hpp"
                diff --git a/doxygen/src_2codegen_2codegen__neuron__cpp__visitor_8cpp_source.html b/doxygen/src_2codegen_2codegen__neuron__cpp__visitor_8cpp_source.html index af4ffebf0..86ea48559 100644 --- a/doxygen/src_2codegen_2codegen__neuron__cpp__visitor_8cpp_source.html +++ b/doxygen/src_2codegen_2codegen__neuron__cpp__visitor_8cpp_source.html @@ -107,162 +107,162 @@
                11 #include <chrono>
                12 #include <cmath>
                13 #include <ctime>
                -
                14 #include <regex>
                -
                15 #include <stdexcept>
                -
                16 
                -
                17 #include "ast/all.hpp"
                - - -
                20 #include "codegen_naming.hpp"
                -
                21 #include "config/config.h"
                -
                22 #include "solver/solver.hpp"
                -
                23 #include "utils/string_utils.hpp"
                - - - -
                27 
                -
                28 namespace nmodl {
                -
                29 namespace codegen {
                -
                30 
                -
                31 using namespace ast;
                -
                32 
                -
                33 using visitor::RenameVisitor;
                -
                34 using visitor::VarUsageVisitor;
                -
                35 
                - -
                37 
                +
                14 #include <optional>
                +
                15 #include <regex>
                +
                16 #include <stdexcept>
                +
                17 
                +
                18 #include "ast/all.hpp"
                + + +
                21 #include "codegen_naming.hpp"
                +
                22 #include "config/config.h"
                +
                23 #include "solver/solver.hpp"
                +
                24 #include "utils/string_utils.hpp"
                + + + +
                28 
                +
                29 namespace nmodl {
                +
                30 namespace codegen {
                +
                31 
                +
                32 using namespace ast;
                +
                33 
                +
                34 using visitor::RenameVisitor;
                +
                35 using visitor::VarUsageVisitor;
                +
                36 
                +
                38 
                -
                39 /****************************************************************************************/
                -
                40 /* Generic information getters */
                -
                41 /****************************************************************************************/
                -
                42 
                +
                39 
                +
                40 /****************************************************************************************/
                +
                41 /* Generic information getters */
                +
                42 /****************************************************************************************/
                43 
                - -
                45  return "NEURON";
                -
                46 }
                -
                47 
                +
                44 
                + +
                46  return "NEURON";
                +
                47 }
                48 
                - -
                50  return "C++ (api-compatibility)";
                -
                51 }
                -
                52 
                +
                49 
                + +
                51  return "C++ (api-compatibility)";
                +
                52 }
                53 
                - -
                55  return "_check_table_thread";
                -
                56 }
                -
                57 
                +
                54 
                + +
                56  return "_check_table_thread";
                +
                57 }
                58 
                -
                59 /****************************************************************************************/
                -
                60 /* Common helper routines accross codegen functions */
                -
                61 /****************************************************************************************/
                -
                62 
                +
                59 
                +
                60 /****************************************************************************************/
                +
                61 /* Common helper routines accross codegen functions */
                +
                62 /****************************************************************************************/
                63 
                -
                64 int CodegenNeuronCppVisitor::position_of_float_var(const std::string& name) const {
                -
                65  const auto has_name = [&name](const SymbolType& symbol) { return symbol->get_name() == name; };
                -
                66  const auto var_iter =
                -
                67  std::find_if(codegen_float_variables.begin(), codegen_float_variables.end(), has_name);
                -
                68  if (var_iter != codegen_float_variables.end()) {
                -
                69  return var_iter - codegen_float_variables.begin();
                -
                70  } else {
                -
                71  throw std::logic_error(name + " variable not found");
                -
                72  }
                -
                73 }
                -
                74 
                +
                64 
                +
                65 int CodegenNeuronCppVisitor::position_of_float_var(const std::string& name) const {
                +
                66  const auto has_name = [&name](const SymbolType& symbol) { return symbol->get_name() == name; };
                +
                67  const auto var_iter =
                +
                68  std::find_if(codegen_float_variables.begin(), codegen_float_variables.end(), has_name);
                +
                69  if (var_iter != codegen_float_variables.end()) {
                +
                70  return var_iter - codegen_float_variables.begin();
                +
                71  } else {
                +
                72  throw std::logic_error(name + " variable not found");
                +
                73  }
                +
                74 }
                75 
                -
                76 int CodegenNeuronCppVisitor::position_of_int_var(const std::string& name) const {
                -
                77  const auto has_name = [&name](const IndexVariableInfo& index_var_symbol) {
                -
                78  return index_var_symbol.symbol->get_name() == name;
                -
                79  };
                -
                80  const auto var_iter =
                -
                81  std::find_if(codegen_int_variables.begin(), codegen_int_variables.end(), has_name);
                -
                82  if (var_iter != codegen_int_variables.end()) {
                -
                83  return var_iter - codegen_int_variables.begin();
                -
                84  } else {
                -
                85  throw std::logic_error(name + " variable not found");
                -
                86  }
                -
                87 }
                -
                88 
                +
                76 
                +
                77 int CodegenNeuronCppVisitor::position_of_int_var(const std::string& name) const {
                +
                78  const auto has_name = [&name](const IndexVariableInfo& index_var_symbol) {
                +
                79  return index_var_symbol.symbol->get_name() == name;
                +
                80  };
                +
                81  const auto var_iter =
                +
                82  std::find_if(codegen_int_variables.begin(), codegen_int_variables.end(), has_name);
                +
                83  if (var_iter != codegen_int_variables.end()) {
                +
                84  return var_iter - codegen_int_variables.begin();
                +
                85  } else {
                +
                86  throw std::logic_error(name + " variable not found");
                +
                87  }
                +
                88 }
                89 
                -
                90 /****************************************************************************************/
                -
                91 /* Backend specific routines */
                -
                92 /****************************************************************************************/
                -
                93 
                -
                94 
                -
                95 /// TODO: Edit for NEURON
                - -
                97  return;
                -
                98 }
                -
                99 
                - -
                101  if (optimize_ionvar_copies) {
                -
                102  throw std::runtime_error("Not implemented.");
                -
                103  }
                -
                104  return false;
                -
                105 }
                -
                106 
                +
                90 
                +
                91 /****************************************************************************************/
                +
                92 /* Backend specific routines */
                +
                93 /****************************************************************************************/
                +
                94 
                +
                95 
                +
                96 /// TODO: Edit for NEURON
                + +
                98  return;
                +
                99 }
                +
                100 
                + +
                102  if (optimize_ionvar_copies) {
                +
                103  throw std::runtime_error("Not implemented.");
                +
                104  }
                +
                105  return false;
                +
                106 }
                107 
                -
                108 /****************************************************************************************/
                -
                109 /* Printing routines for code generation */
                -
                110 /****************************************************************************************/
                -
                111 
                +
                108 
                +
                109 /****************************************************************************************/
                +
                110 /* Printing routines for code generation */
                +
                111 /****************************************************************************************/
                112 
                - -
                114  if (info.point_process) {
                -
                115  printer->add_multi_line(R"CODE(
                -
                116  /* Point Process specific functions */
                -
                117  static void* _hoc_create_pnt(Object* _ho) {
                -
                118  return create_point_process(_pointtype, _ho);
                -
                119  }
                -
                120  )CODE");
                -
                121  printer->push_block("static void _hoc_destroy_pnt(void* _vptr)");
                -
                122  if (info.is_watch_used() || info.for_netcon_used) {
                -
                123  printer->add_line("Prop* _prop = ((Point_process*)_vptr)->prop;");
                -
                124  }
                -
                125  if (info.is_watch_used()) {
                -
                126  printer->push_block("if (_prop)");
                -
                127  printer->fmt_line("_nrn_free_watch(_nrn_mechanism_access_dparam(_prop), {}, {});",
                -
                128  info.watch_count,
                -
                129  info.is_watch_used());
                -
                130  printer->pop_block();
                -
                131  }
                -
                132  if (info.for_netcon_used) {
                -
                133  printer->push_block("if (_prop)");
                -
                134  printer->fmt_line(
                -
                135  "_nrn_free_fornetcon(&(_nrn_mechanism_access_dparam(_prop)[_fnc_index].literal_"
                -
                136  "value<void*>()));");
                -
                137  printer->pop_block();
                -
                138  }
                -
                139  printer->add_line("destroy_point_process(_vptr);");
                -
                140  printer->pop_block();
                -
                141  printer->add_multi_line(R"CODE(
                -
                142  static double _hoc_loc_pnt(void* _vptr) {
                -
                143  return loc_point_process(_pointtype, _vptr);
                -
                144  }
                -
                145 
                -
                146  static double _hoc_has_loc(void* _vptr) {
                -
                147  return has_loc_point(_vptr);
                -
                148  }
                -
                149 
                -
                150  static double _hoc_get_loc_pnt(void* _vptr) {
                -
                151  return (get_loc_point_process(_vptr));
                -
                152  }
                -
                153  )CODE");
                -
                154  }
                -
                155 }
                -
                156 
                +
                113 
                + +
                115  if (info.point_process) {
                +
                116  printer->add_multi_line(R"CODE(
                +
                117  /* Point Process specific functions */
                +
                118  static void* _hoc_create_pnt(Object* _ho) {
                +
                119  return create_point_process(_pointtype, _ho);
                +
                120  }
                +
                121  )CODE");
                +
                122  printer->push_block("static void _hoc_destroy_pnt(void* _vptr)");
                +
                123  if (info.is_watch_used() || info.for_netcon_used) {
                +
                124  printer->add_line("Prop* _prop = ((Point_process*)_vptr)->prop;");
                +
                125  }
                +
                126  if (info.is_watch_used()) {
                +
                127  printer->push_block("if (_prop)");
                +
                128  printer->fmt_line("_nrn_free_watch(_nrn_mechanism_access_dparam(_prop), {}, {});",
                +
                129  info.watch_count,
                +
                130  info.is_watch_used());
                +
                131  printer->pop_block();
                +
                132  }
                +
                133  if (info.for_netcon_used) {
                +
                134  printer->push_block("if (_prop)");
                +
                135  printer->fmt_line(
                +
                136  "_nrn_free_fornetcon(&(_nrn_mechanism_access_dparam(_prop)[_fnc_index].literal_"
                +
                137  "value<void*>()));");
                +
                138  printer->pop_block();
                +
                139  }
                +
                140  printer->add_line("destroy_point_process(_vptr);");
                +
                141  printer->pop_block();
                +
                142  printer->add_multi_line(R"CODE(
                +
                143  static double _hoc_loc_pnt(void* _vptr) {
                +
                144  return loc_point_process(_pointtype, _vptr);
                +
                145  }
                +
                146 
                +
                147  static double _hoc_has_loc(void* _vptr) {
                +
                148  return has_loc_point(_vptr);
                +
                149  }
                +
                150 
                +
                151  static double _hoc_get_loc_pnt(void* _vptr) {
                +
                152  return (get_loc_point_process(_vptr));
                +
                153  }
                +
                154  )CODE");
                +
                155  }
                +
                156 }
                157 
                - -
                159  if (info.table_count == 0) {
                -
                160  return;
                -
                161  }
                -
                162 
                -
                163  // print declarations of `check_*` functions
                -
                164  for (const auto& function: info.functions_with_table) {
                -
                165  auto name = function->get_node_name();
                -
                166  auto internal_params = internal_method_parameters();
                -
                167  printer->fmt_line("void {}{}({});",
                -
                168  table_function_prefix(),
                -
                169  method_name(name),
                +
                158 
                + +
                160  if (info.table_count == 0) {
                +
                161  return;
                +
                162  }
                +
                163 
                +
                164  // print declarations of `check_*` functions
                +
                165  for (const auto& function: info.functions_with_table) {
                +
                166  auto name = function->get_node_name();
                +
                167  auto internal_params = internal_method_parameters();
                +
                168  printer->fmt_line("void {}({});",
                +
                169  table_update_function_name(name),
                170  get_parameter_str(internal_params));
                171  }
                172 
                @@ -288,2238 +288,2230 @@
                192  }
                193 
                194  for (const auto& function: info.functions_with_table) {
                -
                195  auto method_name_str = function->get_node_name();
                -
                196  auto method_args_str = get_arg_str(internal_method_parameters());
                -
                197  printer->fmt_line(
                -
                198  "{}{}{}({});", table_function_prefix(), method_name_str, info.rsuffix, method_args_str);
                -
                199  }
                -
                200  printer->pop_block();
                -
                201 }
                -
                202 
                - -
                204  printer->add_line("/* Neuron setdata functions */");
                -
                205  printer->add_line("extern void _nrn_setdata_reg(int, void(*)(Prop*));");
                -
                206  printer->push_block("static void _setdata(Prop* _prop)");
                -
                207  if (!info.point_process) {
                -
                208  printer->add_multi_line(R"CODE(
                -
                209  _extcall_prop = _prop;
                -
                210  _prop_id = _nrn_get_prop_id(_prop);
                -
                211  )CODE");
                -
                212  }
                -
                213  if (!info.vectorize) {
                -
                214  printer->add_multi_line(R"CODE(
                -
                215  neuron::legacy::set_globals_from_prop(_prop, _lmc, _ml, _iml);
                -
                216  _ppvar = _nrn_mechanism_access_dparam(_prop);
                -
                217  )CODE");
                -
                218  }
                -
                219  printer->pop_block();
                -
                220 
                -
                221  if (info.point_process) {
                -
                222  printer->push_block("static void _hoc_setdata(void* _vptr)");
                -
                223  printer->add_multi_line(R"CODE(
                -
                224  Prop* _prop;
                -
                225  _prop = ((Point_process*)_vptr)->prop;
                -
                226  _setdata(_prop);
                -
                227  )CODE");
                -
                228  } else {
                -
                229  printer->push_block("static void _hoc_setdata()");
                -
                230  printer->add_multi_line(R"CODE(
                -
                231  Prop *_prop = hoc_getdata_range(mech_type);
                -
                232  _setdata(_prop);
                -
                233  hoc_retpushx(1.);
                -
                234  )CODE");
                -
                235  }
                -
                236  printer->pop_block();
                -
                237 
                -
                238  printer->add_line("/* Mechanism procedures and functions */");
                -
                239  for (const auto& node: info.functions) {
                -
                240  print_function_declaration(*node, node->get_node_name());
                -
                241  printer->add_text(';');
                -
                242  printer->add_newline();
                -
                243  }
                -
                244  for (const auto& node: info.procedures) {
                -
                245  print_function_declaration(*node, node->get_node_name());
                -
                246  printer->add_text(';');
                -
                247  printer->add_newline();
                -
                248  }
                -
                249 }
                -
                250 
                -
                251 
                -
                252 /// TODO: Edit for NEURON
                - -
                254  printer->add_newline(2);
                -
                255 
                -
                256  print_point_process_function_definitions();
                -
                257  print_setdata_functions();
                -
                258  print_check_table_function_prototypes();
                -
                259 
                -
                260  /// TODO: Add mechanism function and procedures declarations
                -
                261 }
                +
                195  auto method_name = function->get_node_name();
                +
                196  auto method_args = get_arg_str(internal_method_parameters());
                +
                197  printer->fmt_line("{}({});", table_update_function_name(method_name), method_args);
                +
                198  }
                +
                199  printer->pop_block();
                +
                200 }
                +
                201 
                + +
                203  printer->add_line("/* Neuron setdata functions */");
                +
                204  printer->add_line("extern void _nrn_setdata_reg(int, void(*)(Prop*));");
                +
                205  printer->push_block("static void _setdata(Prop* _prop)");
                +
                206  if (!info.point_process) {
                +
                207  printer->add_multi_line(R"CODE(
                +
                208  _extcall_prop = _prop;
                +
                209  _prop_id = _nrn_get_prop_id(_prop);
                +
                210  )CODE");
                +
                211  }
                +
                212  if (!info.vectorize) {
                +
                213  printer->add_multi_line(R"CODE(
                +
                214  neuron::legacy::set_globals_from_prop(_prop, _lmc, _ml, _iml);
                +
                215  _ppvar = _nrn_mechanism_access_dparam(_prop);
                +
                216  )CODE");
                +
                217  }
                +
                218  printer->pop_block();
                +
                219 
                +
                220  if (info.point_process) {
                +
                221  printer->push_block("static void _hoc_setdata(void* _vptr)");
                +
                222  printer->add_multi_line(R"CODE(
                +
                223  Prop* _prop;
                +
                224  _prop = ((Point_process*)_vptr)->prop;
                +
                225  _setdata(_prop);
                +
                226  )CODE");
                +
                227  } else {
                +
                228  printer->push_block("static void _hoc_setdata()");
                +
                229  printer->add_multi_line(R"CODE(
                +
                230  Prop *_prop = hoc_getdata_range(mech_type);
                +
                231  _setdata(_prop);
                +
                232  hoc_retpushx(1.);
                +
                233  )CODE");
                +
                234  }
                +
                235  printer->pop_block();
                +
                236 
                +
                237  printer->add_line("/* Mechanism procedures and functions */");
                +
                238  for (const auto& node: info.functions) {
                +
                239  print_function_declaration(*node, node->get_node_name());
                +
                240  printer->add_text(';');
                +
                241  printer->add_newline();
                +
                242  }
                +
                243  for (const auto& node: info.procedures) {
                +
                244  print_function_declaration(*node, node->get_node_name());
                +
                245  printer->add_text(';');
                +
                246  printer->add_newline();
                +
                247  }
                +
                248 }
                +
                249 
                +
                250 
                +
                251 /// TODO: Edit for NEURON
                + +
                253  printer->add_newline(2);
                +
                254 
                +
                255  print_point_process_function_definitions();
                +
                256  print_setdata_functions();
                +
                257  print_check_table_function_prototypes();
                +
                258 
                +
                259  /// TODO: Add mechanism function and procedures declarations
                +
                260 }
                +
                261 
                262 
                -
                263 
                - -
                265  const ast::Block& node,
                -
                266  const std::string& name,
                -
                267  const std::unordered_set<CppObjectSpecifier>& specifiers) {
                -
                268  printer->add_newline(2);
                -
                269  print_function_declaration(node, name, specifiers);
                -
                270  printer->add_text(" ");
                -
                271  printer->push_block();
                -
                272 
                -
                273  // function requires return variable declaration
                -
                274  if (node.is_function_block()) {
                -
                275  auto type = default_float_data_type();
                -
                276  printer->fmt_line("{} ret_{} = 0.0;", type, name);
                -
                277  } else {
                -
                278  printer->fmt_line("int ret_{} = 0;", name);
                -
                279  }
                -
                280 
                -
                281  if (node.is_procedure_block() || node.is_function_block()) {
                -
                282  const auto& parameters = node.get_parameters();
                -
                283  auto result = std::find_if(parameters.begin(), parameters.end(), [](auto var) {
                -
                284  return var.get()->get_node_name() == "v";
                -
                285  });
                -
                286  if (result == parameters.end()) {
                -
                287  printer->fmt_line("auto v = inst.{}[id];", naming::VOLTAGE_UNUSED_VARIABLE);
                -
                288  }
                -
                289  }
                -
                290 
                -
                291  print_statement_block(*node.get_statement_block(), false, false);
                -
                292  printer->fmt_line("return ret_{};", name);
                -
                293  printer->pop_block();
                -
                294 }
                + +
                264  const ast::Block& node,
                +
                265  const std::string& name,
                +
                266  const std::unordered_set<CppObjectSpecifier>& specifiers) {
                +
                267  printer->add_newline(2);
                +
                268  print_function_declaration(node, name, specifiers);
                +
                269  printer->add_text(" ");
                +
                270  printer->push_block();
                +
                271 
                +
                272  // function requires return variable declaration
                +
                273  if (node.is_function_block()) {
                +
                274  auto type = default_float_data_type();
                +
                275  printer->fmt_line("{} ret_{} = 0.0;", type, name);
                +
                276  } else {
                +
                277  printer->fmt_line("int ret_{} = 0;", name);
                +
                278  }
                +
                279 
                +
                280  if (node.is_procedure_block() || node.is_function_block()) {
                +
                281  const auto& parameters = node.get_parameters();
                +
                282  auto result = std::find_if(parameters.begin(), parameters.end(), [](auto var) {
                +
                283  return var.get()->get_node_name() == "v";
                +
                284  });
                +
                285  if (result == parameters.end()) {
                +
                286  printer->fmt_line("auto v = inst.{}[id];", naming::VOLTAGE_UNUSED_VARIABLE);
                +
                287  }
                +
                288  }
                +
                289 
                +
                290  print_statement_block(*node.get_statement_block(), false, false);
                +
                291  printer->fmt_line("return ret_{};", name);
                +
                292  printer->pop_block();
                +
                293 }
                +
                294 
                295 
                -
                296 
                - -
                298  auto name = node.get_node_name();
                -
                299  if (info.function_uses_table(name)) {
                -
                300  auto new_name = "f_" + name;
                -
                301  print_function_or_procedure(node,
                -
                302  new_name,
                - -
                304  print_table_check_function(node);
                -
                305  print_table_replacement_function(node);
                -
                306  } else {
                -
                307  print_function_or_procedure(node, name);
                -
                308  }
                -
                309 }
                + +
                297  auto name = node.get_node_name();
                +
                298  if (info.function_uses_table(name)) {
                +
                299  auto new_name = "f_" + name;
                +
                300  print_function_or_procedure(node,
                +
                301  new_name,
                + +
                303  print_table_check_function(node);
                +
                304  print_table_replacement_function(node);
                +
                305  } else {
                +
                306  print_function_or_procedure(node, name);
                +
                307  }
                +
                308 }
                +
                309 
                310 
                -
                311 
                - -
                313  print_function_procedure_helper(node);
                -
                314 }
                + +
                312  print_function_procedure_helper(node);
                +
                313 }
                +
                314 
                315 
                -
                316 
                - -
                318  auto name = node.get_node_name();
                -
                319 
                -
                320  // name of return variable
                -
                321  std::string return_var;
                -
                322  if (info.function_uses_table(name)) {
                -
                323  return_var = "ret_f_" + name;
                -
                324  } else {
                -
                325  return_var = "ret_" + name;
                -
                326  }
                -
                327 
                -
                328  // first rename return variable name
                -
                329  auto block = node.get_statement_block().get();
                -
                330  RenameVisitor v(name, return_var);
                -
                331  block->accept(v);
                -
                332 
                -
                333  print_function_procedure_helper(node);
                -
                334 }
                -
                335 
                - -
                337  const ast::Block* function_or_procedure_block,
                -
                338  InterpreterWrapper wrapper_type) {
                -
                339  if (info.point_process && wrapper_type == InterpreterWrapper::Python) {
                -
                340  return;
                -
                341  }
                -
                342  const auto block_name = function_or_procedure_block->get_node_name();
                -
                343  if (info.point_process) {
                -
                344  printer->fmt_push_block("static double _hoc_{}(void* _vptr)", block_name);
                -
                345  } else if (wrapper_type == InterpreterWrapper::HOC) {
                -
                346  printer->fmt_push_block("static void _hoc_{}(void)", block_name);
                -
                347  } else {
                -
                348  printer->fmt_push_block("static double _npy_{}(Prop* _prop)", block_name);
                -
                349  }
                -
                350  printer->add_multi_line(R"CODE(
                -
                351  double _r{};
                -
                352  Datum* _ppvar;
                -
                353  Datum* _thread;
                -
                354  NrnThread* nt;
                -
                355  )CODE");
                -
                356  if (info.point_process) {
                -
                357  printer->add_multi_line(R"CODE(
                -
                358  auto* const _pnt = static_cast<Point_process*>(_vptr);
                -
                359  auto* const _p = _pnt->prop;
                -
                360  if (!_p) {
                -
                361  hoc_execerror("POINT_PROCESS data instance not valid", NULL);
                -
                362  }
                -
                363  _nrn_mechanism_cache_instance _lmc{_p};
                -
                364  size_t const id{};
                -
                365  _ppvar = _nrn_mechanism_access_dparam(_p);
                -
                366  _thread = _extcall_thread.data();
                -
                367  nt = static_cast<NrnThread*>(_pnt->_vnt);
                -
                368  )CODE");
                -
                369  } else if (wrapper_type == InterpreterWrapper::HOC) {
                -
                370  if (program_symtab->lookup(block_name)->has_all_properties(NmodlType::use_range_ptr_var)) {
                -
                371  printer->push_block("if (!_prop_id)");
                -
                372  printer->fmt_line(
                -
                373  "hoc_execerror(\"No data for {}_{}. Requires prior call to setdata_{} and that the "
                -
                374  "specified mechanism instance still be in existence.\", NULL);",
                -
                375  function_or_procedure_block->get_node_name(),
                -
                376  info.mod_suffix,
                -
                377  info.mod_suffix);
                -
                378  printer->pop_block();
                -
                379  printer->add_line("Prop* _local_prop = _extcall_prop;");
                -
                380  } else {
                -
                381  printer->add_line("Prop* _local_prop = _prop_id ? _extcall_prop : nullptr;");
                -
                382  }
                -
                383  printer->add_multi_line(R"CODE(
                -
                384  _nrn_mechanism_cache_instance _lmc{_local_prop};
                -
                385  size_t const id{};
                -
                386  _ppvar = _local_prop ? _nrn_mechanism_access_dparam(_local_prop) : nullptr;
                -
                387  _thread = _extcall_thread.data();
                -
                388  nt = nrn_threads;
                -
                389  )CODE");
                -
                390  } else { // wrapper_type == InterpreterWrapper::Python
                -
                391  printer->add_multi_line(R"CODE(
                -
                392  _nrn_mechanism_cache_instance _lmc{_prop};
                -
                393  size_t const id{};
                -
                394  _ppvar = _nrn_mechanism_access_dparam(_prop);
                -
                395  _thread = _extcall_thread.data();
                -
                396  nt = nrn_threads;
                -
                397  )CODE");
                -
                398  }
                -
                399  printer->fmt_line("auto inst = make_instance_{}(_lmc);", info.mod_suffix);
                -
                400  if (!codegen_thread_variables.empty()) {
                -
                401  printer->fmt_line("auto _thread_vars = {}(_thread[{}].get<double*>());",
                -
                402  thread_variables_struct(),
                -
                403  info.thread_var_thread_id);
                -
                404  }
                -
                405  if (info.function_uses_table(block_name)) {
                -
                406  printer->fmt_line("{}{}({});",
                -
                407  table_function_prefix(),
                -
                408  method_name(block_name),
                -
                409  internal_method_arguments());
                -
                410  }
                -
                411  const auto get_func_call_str = [&]() {
                -
                412  const auto params = function_or_procedure_block->get_parameters();
                -
                413  const auto func_proc_name = block_name + "_" + info.mod_suffix;
                -
                414  auto func_call = fmt::format("{}({}", func_proc_name, internal_method_arguments());
                -
                415  for (int i = 0; i < params.size(); ++i) {
                -
                416  func_call.append(fmt::format(", *getarg({})", i + 1));
                -
                417  }
                -
                418  func_call.append(")");
                -
                419  return func_call;
                -
                420  };
                -
                421  if (function_or_procedure_block->is_function_block()) {
                -
                422  printer->add_indent();
                -
                423  printer->fmt_text("_r = {};", get_func_call_str());
                -
                424  printer->add_newline();
                -
                425  } else {
                -
                426  printer->add_line("_r = 1.;");
                -
                427  printer->fmt_line("{};", get_func_call_str());
                -
                428  }
                -
                429  if (info.point_process || wrapper_type != InterpreterWrapper::HOC) {
                -
                430  printer->add_line("return(_r);");
                -
                431  } else if (wrapper_type == InterpreterWrapper::HOC) {
                -
                432  printer->add_line("hoc_retpushx(_r);");
                -
                433  }
                -
                434  printer->pop_block();
                -
                435 }
                -
                436 
                -
                437 
                - -
                439  for (const auto& procedure: info.procedures) {
                -
                440  print_hoc_py_wrapper_function_body(procedure, InterpreterWrapper::HOC);
                -
                441  print_hoc_py_wrapper_function_body(procedure, InterpreterWrapper::Python);
                -
                442  }
                -
                443  for (const auto& function: info.functions) {
                -
                444  print_hoc_py_wrapper_function_body(function, InterpreterWrapper::HOC);
                -
                445  print_hoc_py_wrapper_function_body(function, InterpreterWrapper::Python);
                -
                446  }
                -
                447 }
                -
                448 
                -
                449 
                + +
                317  auto name = node.get_node_name();
                +
                318 
                +
                319  // name of return variable
                +
                320  std::string return_var;
                +
                321  if (info.function_uses_table(name)) {
                +
                322  return_var = "ret_f_" + name;
                +
                323  } else {
                +
                324  return_var = "ret_" + name;
                +
                325  }
                +
                326 
                +
                327  // first rename return variable name
                +
                328  auto block = node.get_statement_block().get();
                +
                329  RenameVisitor v(name, return_var);
                +
                330  block->accept(v);
                +
                331 
                +
                332  print_function_procedure_helper(node);
                +
                333 }
                +
                334 
                + +
                336  const ast::Block* function_or_procedure_block,
                +
                337  InterpreterWrapper wrapper_type) {
                +
                338  if (info.point_process && wrapper_type == InterpreterWrapper::Python) {
                +
                339  return;
                +
                340  }
                +
                341  const auto block_name = function_or_procedure_block->get_node_name();
                +
                342  if (info.point_process) {
                +
                343  printer->fmt_push_block("static double _hoc_{}(void* _vptr)", block_name);
                +
                344  } else if (wrapper_type == InterpreterWrapper::HOC) {
                +
                345  printer->fmt_push_block("static void _hoc_{}(void)", block_name);
                +
                346  } else {
                +
                347  printer->fmt_push_block("static double _npy_{}(Prop* _prop)", block_name);
                +
                348  }
                +
                349  printer->add_multi_line(R"CODE(
                +
                350  double _r{};
                +
                351  Datum* _ppvar;
                +
                352  Datum* _thread;
                +
                353  NrnThread* nt;
                +
                354  )CODE");
                +
                355  if (info.point_process) {
                +
                356  printer->add_multi_line(R"CODE(
                +
                357  auto* const _pnt = static_cast<Point_process*>(_vptr);
                +
                358  auto* const _p = _pnt->prop;
                +
                359  if (!_p) {
                +
                360  hoc_execerror("POINT_PROCESS data instance not valid", NULL);
                +
                361  }
                +
                362  _nrn_mechanism_cache_instance _lmc{_p};
                +
                363  size_t const id{};
                +
                364  _ppvar = _nrn_mechanism_access_dparam(_p);
                +
                365  _thread = _extcall_thread.data();
                +
                366  nt = static_cast<NrnThread*>(_pnt->_vnt);
                +
                367  )CODE");
                +
                368  } else if (wrapper_type == InterpreterWrapper::HOC) {
                +
                369  if (program_symtab->lookup(block_name)->has_all_properties(NmodlType::use_range_ptr_var)) {
                +
                370  printer->push_block("if (!_prop_id)");
                +
                371  printer->fmt_line(
                +
                372  "hoc_execerror(\"No data for {}_{}. Requires prior call to setdata_{} and that the "
                +
                373  "specified mechanism instance still be in existence.\", NULL);",
                +
                374  function_or_procedure_block->get_node_name(),
                +
                375  info.mod_suffix,
                +
                376  info.mod_suffix);
                +
                377  printer->pop_block();
                +
                378  printer->add_line("Prop* _local_prop = _extcall_prop;");
                +
                379  } else {
                +
                380  printer->add_line("Prop* _local_prop = _prop_id ? _extcall_prop : nullptr;");
                +
                381  }
                +
                382  printer->add_multi_line(R"CODE(
                +
                383  _nrn_mechanism_cache_instance _lmc{_local_prop};
                +
                384  size_t const id{};
                +
                385  _ppvar = _local_prop ? _nrn_mechanism_access_dparam(_local_prop) : nullptr;
                +
                386  _thread = _extcall_thread.data();
                +
                387  nt = nrn_threads;
                +
                388  )CODE");
                +
                389  } else { // wrapper_type == InterpreterWrapper::Python
                +
                390  printer->add_multi_line(R"CODE(
                +
                391  _nrn_mechanism_cache_instance _lmc{_prop};
                +
                392  size_t const id{};
                +
                393  _ppvar = _nrn_mechanism_access_dparam(_prop);
                +
                394  _thread = _extcall_thread.data();
                +
                395  nt = nrn_threads;
                +
                396  )CODE");
                +
                397  }
                +
                398  printer->fmt_line("auto inst = make_instance_{}(_lmc);", info.mod_suffix);
                +
                399  if (!codegen_thread_variables.empty()) {
                +
                400  printer->fmt_line("auto _thread_vars = {}(_thread[{}].get<double*>());",
                +
                401  thread_variables_struct(),
                +
                402  info.thread_var_thread_id);
                +
                403  }
                +
                404  if (info.function_uses_table(block_name)) {
                +
                405  printer->fmt_line("{}({});",
                +
                406  table_update_function_name(block_name),
                +
                407  internal_method_arguments());
                +
                408  }
                +
                409  const auto get_func_call_str = [&]() {
                +
                410  const auto params = function_or_procedure_block->get_parameters();
                +
                411  const auto func_proc_name = block_name + "_" + info.mod_suffix;
                +
                412  auto func_call = fmt::format("{}({}", func_proc_name, internal_method_arguments());
                +
                413  for (int i = 0; i < params.size(); ++i) {
                +
                414  func_call.append(fmt::format(", *getarg({})", i + 1));
                +
                415  }
                +
                416  func_call.append(")");
                +
                417  return func_call;
                +
                418  };
                +
                419  if (function_or_procedure_block->is_function_block()) {
                +
                420  printer->add_indent();
                +
                421  printer->fmt_text("_r = {};", get_func_call_str());
                +
                422  printer->add_newline();
                +
                423  } else {
                +
                424  printer->add_line("_r = 1.;");
                +
                425  printer->fmt_line("{};", get_func_call_str());
                +
                426  }
                +
                427  if (info.point_process || wrapper_type != InterpreterWrapper::HOC) {
                +
                428  printer->add_line("return(_r);");
                +
                429  } else if (wrapper_type == InterpreterWrapper::HOC) {
                +
                430  printer->add_line("hoc_retpushx(_r);");
                +
                431  }
                +
                432  printer->pop_block();
                +
                433 }
                +
                434 
                +
                435 
                + +
                437  for (const auto& procedure: info.procedures) {
                +
                438  print_hoc_py_wrapper_function_body(procedure, InterpreterWrapper::HOC);
                +
                439  print_hoc_py_wrapper_function_body(procedure, InterpreterWrapper::Python);
                +
                440  }
                +
                441  for (const auto& function: info.functions) {
                +
                442  print_hoc_py_wrapper_function_body(function, InterpreterWrapper::HOC);
                +
                443  print_hoc_py_wrapper_function_body(function, InterpreterWrapper::Python);
                +
                444  }
                +
                445 }
                +
                446 
                +
                447 
                +
                448 /****************************************************************************************/
                +
                449 /* Code-specific helper routines */
                450 /****************************************************************************************/
                -
                451 /* Code-specific helper routines */
                -
                452 /****************************************************************************************/
                -
                453 
                -
                454 void CodegenNeuronCppVisitor::add_variable_tqitem(std::vector<IndexVariableInfo>& variables) {
                -
                455  if (info.net_send_used) {
                -
                456  variables.emplace_back(make_symbol(naming::TQITEM_VARIABLE), false, false, true);
                -
                457  variables.back().is_constant = true;
                -
                458  info.tqitem_index = static_cast<int>(variables.size() - 1);
                -
                459  }
                -
                460 }
                -
                461 
                - -
                463  std::vector<IndexVariableInfo>& variables) {
                -
                464  variables.emplace_back(make_symbol(naming::POINT_PROCESS_VARIABLE), false, false, true);
                -
                465  variables.back().is_constant = true;
                -
                466 }
                -
                467 
                - -
                469  const auto& args = internal_method_parameters();
                -
                470  return get_arg_str(args);
                -
                471 }
                -
                472 
                -
                473 
                - -
                475  ParamVector params;
                -
                476  params.emplace_back("", "_nrn_mechanism_cache_range&", "", "_lmc");
                -
                477  params.emplace_back("", fmt::format("{}&", instance_struct()), "", "inst");
                -
                478  params.emplace_back("", "size_t", "", "id");
                -
                479  params.emplace_back("", "Datum*", "", "_ppvar");
                -
                480  params.emplace_back("", "Datum*", "", "_thread");
                -
                481  if (!codegen_thread_variables.empty()) {
                -
                482  params.emplace_back("", fmt::format("{}&", thread_variables_struct()), "", "_thread_vars");
                -
                483  }
                -
                484  params.emplace_back("", "NrnThread*", "", "nt");
                -
                485  return params;
                -
                486 }
                -
                487 
                -
                488 
                -
                489 /// TODO: Edit for NEURON
                - -
                491  return {};
                -
                492 }
                -
                493 
                -
                494 
                -
                495 /// TODO: Edit for NEURON
                - -
                497  bool table) noexcept {
                -
                498  return {};
                -
                499 }
                -
                500 
                -
                501 
                -
                502 /// TODO: Edit for NEURON
                - -
                504  return {};
                -
                505 }
                -
                506 
                -
                507 
                -
                508 /// TODO: Edit for NEURON
                - -
                510  return {};
                -
                511 }
                -
                512 
                -
                513 
                -
                514 /// TODO: Write for NEURON
                -
                515 std::string CodegenNeuronCppVisitor::process_verbatim_text(std::string const& text) {
                -
                516  return {};
                -
                517 }
                -
                518 
                -
                519 
                -
                520 /// TODO: Write for NEURON
                - -
                522  return {};
                -
                523 };
                -
                524 
                -
                525 
                - -
                527  const std::string& function_or_procedure_name) const {
                -
                528  return fmt::format("_hoc_{}", function_or_procedure_name);
                -
                529 }
                -
                530 
                -
                531 
                - -
                533  const std::string& function_or_procedure_name) const {
                -
                534  return fmt::format("static {} {}(void{})",
                -
                535  info.point_process ? "double" : "void",
                -
                536  hoc_function_name(function_or_procedure_name),
                -
                537  info.point_process ? "*" : "");
                -
                538 }
                -
                539 
                -
                540 
                - -
                542  const std::string& function_or_procedure_name) const {
                -
                543  return fmt::format("_npy_{}", function_or_procedure_name);
                -
                544 }
                -
                545 
                -
                546 
                - -
                548  const std::string& function_or_procedure_name) const {
                -
                549  return fmt::format("static double {}(Prop*)", py_function_name(function_or_procedure_name));
                -
                550 }
                -
                551 
                -
                552 
                +
                451 
                +
                452 void CodegenNeuronCppVisitor::add_variable_tqitem(std::vector<IndexVariableInfo>& variables) {
                +
                453  if (info.net_send_used) {
                +
                454  variables.emplace_back(make_symbol(naming::TQITEM_VARIABLE), false, false, true);
                +
                455  variables.back().is_constant = true;
                +
                456  info.tqitem_index = static_cast<int>(variables.size() - 1);
                +
                457  }
                +
                458 }
                +
                459 
                + +
                461  std::vector<IndexVariableInfo>& variables) {
                +
                462  variables.emplace_back(make_symbol(naming::POINT_PROCESS_VARIABLE), false, false, true);
                +
                463  variables.back().is_constant = true;
                +
                464 }
                +
                465 
                + +
                467  const auto& args = internal_method_parameters();
                +
                468  return get_arg_str(args);
                +
                469 }
                +
                470 
                +
                471 
                + +
                473  ParamVector params;
                +
                474  params.emplace_back("", "_nrn_mechanism_cache_range&", "", "_lmc");
                +
                475  params.emplace_back("", fmt::format("{}&", instance_struct()), "", "inst");
                +
                476  params.emplace_back("", "size_t", "", "id");
                +
                477  params.emplace_back("", "Datum*", "", "_ppvar");
                +
                478  params.emplace_back("", "Datum*", "", "_thread");
                +
                479  if (!codegen_thread_variables.empty()) {
                +
                480  params.emplace_back("", fmt::format("{}&", thread_variables_struct()), "", "_thread_vars");
                +
                481  }
                +
                482  params.emplace_back("", "NrnThread*", "", "nt");
                +
                483  return params;
                +
                484 }
                +
                485 
                +
                486 
                +
                487 /// TODO: Edit for NEURON
                + +
                489  return {};
                +
                490 }
                +
                491 
                +
                492 
                +
                493 /// TODO: Edit for NEURON
                + +
                495  bool table) noexcept {
                +
                496  return {};
                +
                497 }
                +
                498 
                +
                499 
                +
                500 /// TODO: Edit for NEURON
                + +
                502  return {};
                +
                503 }
                +
                504 
                +
                505 
                +
                506 /// TODO: Edit for NEURON
                + +
                508  return {};
                +
                509 }
                +
                510 
                +
                511 
                +
                512 /// TODO: Write for NEURON
                +
                513 std::string CodegenNeuronCppVisitor::process_verbatim_text(std::string const& text) {
                +
                514  return {};
                +
                515 }
                +
                516 
                +
                517 
                +
                518 /// TODO: Write for NEURON
                + +
                520  return {};
                +
                521 };
                +
                522 
                +
                523 
                + +
                525  const std::string& function_or_procedure_name) const {
                +
                526  return fmt::format("_hoc_{}", function_or_procedure_name);
                +
                527 }
                +
                528 
                +
                529 
                + +
                531  const std::string& function_or_procedure_name) const {
                +
                532  return fmt::format("static {} {}(void{})",
                +
                533  info.point_process ? "double" : "void",
                +
                534  hoc_function_name(function_or_procedure_name),
                +
                535  info.point_process ? "*" : "");
                +
                536 }
                +
                537 
                +
                538 
                + +
                540  const std::string& function_or_procedure_name) const {
                +
                541  return fmt::format("_npy_{}", function_or_procedure_name);
                +
                542 }
                +
                543 
                +
                544 
                + +
                546  const std::string& function_or_procedure_name) const {
                +
                547  return fmt::format("static double {}(Prop*)", py_function_name(function_or_procedure_name));
                +
                548 }
                +
                549 
                +
                550 
                +
                551 /****************************************************************************************/
                +
                552 /* Code-specific printing routines for code generation */
                553 /****************************************************************************************/
                -
                554 /* Code-specific printing routines for code generation */
                -
                555 /****************************************************************************************/
                -
                556 
                -
                557 
                - -
                559  printer->add_newline(2);
                -
                560  printer->push_block("namespace neuron");
                -
                561 }
                -
                562 
                -
                563 
                - -
                565  printer->pop_block();
                -
                566 }
                -
                567 
                - -
                569  std::vector<ShadowUseStatement>& statements,
                -
                570  const Ion& ion,
                -
                571  const std::string& /* concentration */) {
                -
                572  auto ion_name = ion.name;
                -
                573  int dparam_index = get_int_variable_index(fmt::format("style_{}", ion_name));
                -
                574 
                -
                575  auto style_name = fmt::format("_style_{}", ion_name);
                -
                576  auto style_stmt = fmt::format("int {} = *(_ppvar[{}].get<int*>())", style_name, dparam_index);
                -
                577  statements.push_back(ShadowUseStatement{style_stmt, "", ""});
                -
                578 
                -
                579 
                -
                580  auto wrote_conc_stmt = fmt::format("nrn_wrote_conc(_{}_sym, {}, {}, {}, {})",
                -
                581  ion_name,
                -
                582  get_variable_name(ion.rev_potential_pointer_name()),
                -
                583  get_variable_name(ion.intra_conc_pointer_name()),
                -
                584  get_variable_name(ion.extra_conc_pointer_name()),
                -
                585  style_name);
                -
                586  statements.push_back(ShadowUseStatement{wrote_conc_stmt, "", ""});
                -
                587 }
                -
                588 
                +
                554 
                +
                555 
                + +
                557  printer->add_newline(2);
                +
                558  printer->push_block("namespace neuron");
                +
                559 }
                +
                560 
                +
                561 
                + +
                563  printer->pop_block();
                +
                564 }
                +
                565 
                + +
                567  std::vector<ShadowUseStatement>& statements,
                +
                568  const Ion& ion,
                +
                569  const std::string& /* concentration */) {
                +
                570  auto ion_name = ion.name;
                +
                571  int dparam_index = get_int_variable_index(fmt::format("style_{}", ion_name));
                +
                572 
                +
                573  auto style_name = fmt::format("_style_{}", ion_name);
                +
                574  auto style_stmt = fmt::format("int {} = *(_ppvar[{}].get<int*>())", style_name, dparam_index);
                +
                575  statements.push_back(ShadowUseStatement{style_stmt, "", ""});
                +
                576 
                +
                577 
                +
                578  auto wrote_conc_stmt = fmt::format("nrn_wrote_conc(_{}_sym, {}, {}, {}, {})",
                +
                579  ion_name,
                +
                580  get_variable_name(ion.rev_potential_pointer_name()),
                +
                581  get_variable_name(ion.intra_conc_pointer_name()),
                +
                582  get_variable_name(ion.extra_conc_pointer_name()),
                +
                583  style_name);
                +
                584  statements.push_back(ShadowUseStatement{wrote_conc_stmt, "", ""});
                +
                585 }
                +
                586 
                +
                587 /****************************************************************************************/
                +
                588 /* Routines for returning variable name */
                589 /****************************************************************************************/
                -
                590 /* Routines for returning variable name */
                -
                591 /****************************************************************************************/
                -
                592 
                -
                593 
                -
                594 /// TODO: Edit for NEURON
                - -
                596  bool use_instance) const {
                -
                597  auto name = symbol->get_name();
                -
                598  auto dimension = symbol->get_length();
                -
                599  // auto position = position_of_float_var(name);
                -
                600  if (symbol->is_array()) {
                -
                601  if (use_instance) {
                -
                602  return fmt::format("(inst.{}+id*{})", name, dimension);
                -
                603  }
                -
                604  throw std::runtime_error("Printing non-instance variables is not implemented.");
                -
                605  // return fmt::format("(data + {}*pnodecount + id*{})", position, dimension);
                -
                606  }
                -
                607  if (use_instance) {
                -
                608  return fmt::format("inst.{}[id]", name);
                -
                609  }
                -
                610  throw std::runtime_error("Not implemented.");
                -
                611  // return fmt::format("data[{}*pnodecount + id]", position);
                -
                612 }
                -
                613 
                -
                614 
                - -
                616  const std::string& name,
                -
                617  bool use_instance) const {
                -
                618  auto position = position_of_int_var(name);
                -
                619  if (symbol.is_index) {
                -
                620  if (use_instance) {
                -
                621  throw std::runtime_error("Not implemented. [wiejo]");
                -
                622  // return fmt::format("inst->{}[{}]", name, position);
                -
                623  }
                -
                624  throw std::runtime_error("Not implemented. [ncuwi]");
                -
                625  // return fmt::format("indexes[{}]", position);
                -
                626  }
                -
                627  if (symbol.is_integer) {
                -
                628  if (use_instance) {
                -
                629  return fmt::format("inst.{}[id]", name);
                -
                630  }
                -
                631  return fmt::format("_ppvar[{}]", position);
                -
                632  }
                -
                633  if (use_instance) {
                -
                634  return fmt::format("(*inst.{}[id])", name);
                -
                635  }
                -
                636 
                -
                637  throw std::runtime_error("Not implemented. [nvueir]");
                -
                638  // auto data = symbol.is_vdata ? "_vdata" : "_data";
                -
                639  // return fmt::format("nt->{}[indexes[{}*pnodecount + id]]", data, position);
                -
                640 }
                -
                641 
                -
                642 
                - -
                644  bool use_instance) const {
                -
                645  auto i_var = var_info.offset;
                -
                646  auto var_name = var_info.symbol->get_name();
                -
                647 
                -
                648  if (use_instance) {
                -
                649  if (var_info.symbol->is_array()) {
                -
                650  return fmt::format("(_thread_vars.{}_ptr(id))", var_name);
                -
                651  } else {
                -
                652  return fmt::format("_thread_vars.{}(id)", var_name);
                -
                653  }
                -
                654  } else {
                -
                655  if (var_info.symbol->is_array()) {
                -
                656  return fmt::format("({}.thread_data + {})", global_struct_instance(), i_var);
                -
                657  } else {
                -
                658  return fmt::format("{}.thread_data[{}]", global_struct_instance(), i_var);
                -
                659  }
                -
                660  }
                -
                661 }
                -
                662 
                -
                663 
                - -
                665  bool use_instance) const {
                -
                666  if (use_instance) {
                -
                667  return fmt::format("inst.{}->{}", naming::INST_GLOBAL_MEMBER, symbol->get_name());
                -
                668  } else {
                -
                669  return fmt::format("{}.{}", global_struct_instance(), symbol->get_name());
                -
                670  }
                -
                671 }
                -
                672 
                -
                673 
                -
                674 std::string CodegenNeuronCppVisitor::get_variable_name(const std::string& name,
                -
                675  bool use_instance) const {
                -
                676  const std::string& varname = update_if_ion_variable_name(name);
                -
                677 
                -
                678  auto symbol_comparator = [&varname](const SymbolType& sym) {
                -
                679  return varname == sym->get_name();
                -
                680  };
                -
                681 
                -
                682  auto index_comparator = [&varname](const IndexVariableInfo& var) {
                -
                683  return varname == var.symbol->get_name();
                -
                684  };
                -
                685 
                -
                686  auto thread_comparator = [&varname](const ThreadVariableInfo& var) {
                -
                687  return varname == var.symbol->get_name();
                -
                688  };
                -
                689 
                -
                690  if (name == naming::POINT_PROCESS_VARIABLE) {
                -
                691  if (printing_net_receive) {
                -
                692  // In net_receive blocks, the point process is passed in as an
                -
                693  // argument called:
                -
                694  return "_pnt";
                -
                695  }
                -
                696  // The "integer variable" branch will pick up the correct `_ppvar` when
                -
                697  // not printing a NET_RECEIVE block.
                -
                698  }
                -
                699 
                -
                700  // float variable
                -
                701  auto f = std::find_if(codegen_float_variables.begin(),
                -
                702  codegen_float_variables.end(),
                -
                703  symbol_comparator);
                -
                704  if (f != codegen_float_variables.end()) {
                -
                705  return float_variable_name(*f, use_instance);
                -
                706  }
                -
                707 
                -
                708  // integer variable
                -
                709  auto i =
                -
                710  std::find_if(codegen_int_variables.begin(), codegen_int_variables.end(), index_comparator);
                -
                711  if (i != codegen_int_variables.end()) {
                -
                712  return int_variable_name(*i, varname, use_instance);
                -
                713  }
                -
                714 
                -
                715  // thread variable
                -
                716  auto t = std::find_if(codegen_thread_variables.begin(),
                -
                717  codegen_thread_variables.end(),
                -
                718  thread_comparator);
                -
                719  if (t != codegen_thread_variables.end()) {
                -
                720  return thread_variable_name(*t, use_instance);
                -
                721  }
                -
                722 
                -
                723  // global variable
                -
                724  auto g = std::find_if(codegen_global_variables.begin(),
                -
                725  codegen_global_variables.end(),
                -
                726  symbol_comparator);
                -
                727  if (g != codegen_global_variables.end()) {
                -
                728  return global_variable_name(*g, use_instance);
                -
                729  }
                -
                730 
                -
                731  if (varname == naming::NTHREAD_DT_VARIABLE) {
                -
                732  return std::string("nt->_") + naming::NTHREAD_DT_VARIABLE;
                -
                733  }
                -
                734 
                -
                735  if (varname == naming::NTHREAD_T_VARIABLE) {
                -
                736  return std::string("nt->_") + naming::NTHREAD_T_VARIABLE;
                -
                737  }
                -
                738 
                -
                739  auto const iter =
                -
                740  std::find_if(info.neuron_global_variables.begin(),
                -
                741  info.neuron_global_variables.end(),
                -
                742  [&varname](auto const& entry) { return entry.first->get_name() == varname; });
                -
                743  if (iter != info.neuron_global_variables.end()) {
                -
                744  std::string ret;
                -
                745  if (use_instance) {
                -
                746  ret = "*(inst.";
                -
                747  }
                -
                748  ret.append(varname);
                -
                749  if (use_instance) {
                -
                750  ret.append(")");
                -
                751  }
                -
                752  return ret;
                -
                753  }
                -
                754 
                -
                755  // otherwise return original name
                -
                756  return varname;
                -
                757 }
                -
                758 
                -
                759 
                +
                590 
                +
                591 
                +
                592 /// TODO: Edit for NEURON
                + +
                594  bool use_instance) const {
                +
                595  auto name = symbol->get_name();
                +
                596  auto dimension = symbol->get_length();
                +
                597  // auto position = position_of_float_var(name);
                +
                598  if (symbol->is_array()) {
                +
                599  if (use_instance) {
                +
                600  return fmt::format("(inst.{}+id*{})", name, dimension);
                +
                601  }
                +
                602  throw std::runtime_error("Printing non-instance variables is not implemented.");
                +
                603  // return fmt::format("(data + {}*pnodecount + id*{})", position, dimension);
                +
                604  }
                +
                605  if (use_instance) {
                +
                606  return fmt::format("inst.{}[id]", name);
                +
                607  }
                +
                608  throw std::runtime_error("Not implemented.");
                +
                609  // return fmt::format("data[{}*pnodecount + id]", position);
                +
                610 }
                +
                611 
                +
                612 
                + +
                614  const std::string& name,
                +
                615  bool use_instance) const {
                +
                616  auto position = position_of_int_var(name);
                +
                617  if (symbol.is_index) {
                +
                618  if (use_instance) {
                +
                619  throw std::runtime_error("Not implemented. [wiejo]");
                +
                620  // return fmt::format("inst->{}[{}]", name, position);
                +
                621  }
                +
                622  throw std::runtime_error("Not implemented. [ncuwi]");
                +
                623  // return fmt::format("indexes[{}]", position);
                +
                624  }
                +
                625  if (symbol.is_integer) {
                +
                626  if (use_instance) {
                +
                627  return fmt::format("inst.{}[id]", name);
                +
                628  }
                +
                629  return fmt::format("_ppvar[{}]", position);
                +
                630  }
                +
                631  if (use_instance) {
                +
                632  return fmt::format("(*inst.{}[id])", name);
                +
                633  }
                +
                634 
                +
                635  throw std::runtime_error("Not implemented. [nvueir]");
                +
                636  // auto data = symbol.is_vdata ? "_vdata" : "_data";
                +
                637  // return fmt::format("nt->{}[indexes[{}*pnodecount + id]]", data, position);
                +
                638 }
                +
                639 
                +
                640 
                + +
                642  bool use_instance) const {
                +
                643  auto i_var = var_info.offset;
                +
                644  auto var_name = var_info.symbol->get_name();
                +
                645 
                +
                646  if (use_instance) {
                +
                647  if (var_info.symbol->is_array()) {
                +
                648  return fmt::format("(_thread_vars.{}_ptr(id))", var_name);
                +
                649  } else {
                +
                650  return fmt::format("_thread_vars.{}(id)", var_name);
                +
                651  }
                +
                652  } else {
                +
                653  if (var_info.symbol->is_array()) {
                +
                654  return fmt::format("({}.thread_data + {})", global_struct_instance(), i_var);
                +
                655  } else {
                +
                656  return fmt::format("{}.thread_data[{}]", global_struct_instance(), i_var);
                +
                657  }
                +
                658  }
                +
                659 }
                +
                660 
                +
                661 
                + +
                663  bool use_instance) const {
                +
                664  if (use_instance) {
                +
                665  return fmt::format("inst.{}->{}", naming::INST_GLOBAL_MEMBER, symbol->get_name());
                +
                666  } else {
                +
                667  return fmt::format("{}.{}", global_struct_instance(), symbol->get_name());
                +
                668  }
                +
                669 }
                +
                670 
                +
                671 
                +
                672 std::string CodegenNeuronCppVisitor::get_variable_name(const std::string& name,
                +
                673  bool use_instance) const {
                +
                674  const std::string& varname = update_if_ion_variable_name(name);
                +
                675 
                +
                676  auto symbol_comparator = [&varname](const SymbolType& sym) {
                +
                677  return varname == sym->get_name();
                +
                678  };
                +
                679 
                +
                680  auto index_comparator = [&varname](const IndexVariableInfo& var) {
                +
                681  return varname == var.symbol->get_name();
                +
                682  };
                +
                683 
                +
                684  auto thread_comparator = [&varname](const ThreadVariableInfo& var) {
                +
                685  return varname == var.symbol->get_name();
                +
                686  };
                +
                687 
                +
                688  if (name == naming::POINT_PROCESS_VARIABLE) {
                +
                689  if (printing_net_receive) {
                +
                690  // In net_receive blocks, the point process is passed in as an
                +
                691  // argument called:
                +
                692  return "_pnt";
                +
                693  }
                +
                694  // The "integer variable" branch will pick up the correct `_ppvar` when
                +
                695  // not printing a NET_RECEIVE block.
                +
                696  }
                +
                697 
                +
                698  // float variable
                +
                699  auto f = std::find_if(codegen_float_variables.begin(),
                +
                700  codegen_float_variables.end(),
                +
                701  symbol_comparator);
                +
                702  if (f != codegen_float_variables.end()) {
                +
                703  return float_variable_name(*f, use_instance);
                +
                704  }
                +
                705 
                +
                706  // integer variable
                +
                707  auto i =
                +
                708  std::find_if(codegen_int_variables.begin(), codegen_int_variables.end(), index_comparator);
                +
                709  if (i != codegen_int_variables.end()) {
                +
                710  return int_variable_name(*i, varname, use_instance);
                +
                711  }
                +
                712 
                +
                713  // thread variable
                +
                714  auto t = std::find_if(codegen_thread_variables.begin(),
                +
                715  codegen_thread_variables.end(),
                +
                716  thread_comparator);
                +
                717  if (t != codegen_thread_variables.end()) {
                +
                718  return thread_variable_name(*t, use_instance);
                +
                719  }
                +
                720 
                +
                721  // global variable
                +
                722  auto g = std::find_if(codegen_global_variables.begin(),
                +
                723  codegen_global_variables.end(),
                +
                724  symbol_comparator);
                +
                725  if (g != codegen_global_variables.end()) {
                +
                726  return global_variable_name(*g, use_instance);
                +
                727  }
                +
                728 
                +
                729  if (varname == naming::NTHREAD_DT_VARIABLE) {
                +
                730  return std::string("nt->_") + naming::NTHREAD_DT_VARIABLE;
                +
                731  }
                +
                732 
                +
                733  if (varname == naming::NTHREAD_T_VARIABLE) {
                +
                734  return std::string("nt->_") + naming::NTHREAD_T_VARIABLE;
                +
                735  }
                +
                736 
                +
                737  auto const iter =
                +
                738  std::find_if(info.neuron_global_variables.begin(),
                +
                739  info.neuron_global_variables.end(),
                +
                740  [&varname](auto const& entry) { return entry.first->get_name() == varname; });
                +
                741  if (iter != info.neuron_global_variables.end()) {
                +
                742  std::string ret;
                +
                743  if (use_instance) {
                +
                744  ret = "*(inst.";
                +
                745  }
                +
                746  ret.append(varname);
                +
                747  if (use_instance) {
                +
                748  ret.append(")");
                +
                749  }
                +
                750  return ret;
                +
                751  }
                +
                752 
                +
                753  // otherwise return original name
                +
                754  return varname;
                +
                755 }
                +
                756 
                +
                757 
                +
                758 /****************************************************************************************/
                +
                759 /* Main printing routines for code generation */
                760 /****************************************************************************************/
                -
                761 /* Main printing routines for code generation */
                -
                762 /****************************************************************************************/
                -
                763 
                -
                764 
                - -
                766  printer->add_newline();
                -
                767  printer->add_multi_line(R"CODE(
                -
                768  #include <Eigen/Dense>
                -
                769  #include <Eigen/LU>
                -
                770  #include <math.h>
                -
                771  #include <stdio.h>
                -
                772  #include <stdlib.h>
                -
                773  )CODE");
                -
                774  printer->add_multi_line(nmodl::solvers::newton_hpp);
                -
                775  if (!info.vectorize) {
                -
                776  printer->add_line("#include <vector>");
                -
                777  }
                -
                778 }
                -
                779 
                -
                780 
                - -
                782  printer->add_newline();
                -
                783  printer->add_multi_line(R"CODE(
                -
                784  #include "mech_api.h"
                -
                785  #include "neuron/cache/mechanism_range.hpp"
                -
                786  #include "nrniv_mf.h"
                -
                787  #include "section_fwd.hpp"
                -
                788  )CODE");
                -
                789 }
                -
                790 
                -
                791 
                -
                792 void CodegenNeuronCppVisitor::print_sdlists_init([[maybe_unused]] bool print_initializers) {
                -
                793  /// _initlists() should only be called once by the mechanism registration function
                -
                794  /// (_<mod_file>_reg())
                -
                795  printer->add_newline(2);
                -
                796  printer->push_block("static void _initlists()");
                -
                797  for (auto i = 0; i < info.prime_variables_by_order.size(); ++i) {
                -
                798  const auto& prime_var = info.prime_variables_by_order[i];
                -
                799  /// TODO: Something similar needs to happen for slist/dlist2 but I don't know their usage at
                -
                800  // the moment
                -
                801  /// TODO: We have to do checks and add errors similar to nocmodl in the
                -
                802  // SemanticAnalysisVisitor
                -
                803  if (prime_var->is_array()) {
                -
                804  /// TODO: Needs a for loop here. Look at
                -
                805  // https://github.com/neuronsimulator/nrn/blob/df001a436bcb4e23d698afe66c2a513819a6bfe8/src/nmodl/deriv.cpp#L524
                -
                806  /// TODO: Also needs a test
                -
                807  printer->fmt_push_block("for (int _i = 0; _i < {}; ++_i)", prime_var->get_length());
                -
                808  printer->fmt_line("/* {}[{}] */", prime_var->get_name(), prime_var->get_length());
                -
                809  printer->fmt_line("_slist1[{}+_i] = {{{}, _i}};",
                -
                810  i,
                -
                811  position_of_float_var(prime_var->get_name()));
                -
                812  const auto prime_var_deriv_name = "D" + prime_var->get_name();
                -
                813  printer->fmt_line("/* {}[{}] */", prime_var_deriv_name, prime_var->get_length());
                -
                814  printer->fmt_line("_dlist1[{}+_i] = {{{}, _i}};",
                -
                815  i,
                -
                816  position_of_float_var(prime_var_deriv_name));
                -
                817  printer->pop_block();
                -
                818  } else {
                -
                819  printer->fmt_line("/* {} */", prime_var->get_name());
                -
                820  printer->fmt_line("_slist1[{}] = {{{}, 0}};",
                -
                821  i,
                -
                822  position_of_float_var(prime_var->get_name()));
                -
                823  const auto prime_var_deriv_name = "D" + prime_var->get_name();
                -
                824  printer->fmt_line("/* {} */", prime_var_deriv_name);
                -
                825  printer->fmt_line("_dlist1[{}] = {{{}, 0}};",
                -
                826  i,
                -
                827  position_of_float_var(prime_var_deriv_name));
                -
                828  }
                -
                829  }
                -
                830  printer->pop_block();
                -
                831 }
                -
                832 
                - -
                834  auto params = ParamVector{};
                -
                835  params.push_back({"", "NrnThread*", "", "nt"});
                -
                836  params.push_back({"", fmt::format("{}&", instance_struct()), "", "inst"});
                -
                837  params.push_back({"", "int", "", "id"});
                -
                838  params.push_back({"", "double", "", "v"});
                -
                839  params.push_back({"", "Datum*", "", "_thread"});
                -
                840  if (!codegen_thread_variables.empty()) {
                -
                841  params.push_back({"", fmt::format("{}&", thread_variables_struct()), "", "_thread_vars"});
                -
                842  }
                -
                843 
                -
                844  return params;
                -
                845 }
                -
                846 
                - -
                848  const auto value_initialize = print_initializers ? "{}" : "";
                -
                849 
                -
                850  /// TODO: Print only global variables printed in NEURON
                -
                851  printer->add_newline(2);
                -
                852  printer->add_line("/* NEURON global variables */");
                -
                853  if (info.primes_size != 0) {
                -
                854  printer->fmt_line("static neuron::container::field_index _slist1[{0}], _dlist1[{0}];",
                -
                855  info.primes_size);
                -
                856  }
                -
                857 
                -
                858  for (const auto& ion: info.ions) {
                -
                859  printer->fmt_line("static Symbol* _{}_sym;", ion.name);
                -
                860  }
                -
                861 
                -
                862  printer->add_line("static int mech_type;");
                -
                863 
                -
                864  if (info.point_process) {
                -
                865  printer->add_line("static int _pointtype;");
                -
                866  } else {
                -
                867  printer->add_multi_line(R"CODE(
                -
                868  static Prop* _extcall_prop;
                -
                869  /* _prop_id kind of shadows _extcall_prop to allow validity checking. */
                -
                870  static _nrn_non_owning_id_without_container _prop_id{};)CODE");
                -
                871  }
                -
                872 
                -
                873  printer->fmt_line("static int {} = {};",
                - -
                875  info.pointer_variables.size() > 0
                -
                876  ? static_cast<int>(info.pointer_variables.size())
                -
                877  : -1);
                -
                878 
                -
                879  printer->add_line("static _nrn_mechanism_std_vector<Datum> _extcall_thread;");
                -
                880 
                -
                881  // Start printing the CNRN-style global variables.
                -
                882  auto float_type = default_float_data_type();
                -
                883  printer->add_newline(2);
                -
                884  printer->add_line("/** all global variables */");
                -
                885  printer->fmt_push_block("struct {}", global_struct());
                -
                886 
                -
                887  if (!info.ions.empty()) {
                -
                888  // TODO implement these when needed.
                -
                889  }
                -
                890 
                -
                891  if (!info.vectorize && !info.top_local_variables.empty()) {
                -
                892  throw std::runtime_error("Not implemented, global vectorize something.");
                -
                893  }
                -
                894 
                -
                895  if (!info.thread_variables.empty()) {
                -
                896  size_t prefix_sum = 0;
                -
                897  for (size_t i = 0; i < info.thread_variables.size(); ++i) {
                -
                898  const auto& var = info.thread_variables[i];
                -
                899  codegen_thread_variables.push_back({var, i, prefix_sum});
                -
                900 
                -
                901  prefix_sum += var->get_length();
                -
                902  }
                -
                903  }
                -
                904 
                -
                905  if (!info.top_local_variables.empty()) {
                -
                906  size_t prefix_sum = info.thread_var_data_size;
                -
                907  size_t n_thread_vars = codegen_thread_variables.size();
                -
                908  for (size_t i = 0; i < info.top_local_variables.size(); ++i) {
                -
                909  const auto& var = info.top_local_variables[i];
                -
                910  codegen_thread_variables.push_back({var, n_thread_vars + i, prefix_sum});
                +
                761 
                +
                762 
                + +
                764  printer->add_newline();
                +
                765  printer->add_multi_line(R"CODE(
                +
                766  #include <Eigen/Dense>
                +
                767  #include <Eigen/LU>
                +
                768  #include <math.h>
                +
                769  #include <stdio.h>
                +
                770  #include <stdlib.h>
                +
                771  )CODE");
                +
                772  printer->add_multi_line(nmodl::solvers::newton_hpp);
                +
                773  if (!info.vectorize) {
                +
                774  printer->add_line("#include <vector>");
                +
                775  }
                +
                776 }
                +
                777 
                +
                778 
                + +
                780  printer->add_newline();
                +
                781  printer->add_multi_line(R"CODE(
                +
                782  #include "mech_api.h"
                +
                783  #include "neuron/cache/mechanism_range.hpp"
                +
                784  #include "nrniv_mf.h"
                +
                785  #include "section_fwd.hpp"
                +
                786  )CODE");
                +
                787 }
                +
                788 
                +
                789 
                +
                790 void CodegenNeuronCppVisitor::print_sdlists_init([[maybe_unused]] bool print_initializers) {
                +
                791  /// _initlists() should only be called once by the mechanism registration function
                +
                792  /// (_<mod_file>_reg())
                +
                793  printer->add_newline(2);
                +
                794  printer->push_block("static void _initlists()");
                +
                795  for (auto i = 0; i < info.prime_variables_by_order.size(); ++i) {
                +
                796  const auto& prime_var = info.prime_variables_by_order[i];
                +
                797  /// TODO: Something similar needs to happen for slist/dlist2 but I don't know their usage at
                +
                798  // the moment
                +
                799  /// TODO: We have to do checks and add errors similar to nocmodl in the
                +
                800  // SemanticAnalysisVisitor
                +
                801  if (prime_var->is_array()) {
                +
                802  /// TODO: Needs a for loop here. Look at
                +
                803  // https://github.com/neuronsimulator/nrn/blob/df001a436bcb4e23d698afe66c2a513819a6bfe8/src/nmodl/deriv.cpp#L524
                +
                804  /// TODO: Also needs a test
                +
                805  printer->fmt_push_block("for (int _i = 0; _i < {}; ++_i)", prime_var->get_length());
                +
                806  printer->fmt_line("/* {}[{}] */", prime_var->get_name(), prime_var->get_length());
                +
                807  printer->fmt_line("_slist1[{}+_i] = {{{}, _i}};",
                +
                808  i,
                +
                809  position_of_float_var(prime_var->get_name()));
                +
                810  const auto prime_var_deriv_name = "D" + prime_var->get_name();
                +
                811  printer->fmt_line("/* {}[{}] */", prime_var_deriv_name, prime_var->get_length());
                +
                812  printer->fmt_line("_dlist1[{}+_i] = {{{}, _i}};",
                +
                813  i,
                +
                814  position_of_float_var(prime_var_deriv_name));
                +
                815  printer->pop_block();
                +
                816  } else {
                +
                817  printer->fmt_line("/* {} */", prime_var->get_name());
                +
                818  printer->fmt_line("_slist1[{}] = {{{}, 0}};",
                +
                819  i,
                +
                820  position_of_float_var(prime_var->get_name()));
                +
                821  const auto prime_var_deriv_name = "D" + prime_var->get_name();
                +
                822  printer->fmt_line("/* {} */", prime_var_deriv_name);
                +
                823  printer->fmt_line("_dlist1[{}] = {{{}, 0}};",
                +
                824  i,
                +
                825  position_of_float_var(prime_var_deriv_name));
                +
                826  }
                +
                827  }
                +
                828  printer->pop_block();
                +
                829 }
                +
                830 
                + +
                832  auto params = internal_method_parameters();
                +
                833  params.push_back({"", "double", "", "v"});
                +
                834 
                +
                835  return params;
                +
                836 }
                +
                837 
                + +
                839  const auto value_initialize = print_initializers ? "{}" : "";
                +
                840 
                +
                841  /// TODO: Print only global variables printed in NEURON
                +
                842  printer->add_newline(2);
                +
                843  printer->add_line("/* NEURON global variables */");
                +
                844  if (info.primes_size != 0) {
                +
                845  printer->fmt_line("static neuron::container::field_index _slist1[{0}], _dlist1[{0}];",
                +
                846  info.primes_size);
                +
                847  }
                +
                848 
                +
                849  for (const auto& ion: info.ions) {
                +
                850  printer->fmt_line("static Symbol* _{}_sym;", ion.name);
                +
                851  }
                +
                852 
                +
                853  printer->add_line("static int mech_type;");
                +
                854 
                +
                855  if (info.point_process) {
                +
                856  printer->add_line("static int _pointtype;");
                +
                857  } else {
                +
                858  printer->add_multi_line(R"CODE(
                +
                859  static Prop* _extcall_prop;
                +
                860  /* _prop_id kind of shadows _extcall_prop to allow validity checking. */
                +
                861  static _nrn_non_owning_id_without_container _prop_id{};)CODE");
                +
                862  }
                +
                863 
                +
                864  printer->fmt_line("static int {} = {};",
                + +
                866  info.pointer_variables.size() > 0
                +
                867  ? static_cast<int>(info.pointer_variables.size())
                +
                868  : -1);
                +
                869 
                +
                870  printer->add_line("static _nrn_mechanism_std_vector<Datum> _extcall_thread;");
                +
                871 
                +
                872  // Start printing the CNRN-style global variables.
                +
                873  auto float_type = default_float_data_type();
                +
                874  printer->add_newline(2);
                +
                875  printer->add_line("/** all global variables */");
                +
                876  printer->fmt_push_block("struct {}", global_struct());
                +
                877 
                +
                878  if (!info.ions.empty()) {
                +
                879  // TODO implement these when needed.
                +
                880  }
                +
                881 
                +
                882  if (!info.vectorize && !info.top_local_variables.empty()) {
                +
                883  throw std::runtime_error("Not implemented, global vectorize something.");
                +
                884  }
                +
                885 
                +
                886  if (!info.thread_variables.empty()) {
                +
                887  size_t prefix_sum = 0;
                +
                888  for (size_t i = 0; i < info.thread_variables.size(); ++i) {
                +
                889  const auto& var = info.thread_variables[i];
                +
                890  codegen_thread_variables.push_back({var, i, prefix_sum});
                +
                891 
                +
                892  prefix_sum += var->get_length();
                +
                893  }
                +
                894  }
                +
                895 
                +
                896  if (!info.top_local_variables.empty()) {
                +
                897  size_t prefix_sum = info.thread_var_data_size;
                +
                898  size_t n_thread_vars = codegen_thread_variables.size();
                +
                899  for (size_t i = 0; i < info.top_local_variables.size(); ++i) {
                +
                900  const auto& var = info.top_local_variables[i];
                +
                901  codegen_thread_variables.push_back({var, n_thread_vars + i, prefix_sum});
                +
                902 
                +
                903  prefix_sum += var->get_length();
                +
                904  }
                +
                905  }
                +
                906 
                +
                907  if (!codegen_thread_variables.empty()) {
                +
                908  auto thread_data_size = info.thread_var_data_size + info.top_local_thread_size;
                +
                909  printer->fmt_line("int thread_data_in_use{};", value_initialize);
                +
                910  printer->fmt_line("{} thread_data[{}];", float_type, thread_data_size);
                911 
                -
                912  prefix_sum += var->get_length();
                -
                913  }
                -
                914  }
                -
                915 
                -
                916  if (!codegen_thread_variables.empty()) {
                -
                917  auto thread_data_size = info.thread_var_data_size + info.top_local_thread_size;
                -
                918  printer->fmt_line("int thread_data_in_use{};", value_initialize);
                -
                919  printer->fmt_line("{} thread_data[{}];", float_type, thread_data_size);
                -
                920 
                -
                921  codegen_global_variables.push_back(make_symbol("thread_data_in_use"));
                -
                922 
                -
                923  auto symbol = make_symbol("thread_data");
                -
                924  symbol->set_as_array(thread_data_size);
                -
                925  codegen_global_variables.push_back(symbol);
                -
                926  }
                -
                927 
                -
                928 
                -
                929  if (info.table_count > 0) {
                -
                930  // basically the same code as coreNEURON uses
                -
                931  printer->fmt_line("double usetable{};", print_initializers ? "{1}" : "");
                -
                932  codegen_global_variables.push_back(make_symbol(naming::USE_TABLE_VARIABLE));
                -
                933 
                -
                934  for (const auto& block: info.functions_with_table) {
                -
                935  const auto& name = block->get_node_name();
                -
                936  printer->fmt_line("{} tmin_{}{};", float_type, name, value_initialize);
                -
                937  printer->fmt_line("{} mfac_{}{};", float_type, name, value_initialize);
                -
                938  codegen_global_variables.push_back(make_symbol("tmin_" + name));
                -
                939  codegen_global_variables.push_back(make_symbol("mfac_" + name));
                -
                940  }
                -
                941 
                -
                942  for (const auto& variable: info.table_statement_variables) {
                -
                943  auto const name = "t_" + variable->get_name();
                -
                944  auto const num_values = variable->get_num_values();
                -
                945  if (variable->is_array()) {
                -
                946  int array_len = variable->get_length();
                -
                947  printer->fmt_line(
                -
                948  "{} {}[{}][{}]{};", float_type, name, array_len, num_values, value_initialize);
                -
                949  } else {
                -
                950  printer->fmt_line("{} {}[{}]{};", float_type, name, num_values, value_initialize);
                -
                951  }
                +
                912  codegen_global_variables.push_back(make_symbol("thread_data_in_use"));
                +
                913 
                +
                914  auto symbol = make_symbol("thread_data");
                +
                915  symbol->set_as_array(thread_data_size);
                +
                916  codegen_global_variables.push_back(symbol);
                +
                917  }
                +
                918 
                +
                919 
                +
                920  if (info.table_count > 0) {
                +
                921  // basically the same code as coreNEURON uses
                +
                922  printer->fmt_line("double usetable{};", print_initializers ? "{1}" : "");
                +
                923  codegen_global_variables.push_back(make_symbol(naming::USE_TABLE_VARIABLE));
                +
                924 
                +
                925  for (const auto& block: info.functions_with_table) {
                +
                926  const auto& name = block->get_node_name();
                +
                927  printer->fmt_line("{} tmin_{}{};", float_type, name, value_initialize);
                +
                928  printer->fmt_line("{} mfac_{}{};", float_type, name, value_initialize);
                +
                929  codegen_global_variables.push_back(make_symbol("tmin_" + name));
                +
                930  codegen_global_variables.push_back(make_symbol("mfac_" + name));
                +
                931  }
                +
                932 
                +
                933  for (const auto& variable: info.table_statement_variables) {
                +
                934  auto const name = "t_" + variable->get_name();
                +
                935  auto const num_values = variable->get_num_values();
                +
                936  if (variable->is_array()) {
                +
                937  int array_len = variable->get_length();
                +
                938  printer->fmt_line(
                +
                939  "{} {}[{}][{}]{};", float_type, name, array_len, num_values, value_initialize);
                +
                940  } else {
                +
                941  printer->fmt_line("{} {}[{}]{};", float_type, name, num_values, value_initialize);
                +
                942  }
                +
                943  codegen_global_variables.push_back(make_symbol(name));
                +
                944  }
                +
                945  }
                +
                946 
                +
                947  for (const auto& var: info.state_vars) {
                +
                948  auto name = var->get_name() + "0";
                +
                949  auto symbol = program_symtab->lookup(name);
                +
                950  if (symbol == nullptr) {
                +
                951  printer->fmt_line("{} {}{};", float_type, name, value_initialize);
                952  codegen_global_variables.push_back(make_symbol(name));
                953  }
                954  }
                955 
                -
                956  for (const auto& var: info.state_vars) {
                -
                957  auto name = var->get_name() + "0";
                -
                958  auto symbol = program_symtab->lookup(name);
                -
                959  if (symbol == nullptr) {
                -
                960  printer->fmt_line("{} {}{};", float_type, name, value_initialize);
                -
                961  codegen_global_variables.push_back(make_symbol(name));
                -
                962  }
                -
                963  }
                -
                964 
                -
                965  for (const auto& var: info.global_variables) {
                -
                966  auto name = var->get_name();
                -
                967  auto length = var->get_length();
                -
                968  if (var->is_array()) {
                -
                969  printer->fmt_line("{} {}[{}] /* TODO init const-array */;", float_type, name, length);
                -
                970  } else {
                -
                971  double value{};
                -
                972  if (auto const& value_ptr = var->get_value()) {
                -
                973  value = *value_ptr;
                -
                974  }
                -
                975  printer->fmt_line("{} {}{};",
                -
                976  float_type,
                -
                977  name,
                -
                978  print_initializers ? fmt::format("{{{:g}}}", value) : std::string{});
                -
                979  }
                -
                980  codegen_global_variables.push_back(var);
                -
                981  }
                -
                982 
                -
                983  for (const auto& var: info.constant_variables) {
                -
                984  auto const name = var->get_name();
                -
                985  auto* const value_ptr = var->get_value().get();
                -
                986  double const value{value_ptr ? *value_ptr : 0};
                -
                987  printer->fmt_line("{} {}{};",
                -
                988  float_type,
                -
                989  name,
                -
                990  print_initializers ? fmt::format("{{{:g}}}", value) : std::string{});
                -
                991  codegen_global_variables.push_back(var);
                -
                992  }
                -
                993 
                -
                994 
                -
                995  // for (const auto& f: info.function_tables) {
                -
                996  if (!info.function_tables.empty()) {
                -
                997  throw std::runtime_error("Not implemented, global function tables.");
                -
                998  }
                -
                999 
                -
                1000  if (info.vectorize && info.thread_data_index) {
                -
                1001  // TODO compare CoreNEURON something extcall stuff.
                -
                1002  // throw std::runtime_error("Not implemented, global vectorize something else.");
                -
                1003  }
                -
                1004 
                -
                1005  printer->pop_block(";");
                -
                1006 
                -
                1007  print_global_var_struct_assertions();
                -
                1008  print_global_var_struct_decl();
                -
                1009 }
                -
                1010 
                -
                1011 /// TODO: Same as CoreNEURON?
                - -
                1013  /// TODO: Write HocParmLimits and other HOC global variables (delta_t)
                -
                1014  // Probably needs more changes
                -
                1015  auto variable_printer =
                -
                1016  [&](const std::vector<SymbolType>& variables, bool if_array, bool if_vector) {
                -
                1017  for (const auto& variable: variables) {
                -
                1018  if (variable->is_array() == if_array) {
                -
                1019  // false => do not use the instance struct, which is not
                -
                1020  // defined in the global declaration that we are printing
                -
                1021  auto name = get_variable_name(variable->get_name(), false);
                -
                1022  auto ename = add_escape_quote(variable->get_name() + "_" + info.mod_suffix);
                -
                1023  auto length = variable->get_length();
                -
                1024  if (if_vector) {
                -
                1025  printer->fmt_line("{{{}, {}, {}}},", ename, name, length);
                -
                1026  } else {
                -
                1027  printer->fmt_line("{{{}, &{}}},", ename, name);
                -
                1028  }
                -
                1029  }
                -
                1030  }
                -
                1031  };
                -
                1032 
                -
                1033  auto globals = info.global_variables;
                -
                1034  auto thread_vars = info.thread_variables;
                -
                1035 
                -
                1036  if (info.table_count > 0) {
                -
                1037  globals.push_back(make_symbol(naming::USE_TABLE_VARIABLE));
                -
                1038  }
                -
                1039 
                -
                1040  printer->add_newline(2);
                -
                1041  printer->add_line("/** connect global (scalar) variables to hoc -- */");
                -
                1042  printer->add_line("static DoubScal hoc_scalar_double[] = {");
                -
                1043  printer->increase_indent();
                -
                1044  variable_printer(globals, false, false);
                -
                1045  variable_printer(thread_vars, false, false);
                -
                1046  printer->add_line("{nullptr, nullptr}");
                -
                1047  printer->decrease_indent();
                -
                1048  printer->add_line("};");
                -
                1049 
                -
                1050  printer->add_newline(2);
                -
                1051  printer->add_line("/** connect global (array) variables to hoc -- */");
                -
                1052  printer->add_line("static DoubVec hoc_vector_double[] = {");
                -
                1053  printer->increase_indent();
                -
                1054  variable_printer(globals, true, true);
                -
                1055  variable_printer(thread_vars, true, true);
                -
                1056  printer->add_line("{nullptr, nullptr, 0}");
                -
                1057  printer->decrease_indent();
                -
                1058  printer->add_line("};");
                -
                1059 
                -
                1060  printer->add_newline(2);
                -
                1061  printer->add_line("/* declaration of user functions */");
                -
                1062  for (const auto& procedure: info.procedures) {
                -
                1063  const auto proc_name = procedure->get_node_name();
                -
                1064  printer->fmt_line("{};", hoc_function_signature(proc_name));
                -
                1065  }
                -
                1066  for (const auto& function: info.functions) {
                -
                1067  const auto func_name = function->get_node_name();
                -
                1068  printer->fmt_line("{};", hoc_function_signature(func_name));
                -
                1069  }
                -
                1070  if (!info.point_process) {
                -
                1071  for (const auto& procedure: info.procedures) {
                -
                1072  const auto proc_name = procedure->get_node_name();
                -
                1073  printer->fmt_line("{};", py_function_signature(proc_name));
                -
                1074  }
                -
                1075  for (const auto& function: info.functions) {
                -
                1076  const auto func_name = function->get_node_name();
                -
                1077  printer->fmt_line("{};", py_function_signature(func_name));
                -
                1078  }
                -
                1079  }
                -
                1080 
                -
                1081  printer->add_newline(2);
                -
                1082  printer->add_line("/* connect user functions to hoc names */");
                -
                1083  printer->add_line("static VoidFunc hoc_intfunc[] = {");
                -
                1084  printer->increase_indent();
                -
                1085  if (info.point_process) {
                -
                1086  printer->add_line("{0, 0}");
                -
                1087  printer->decrease_indent();
                -
                1088  printer->add_line("};");
                -
                1089  printer->add_line("static Member_func _member_func[] = {");
                -
                1090  printer->increase_indent();
                -
                1091  printer->add_multi_line(R"CODE(
                -
                1092  {"loc", _hoc_loc_pnt},
                -
                1093  {"has_loc", _hoc_has_loc},
                -
                1094  {"get_loc", _hoc_get_loc_pnt},)CODE");
                -
                1095  } else {
                -
                1096  printer->fmt_line("{{\"setdata_{}\", _hoc_setdata}},", info.mod_suffix);
                -
                1097  }
                -
                1098 
                -
                1099  for (const auto& procedure: info.procedures) {
                -
                1100  const auto proc_name = procedure->get_node_name();
                -
                1101  printer->fmt_line("{{\"{}{}\", {}}},",
                -
                1102  proc_name,
                -
                1103  info.rsuffix,
                -
                1104  hoc_function_name(proc_name));
                -
                1105  }
                -
                1106  for (const auto& function: info.functions) {
                -
                1107  const auto func_name = function->get_node_name();
                -
                1108  printer->fmt_line("{{\"{}{}\", {}}},",
                -
                1109  func_name,
                -
                1110  info.rsuffix,
                -
                1111  hoc_function_name(func_name));
                -
                1112  }
                -
                1113 
                -
                1114  printer->add_line("{nullptr, nullptr}");
                -
                1115  printer->decrease_indent();
                -
                1116  printer->add_line("};");
                -
                1117  if (!info.point_process) {
                -
                1118  printer->push_block("static NPyDirectMechFunc npy_direct_func_proc[] =");
                -
                1119  for (const auto& procedure: info.procedures) {
                -
                1120  const auto proc_name = procedure->get_node_name();
                -
                1121  printer->fmt_line("{{\"{}\", {}}},", proc_name, py_function_name(proc_name));
                -
                1122  }
                -
                1123  for (const auto& function: info.functions) {
                -
                1124  const auto func_name = function->get_node_name();
                -
                1125  printer->fmt_line("{{\"{}\", {}}},", func_name, py_function_name(func_name));
                -
                1126  }
                -
                1127  printer->add_line("{nullptr, nullptr}");
                -
                1128  printer->pop_block(";");
                -
                1129  }
                -
                1130 }
                -
                1131 
                - -
                1133  /// TODO: Write this according to NEURON
                -
                1134  printer->add_newline(2);
                -
                1135  printer->add_line("/** register channel with the simulator */");
                -
                1136  printer->fmt_push_block("extern \"C\" void _{}_reg()", info.mod_file);
                -
                1137  printer->add_line("_initlists();");
                -
                1138  printer->add_newline();
                -
                1139 
                -
                1140  for (const auto& ion: info.ions) {
                -
                1141  printer->fmt_line("ion_reg(\"{}\", {});", ion.name, "-10000.");
                -
                1142  }
                -
                1143  if (!info.ions.empty()) {
                -
                1144  printer->add_newline();
                -
                1145  }
                -
                1146 
                -
                1147  for (const auto& ion: info.ions) {
                -
                1148  printer->fmt_line("_{0}_sym = hoc_lookup(\"{0}_ion\");", ion.name);
                -
                1149  }
                -
                1150  if (!info.ions.empty()) {
                -
                1151  printer->add_newline();
                -
                1152  }
                -
                1153 
                -
                1154  const auto compute_functions_parameters =
                -
                1155  breakpoint_exist()
                -
                1156  ? fmt::format("{}, {}, {}",
                -
                1157  nrn_cur_required() ? method_name(naming::NRN_CUR_METHOD) : "nullptr",
                -
                1158  method_name(naming::NRN_JACOB_METHOD),
                -
                1159  nrn_state_required() ? method_name(naming::NRN_STATE_METHOD) : "nullptr")
                -
                1160  : "nullptr, nullptr, nullptr";
                -
                1161  const auto register_mech_args = fmt::format("{}, {}, {}, {}, {}, {}",
                -
                1162  get_channel_info_var_name(),
                -
                1163  method_name(naming::NRN_ALLOC_METHOD),
                -
                1164  compute_functions_parameters,
                -
                1165  method_name(naming::NRN_INIT_METHOD),
                - -
                1167  1 + info.thread_data_index);
                -
                1168  if (info.point_process) {
                -
                1169  printer->fmt_line(
                -
                1170  "_pointtype = point_register_mech({}, _hoc_create_pnt, _hoc_destroy_pnt, "
                -
                1171  "_member_func);",
                -
                1172  register_mech_args);
                -
                1173  } else {
                -
                1174  printer->fmt_line("register_mech({});", register_mech_args);
                -
                1175  }
                -
                1176 
                -
                1177  /// type related information
                -
                1178  printer->add_newline();
                -
                1179  printer->fmt_line("mech_type = nrn_get_mechtype({}[1]);", get_channel_info_var_name());
                -
                1180 
                -
                1181  // register the table-checking function
                -
                1182  if (info.table_count > 0) {
                -
                1183  printer->fmt_line("_nrn_thread_table_reg(mech_type, {});", table_thread_function_name());
                -
                1184  }
                -
                1185 
                -
                1186  /// Call _nrn_mechanism_register_data_fields() with the correct arguments
                -
                1187  /// Geenerated code follows the style underneath
                -
                1188  ///
                -
                1189  /// _nrn_mechanism_register_data_fields(mech_type,
                -
                1190  /// _nrn_mechanism_field<double>{"var_name"}, /* float var index 0 */
                -
                1191  /// ...
                -
                1192  /// );
                -
                1193  ///
                -
                1194  /// TODO: More things to add here
                -
                1195  printer->add_line("_nrn_mechanism_register_data_fields(mech_type,");
                -
                1196  printer->increase_indent();
                -
                1197 
                -
                1198  const auto codegen_float_variables_size = codegen_float_variables.size();
                -
                1199  std::vector<std::string> mech_register_args;
                -
                1200 
                -
                1201  for (int i = 0; i < codegen_float_variables_size; ++i) {
                -
                1202  const auto& float_var = codegen_float_variables[i];
                -
                1203  if (float_var->is_array()) {
                -
                1204  mech_register_args.push_back(
                -
                1205  fmt::format("_nrn_mechanism_field<double>{{\"{}\", {}}} /* {} */",
                -
                1206  float_var->get_name(),
                -
                1207  float_var->get_length(),
                -
                1208  i));
                -
                1209  } else {
                -
                1210  mech_register_args.push_back(fmt::format(
                -
                1211  "_nrn_mechanism_field<double>{{\"{}\"}} /* {} */", float_var->get_name(), i));
                -
                1212  }
                -
                1213  }
                +
                956  for (const auto& var: info.global_variables) {
                +
                957  auto name = var->get_name();
                +
                958  auto length = var->get_length();
                +
                959  if (var->is_array()) {
                +
                960  printer->fmt_line("{} {}[{}] /* TODO init const-array */;", float_type, name, length);
                +
                961  } else {
                +
                962  double value{};
                +
                963  if (auto const& value_ptr = var->get_value()) {
                +
                964  value = *value_ptr;
                +
                965  }
                +
                966  printer->fmt_line("{} {}{};",
                +
                967  float_type,
                +
                968  name,
                +
                969  print_initializers ? fmt::format("{{{:g}}}", value) : std::string{});
                +
                970  }
                +
                971  codegen_global_variables.push_back(var);
                +
                972  }
                +
                973 
                +
                974  for (const auto& var: info.constant_variables) {
                +
                975  auto const name = var->get_name();
                +
                976  auto* const value_ptr = var->get_value().get();
                +
                977  double const value{value_ptr ? *value_ptr : 0};
                +
                978  printer->fmt_line("{} {}{};",
                +
                979  float_type,
                +
                980  name,
                +
                981  print_initializers ? fmt::format("{{{:g}}}", value) : std::string{});
                +
                982  codegen_global_variables.push_back(var);
                +
                983  }
                +
                984 
                +
                985 
                +
                986  // for (const auto& f: info.function_tables) {
                +
                987  if (!info.function_tables.empty()) {
                +
                988  throw std::runtime_error("Not implemented, global function tables.");
                +
                989  }
                +
                990 
                +
                991  if (info.vectorize && info.thread_data_index) {
                +
                992  // TODO compare CoreNEURON something extcall stuff.
                +
                993  // throw std::runtime_error("Not implemented, global vectorize something else.");
                +
                994  }
                +
                995 
                +
                996  printer->pop_block(";");
                +
                997 
                +
                998  print_global_var_struct_assertions();
                +
                999  print_global_var_struct_decl();
                +
                1000 }
                +
                1001 
                +
                1002 /// TODO: Same as CoreNEURON?
                + +
                1004  /// TODO: Write HocParmLimits and other HOC global variables (delta_t)
                +
                1005  // Probably needs more changes
                +
                1006  auto variable_printer =
                +
                1007  [&](const std::vector<SymbolType>& variables, bool if_array, bool if_vector) {
                +
                1008  for (const auto& variable: variables) {
                +
                1009  if (variable->is_array() == if_array) {
                +
                1010  // false => do not use the instance struct, which is not
                +
                1011  // defined in the global declaration that we are printing
                +
                1012  auto name = get_variable_name(variable->get_name(), false);
                +
                1013  auto ename = add_escape_quote(variable->get_name() + "_" + info.mod_suffix);
                +
                1014  auto length = variable->get_length();
                +
                1015  if (if_vector) {
                +
                1016  printer->fmt_line("{{{}, {}, {}}},", ename, name, length);
                +
                1017  } else {
                +
                1018  printer->fmt_line("{{{}, &{}}},", ename, name);
                +
                1019  }
                +
                1020  }
                +
                1021  }
                +
                1022  };
                +
                1023 
                +
                1024  auto globals = info.global_variables;
                +
                1025  auto thread_vars = info.thread_variables;
                +
                1026 
                +
                1027  if (info.table_count > 0) {
                +
                1028  globals.push_back(make_symbol(naming::USE_TABLE_VARIABLE));
                +
                1029  }
                +
                1030 
                +
                1031  printer->add_newline(2);
                +
                1032  printer->add_line("/** connect global (scalar) variables to hoc -- */");
                +
                1033  printer->add_line("static DoubScal hoc_scalar_double[] = {");
                +
                1034  printer->increase_indent();
                +
                1035  variable_printer(globals, false, false);
                +
                1036  variable_printer(thread_vars, false, false);
                +
                1037  printer->add_line("{nullptr, nullptr}");
                +
                1038  printer->decrease_indent();
                +
                1039  printer->add_line("};");
                +
                1040 
                +
                1041  printer->add_newline(2);
                +
                1042  printer->add_line("/** connect global (array) variables to hoc -- */");
                +
                1043  printer->add_line("static DoubVec hoc_vector_double[] = {");
                +
                1044  printer->increase_indent();
                +
                1045  variable_printer(globals, true, true);
                +
                1046  variable_printer(thread_vars, true, true);
                +
                1047  printer->add_line("{nullptr, nullptr, 0}");
                +
                1048  printer->decrease_indent();
                +
                1049  printer->add_line("};");
                +
                1050 
                +
                1051  printer->add_newline(2);
                +
                1052  printer->add_line("/* declaration of user functions */");
                +
                1053  for (const auto& procedure: info.procedures) {
                +
                1054  const auto proc_name = procedure->get_node_name();
                +
                1055  printer->fmt_line("{};", hoc_function_signature(proc_name));
                +
                1056  }
                +
                1057  for (const auto& function: info.functions) {
                +
                1058  const auto func_name = function->get_node_name();
                +
                1059  printer->fmt_line("{};", hoc_function_signature(func_name));
                +
                1060  }
                +
                1061  if (!info.point_process) {
                +
                1062  for (const auto& procedure: info.procedures) {
                +
                1063  const auto proc_name = procedure->get_node_name();
                +
                1064  printer->fmt_line("{};", py_function_signature(proc_name));
                +
                1065  }
                +
                1066  for (const auto& function: info.functions) {
                +
                1067  const auto func_name = function->get_node_name();
                +
                1068  printer->fmt_line("{};", py_function_signature(func_name));
                +
                1069  }
                +
                1070  }
                +
                1071 
                +
                1072  printer->add_newline(2);
                +
                1073  printer->add_line("/* connect user functions to hoc names */");
                +
                1074  printer->add_line("static VoidFunc hoc_intfunc[] = {");
                +
                1075  printer->increase_indent();
                +
                1076  if (info.point_process) {
                +
                1077  printer->add_line("{0, 0}");
                +
                1078  printer->decrease_indent();
                +
                1079  printer->add_line("};");
                +
                1080  printer->add_line("static Member_func _member_func[] = {");
                +
                1081  printer->increase_indent();
                +
                1082  printer->add_multi_line(R"CODE(
                +
                1083  {"loc", _hoc_loc_pnt},
                +
                1084  {"has_loc", _hoc_has_loc},
                +
                1085  {"get_loc", _hoc_get_loc_pnt},)CODE");
                +
                1086  } else {
                +
                1087  printer->fmt_line("{{\"setdata_{}\", _hoc_setdata}},", info.mod_suffix);
                +
                1088  }
                +
                1089 
                +
                1090  for (const auto& procedure: info.procedures) {
                +
                1091  const auto proc_name = procedure->get_node_name();
                +
                1092  printer->fmt_line("{{\"{}{}\", {}}},",
                +
                1093  proc_name,
                +
                1094  info.rsuffix,
                +
                1095  hoc_function_name(proc_name));
                +
                1096  }
                +
                1097  for (const auto& function: info.functions) {
                +
                1098  const auto func_name = function->get_node_name();
                +
                1099  printer->fmt_line("{{\"{}{}\", {}}},",
                +
                1100  func_name,
                +
                1101  info.rsuffix,
                +
                1102  hoc_function_name(func_name));
                +
                1103  }
                +
                1104 
                +
                1105  printer->add_line("{nullptr, nullptr}");
                +
                1106  printer->decrease_indent();
                +
                1107  printer->add_line("};");
                +
                1108  if (!info.point_process) {
                +
                1109  printer->push_block("static NPyDirectMechFunc npy_direct_func_proc[] =");
                +
                1110  for (const auto& procedure: info.procedures) {
                +
                1111  const auto proc_name = procedure->get_node_name();
                +
                1112  printer->fmt_line("{{\"{}\", {}}},", proc_name, py_function_name(proc_name));
                +
                1113  }
                +
                1114  for (const auto& function: info.functions) {
                +
                1115  const auto func_name = function->get_node_name();
                +
                1116  printer->fmt_line("{{\"{}\", {}}},", func_name, py_function_name(func_name));
                +
                1117  }
                +
                1118  printer->add_line("{nullptr, nullptr}");
                +
                1119  printer->pop_block(";");
                +
                1120  }
                +
                1121 }
                +
                1122 
                + +
                1124  /// TODO: Write this according to NEURON
                +
                1125  printer->add_newline(2);
                +
                1126  printer->add_line("/** register channel with the simulator */");
                +
                1127  printer->fmt_push_block("extern \"C\" void _{}_reg()", info.mod_file);
                +
                1128  printer->add_line("_initlists();");
                +
                1129  printer->add_newline();
                +
                1130 
                +
                1131  for (const auto& ion: info.ions) {
                +
                1132  double valence = ion.valence.value_or(-10000.0);
                +
                1133  printer->fmt_line("ion_reg(\"{}\", {});", ion.name, valence);
                +
                1134  }
                +
                1135  if (!info.ions.empty()) {
                +
                1136  printer->add_newline();
                +
                1137  }
                +
                1138 
                +
                1139  for (const auto& ion: info.ions) {
                +
                1140  printer->fmt_line("_{0}_sym = hoc_lookup(\"{0}_ion\");", ion.name);
                +
                1141  }
                +
                1142  if (!info.ions.empty()) {
                +
                1143  printer->add_newline();
                +
                1144  }
                +
                1145 
                +
                1146  const auto compute_functions_parameters =
                +
                1147  breakpoint_exist()
                +
                1148  ? fmt::format("{}, {}, {}",
                +
                1149  nrn_cur_required() ? method_name(naming::NRN_CUR_METHOD) : "nullptr",
                +
                1150  method_name(naming::NRN_JACOB_METHOD),
                +
                1151  nrn_state_required() ? method_name(naming::NRN_STATE_METHOD) : "nullptr")
                +
                1152  : "nullptr, nullptr, nullptr";
                +
                1153  const auto register_mech_args = fmt::format("{}, {}, {}, {}, {}, {}",
                +
                1154  get_channel_info_var_name(),
                +
                1155  method_name(naming::NRN_ALLOC_METHOD),
                +
                1156  compute_functions_parameters,
                +
                1157  method_name(naming::NRN_INIT_METHOD),
                + +
                1159  1 + info.thread_data_index);
                +
                1160  if (info.point_process) {
                +
                1161  printer->fmt_line(
                +
                1162  "_pointtype = point_register_mech({}, _hoc_create_pnt, _hoc_destroy_pnt, "
                +
                1163  "_member_func);",
                +
                1164  register_mech_args);
                +
                1165  } else {
                +
                1166  printer->fmt_line("register_mech({});", register_mech_args);
                +
                1167  }
                +
                1168 
                +
                1169  /// type related information
                +
                1170  printer->add_newline();
                +
                1171  printer->fmt_line("mech_type = nrn_get_mechtype({}[1]);", get_channel_info_var_name());
                +
                1172 
                +
                1173  // register the table-checking function
                +
                1174  if (info.table_count > 0) {
                +
                1175  printer->fmt_line("_nrn_thread_table_reg(mech_type, {});", table_thread_function_name());
                +
                1176  }
                +
                1177 
                +
                1178  /// Call _nrn_mechanism_register_data_fields() with the correct arguments
                +
                1179  /// Geenerated code follows the style underneath
                +
                1180  ///
                +
                1181  /// _nrn_mechanism_register_data_fields(mech_type,
                +
                1182  /// _nrn_mechanism_field<double>{"var_name"}, /* float var index 0 */
                +
                1183  /// ...
                +
                1184  /// );
                +
                1185  ///
                +
                1186  /// TODO: More things to add here
                +
                1187  printer->add_line("_nrn_mechanism_register_data_fields(mech_type,");
                +
                1188  printer->increase_indent();
                +
                1189 
                +
                1190  const auto codegen_float_variables_size = codegen_float_variables.size();
                +
                1191  std::vector<std::string> mech_register_args;
                +
                1192 
                +
                1193  for (int i = 0; i < codegen_float_variables_size; ++i) {
                +
                1194  const auto& float_var = codegen_float_variables[i];
                +
                1195  if (float_var->is_array()) {
                +
                1196  mech_register_args.push_back(
                +
                1197  fmt::format("_nrn_mechanism_field<double>{{\"{}\", {}}} /* {} */",
                +
                1198  float_var->get_name(),
                +
                1199  float_var->get_length(),
                +
                1200  i));
                +
                1201  } else {
                +
                1202  mech_register_args.push_back(fmt::format(
                +
                1203  "_nrn_mechanism_field<double>{{\"{}\"}} /* {} */", float_var->get_name(), i));
                +
                1204  }
                +
                1205  }
                +
                1206 
                +
                1207  const auto codegen_int_variables_size = codegen_int_variables.size();
                +
                1208  for (int i = 0; i < codegen_int_variables_size; ++i) {
                +
                1209  const auto& int_var = codegen_int_variables[i];
                +
                1210  const auto& name = int_var.symbol->get_name();
                +
                1211  if (i != info.semantics[i].index) {
                +
                1212  throw std::runtime_error("Broken logic.");
                +
                1213  }
                1214 
                -
                1215  const auto codegen_int_variables_size = codegen_int_variables.size();
                -
                1216  for (int i = 0; i < codegen_int_variables_size; ++i) {
                -
                1217  const auto& int_var = codegen_int_variables[i];
                -
                1218  const auto& name = int_var.symbol->get_name();
                -
                1219  if (i != info.semantics[i].index) {
                -
                1220  throw std::runtime_error("Broken logic.");
                -
                1221  }
                -
                1222 
                -
                1223  auto type = "double*";
                -
                1224  if (name == naming::POINT_PROCESS_VARIABLE) {
                -
                1225  type = "Point_process*";
                -
                1226  } else if (name == naming::TQITEM_VARIABLE) {
                -
                1227  type = "void*";
                -
                1228  } else if (stringutils::starts_with(name, "style_") &&
                -
                1229  stringutils::starts_with(info.semantics[i].name, "#") &&
                -
                1230  stringutils::ends_with(info.semantics[i].name, "_ion")) {
                -
                1231  type = "int*";
                -
                1232  }
                -
                1233 
                +
                1215  auto type = "double*";
                +
                1216  if (name == naming::POINT_PROCESS_VARIABLE) {
                +
                1217  type = "Point_process*";
                +
                1218  } else if (name == naming::TQITEM_VARIABLE) {
                +
                1219  type = "void*";
                +
                1220  } else if (stringutils::starts_with(name, "style_") &&
                +
                1221  stringutils::starts_with(info.semantics[i].name, "#") &&
                +
                1222  stringutils::ends_with(info.semantics[i].name, "_ion")) {
                +
                1223  type = "int*";
                +
                1224  }
                +
                1225 
                +
                1226  mech_register_args.push_back(
                +
                1227  fmt::format("_nrn_mechanism_field<{}>{{\"{}\", \"{}\"}} /* {} */",
                +
                1228  type,
                +
                1229  name,
                +
                1230  info.semantics[i].name,
                +
                1231  i));
                +
                1232  }
                +
                1233  if (info.emit_cvode) {
                1234  mech_register_args.push_back(
                -
                1235  fmt::format("_nrn_mechanism_field<{}>{{\"{}\", \"{}\"}} /* {} */",
                -
                1236  type,
                -
                1237  name,
                -
                1238  info.semantics[i].name,
                -
                1239  i));
                -
                1240  }
                -
                1241  if (info.emit_cvode) {
                -
                1242  mech_register_args.push_back(
                -
                1243  "_nrn_mechanism_field<int>{\"_cvode_ieq\", \"cvodeieq\"} /* 0 */");
                -
                1244  }
                -
                1245 
                -
                1246  printer->add_multi_line(fmt::format("{}", fmt::join(mech_register_args, ",\n")));
                -
                1247 
                -
                1248  printer->decrease_indent();
                -
                1249  printer->add_line(");");
                -
                1250  printer->add_newline();
                -
                1251 
                -
                1252 
                -
                1253  printer->fmt_line("hoc_register_prop_size(mech_type, {}, {});",
                -
                1254  float_variables_size(),
                -
                1255  int_variables_size());
                -
                1256 
                -
                1257  for (int i = 0; i < codegen_int_variables_size; ++i) {
                -
                1258  if (i != info.semantics[i].index) {
                -
                1259  throw std::runtime_error("Broken logic.");
                -
                1260  }
                -
                1261 
                -
                1262  printer->fmt_line("hoc_register_dparam_semantics(mech_type, {}, \"{}\");",
                -
                1263  i,
                -
                1264  info.semantics[i].name);
                +
                1235  "_nrn_mechanism_field<int>{\"_cvode_ieq\", \"cvodeieq\"} /* 0 */");
                +
                1236  }
                +
                1237 
                +
                1238  printer->add_multi_line(fmt::format("{}", fmt::join(mech_register_args, ",\n")));
                +
                1239 
                +
                1240  printer->decrease_indent();
                +
                1241  printer->add_line(");");
                +
                1242  printer->add_newline();
                +
                1243 
                +
                1244 
                +
                1245  printer->fmt_line("hoc_register_prop_size(mech_type, {}, {});",
                +
                1246  float_variables_size(),
                +
                1247  int_variables_size());
                +
                1248 
                +
                1249  for (int i = 0; i < codegen_int_variables_size; ++i) {
                +
                1250  if (i != info.semantics[i].index) {
                +
                1251  throw std::runtime_error("Broken logic.");
                +
                1252  }
                +
                1253 
                +
                1254  printer->fmt_line("hoc_register_dparam_semantics(mech_type, {}, \"{}\");",
                +
                1255  i,
                +
                1256  info.semantics[i].name);
                +
                1257  }
                +
                1258 
                +
                1259  if (info.write_concentration) {
                +
                1260  printer->fmt_line("nrn_writes_conc(mech_type, 0);");
                +
                1261  }
                +
                1262 
                +
                1263  if (info.artificial_cell) {
                +
                1264  printer->fmt_line("add_nrn_artcell(mech_type, {});", info.tqitem_index);
                1265  }
                1266 
                -
                1267  if (info.write_concentration) {
                -
                1268  printer->fmt_line("nrn_writes_conc(mech_type, 0);");
                -
                1269  }
                -
                1270 
                -
                1271  if (info.artificial_cell) {
                -
                1272  printer->fmt_line("add_nrn_artcell(mech_type, {});", info.tqitem_index);
                -
                1273  }
                -
                1274 
                -
                1275  printer->add_line("hoc_register_var(hoc_scalar_double, hoc_vector_double, hoc_intfunc);");
                -
                1276  if (!info.point_process) {
                -
                1277  printer->add_line("hoc_register_npy_direct(mech_type, npy_direct_func_proc);");
                -
                1278  }
                -
                1279  if (info.net_receive_node) {
                -
                1280  printer->fmt_line("pnt_receive[mech_type] = nrn_net_receive_{};", info.mod_suffix);
                -
                1281  printer->fmt_line("pnt_receive_size[mech_type] = {};", info.num_net_receive_parameters);
                -
                1282  }
                +
                1267  printer->add_line("hoc_register_var(hoc_scalar_double, hoc_vector_double, hoc_intfunc);");
                +
                1268  if (!info.point_process) {
                +
                1269  printer->add_line("hoc_register_npy_direct(mech_type, npy_direct_func_proc);");
                +
                1270  }
                +
                1271  if (info.net_receive_node) {
                +
                1272  printer->fmt_line("pnt_receive[mech_type] = nrn_net_receive_{};", info.mod_suffix);
                +
                1273  printer->fmt_line("pnt_receive_size[mech_type] = {};", info.num_net_receive_parameters);
                +
                1274  }
                +
                1275 
                +
                1276  if (info.thread_callback_register) {
                +
                1277  printer->add_line("_nrn_thread_reg(mech_type, 1, thread_mem_init);");
                +
                1278  printer->add_line("_nrn_thread_reg(mech_type, 0, thread_mem_cleanup);");
                +
                1279  }
                +
                1280 
                +
                1281  printer->pop_block();
                +
                1282 }
                1283 
                -
                1284  if (info.thread_callback_register) {
                -
                1285  printer->add_line("_nrn_thread_reg(mech_type, 1, thread_mem_init);");
                -
                1286  printer->add_line("_nrn_thread_reg(mech_type, 0, thread_mem_cleanup);");
                -
                1287  }
                -
                1288 
                -
                1289  printer->pop_block();
                -
                1290 }
                -
                1291 
                -
                1292 
                - -
                1294  if (!info.thread_callback_register) {
                -
                1295  return;
                -
                1296  }
                -
                1297 
                -
                1298  auto static_thread_data = get_variable_name("thread_data", false);
                -
                1299  auto inuse = get_variable_name("thread_data_in_use", false);
                -
                1300  auto thread_data_index = info.thread_var_thread_id;
                -
                1301  printer->push_block("static void thread_mem_init(Datum* _thread) ");
                -
                1302  printer->push_block(fmt::format("if({})", inuse));
                -
                1303  printer->fmt_line("_thread[{}] = {{neuron::container::do_not_search, new double[{}]{{}}}};",
                -
                1304  thread_data_index,
                -
                1305  info.thread_var_data_size + info.top_local_thread_size);
                -
                1306  printer->pop_block();
                -
                1307  printer->push_block("else");
                -
                1308  printer->fmt_line("_thread[{}] = {{neuron::container::do_not_search, {}}};",
                -
                1309  thread_data_index,
                -
                1310  static_thread_data);
                -
                1311  printer->fmt_line("{} = 1;", inuse);
                -
                1312  printer->pop_block();
                -
                1313  printer->pop_block();
                -
                1314 
                -
                1315  printer->push_block("static void thread_mem_cleanup(Datum* _thread) ");
                -
                1316  printer->fmt_line("double * _thread_data_ptr = _thread[{}].get<double*>();", thread_data_index);
                -
                1317  printer->push_block(fmt::format("if(_thread_data_ptr == {})", static_thread_data));
                -
                1318  printer->fmt_line("{} = 0;", inuse);
                -
                1319  printer->pop_block();
                -
                1320  printer->push_block("else");
                -
                1321  printer->add_line("delete[] _thread_data_ptr;");
                -
                1322  printer->pop_block();
                -
                1323  printer->pop_block();
                +
                1284 
                + +
                1286  if (!info.thread_callback_register) {
                +
                1287  return;
                +
                1288  }
                +
                1289 
                +
                1290  auto static_thread_data = get_variable_name("thread_data", false);
                +
                1291  auto inuse = get_variable_name("thread_data_in_use", false);
                +
                1292  auto thread_data_index = info.thread_var_thread_id;
                +
                1293  printer->push_block("static void thread_mem_init(Datum* _thread) ");
                +
                1294  printer->push_block(fmt::format("if({})", inuse));
                +
                1295  printer->fmt_line("_thread[{}] = {{neuron::container::do_not_search, new double[{}]{{}}}};",
                +
                1296  thread_data_index,
                +
                1297  info.thread_var_data_size + info.top_local_thread_size);
                +
                1298  printer->pop_block();
                +
                1299  printer->push_block("else");
                +
                1300  printer->fmt_line("_thread[{}] = {{neuron::container::do_not_search, {}}};",
                +
                1301  thread_data_index,
                +
                1302  static_thread_data);
                +
                1303  printer->fmt_line("{} = 1;", inuse);
                +
                1304  printer->pop_block();
                +
                1305  printer->pop_block();
                +
                1306 
                +
                1307  printer->push_block("static void thread_mem_cleanup(Datum* _thread) ");
                +
                1308  printer->fmt_line("double * _thread_data_ptr = _thread[{}].get<double*>();", thread_data_index);
                +
                1309  printer->push_block(fmt::format("if(_thread_data_ptr == {})", static_thread_data));
                +
                1310  printer->fmt_line("{} = 0;", inuse);
                +
                1311  printer->pop_block();
                +
                1312  printer->push_block("else");
                +
                1313  printer->add_line("delete[] _thread_data_ptr;");
                +
                1314  printer->pop_block();
                +
                1315  printer->pop_block();
                +
                1316 }
                +
                1317 
                +
                1318 
                + +
                1320  for (auto const& [var, type]: info.neuron_global_variables) {
                +
                1321  auto const name = var->get_name();
                +
                1322  printer->fmt_line("extern {} {};", type, name);
                +
                1323  }
                1324 }
                1325 
                -
                1326 
                - -
                1328  for (auto const& [var, type]: info.neuron_global_variables) {
                -
                1329  auto const name = var->get_name();
                -
                1330  printer->fmt_line("extern {} {};", type, name);
                -
                1331  }
                -
                1332 }
                -
                1333 
                - -
                1335  auto const value_initialize = print_initializers ? "{}" : "";
                -
                1336  auto int_type = default_int_data_type();
                -
                1337  printer->add_newline(2);
                -
                1338  printer->add_line("/** all mechanism instance variables and global variables */");
                -
                1339  printer->fmt_push_block("struct {} ", instance_struct());
                -
                1340 
                -
                1341  for (auto const& [var, type]: info.neuron_global_variables) {
                -
                1342  auto const name = var->get_name();
                -
                1343  printer->fmt_line("{}* {}{};",
                -
                1344  type,
                -
                1345  name,
                -
                1346  print_initializers ? fmt::format("{{&::{}}}", name) : std::string{});
                -
                1347  }
                -
                1348  for (auto& var: codegen_float_variables) {
                -
                1349  const auto& name = var->get_name();
                -
                1350  printer->fmt_line("double* {}{};", name, value_initialize);
                -
                1351  }
                -
                1352  for (auto& var: codegen_int_variables) {
                -
                1353  const auto& name = var.symbol->get_name();
                -
                1354  if (name == naming::POINT_PROCESS_VARIABLE) {
                -
                1355  continue;
                -
                1356  } else if (var.is_index || var.is_integer) {
                -
                1357  // In NEURON we don't create caches for `int*`. Hence, do nothing.
                -
                1358  } else {
                -
                1359  auto qualifier = var.is_constant ? "const " : "";
                -
                1360  auto type = var.is_vdata ? "void*" : default_float_data_type();
                -
                1361  printer->fmt_line("{}{}* const* {}{};", qualifier, type, name, value_initialize);
                -
                1362  }
                -
                1363  }
                + +
                1327  auto const value_initialize = print_initializers ? "{}" : "";
                +
                1328  auto int_type = default_int_data_type();
                +
                1329  printer->add_newline(2);
                +
                1330  printer->add_line("/** all mechanism instance variables and global variables */");
                +
                1331  printer->fmt_push_block("struct {} ", instance_struct());
                +
                1332 
                +
                1333  for (auto const& [var, type]: info.neuron_global_variables) {
                +
                1334  auto const name = var->get_name();
                +
                1335  printer->fmt_line("{}* {}{};",
                +
                1336  type,
                +
                1337  name,
                +
                1338  print_initializers ? fmt::format("{{&::{}}}", name) : std::string{});
                +
                1339  }
                +
                1340  for (auto& var: codegen_float_variables) {
                +
                1341  const auto& name = var->get_name();
                +
                1342  printer->fmt_line("double* {}{};", name, value_initialize);
                +
                1343  }
                +
                1344  for (auto& var: codegen_int_variables) {
                +
                1345  const auto& name = var.symbol->get_name();
                +
                1346  if (name == naming::POINT_PROCESS_VARIABLE) {
                +
                1347  continue;
                +
                1348  } else if (var.is_index || var.is_integer) {
                +
                1349  // In NEURON we don't create caches for `int*`. Hence, do nothing.
                +
                1350  } else {
                +
                1351  auto qualifier = var.is_constant ? "const " : "";
                +
                1352  auto type = var.is_vdata ? "void*" : default_float_data_type();
                +
                1353  printer->fmt_line("{}{}* const* {}{};", qualifier, type, name, value_initialize);
                +
                1354  }
                +
                1355  }
                +
                1356 
                +
                1357  printer->fmt_line("{}* {}{};",
                +
                1358  global_struct(),
                + +
                1360  print_initializers ? fmt::format("{{&{}}}", global_struct_instance())
                +
                1361  : std::string{});
                +
                1362  printer->pop_block(";");
                +
                1363 }
                1364 
                -
                1365  printer->fmt_line("{}* {}{};",
                -
                1366  global_struct(),
                - -
                1368  print_initializers ? fmt::format("{{&{}}}", global_struct_instance())
                -
                1369  : std::string{});
                -
                1370  printer->pop_block(";");
                -
                1371 }
                -
                1372 
                - -
                1374  printer->add_newline(2);
                -
                1375  printer->fmt_push_block("static {} make_instance_{}(_nrn_mechanism_cache_range& _lmc)",
                -
                1376  instance_struct(),
                -
                1377  info.mod_suffix);
                -
                1378  printer->fmt_push_block("return {}", instance_struct());
                + +
                1366  printer->add_newline(2);
                +
                1367  printer->fmt_push_block("static {} make_instance_{}(_nrn_mechanism_cache_range& _lmc)",
                +
                1368  instance_struct(),
                +
                1369  info.mod_suffix);
                +
                1370  printer->fmt_push_block("return {}", instance_struct());
                +
                1371 
                +
                1372  std::vector<std::string> make_instance_args;
                +
                1373 
                +
                1374 
                +
                1375  for (auto const& [var, type]: info.neuron_global_variables) {
                +
                1376  auto const name = var->get_name();
                +
                1377  make_instance_args.push_back(fmt::format("&::{}", name));
                +
                1378  }
                1379 
                -
                1380  std::vector<std::string> make_instance_args;
                -
                1381 
                -
                1382 
                -
                1383  for (auto const& [var, type]: info.neuron_global_variables) {
                -
                1384  auto const name = var->get_name();
                -
                1385  make_instance_args.push_back(fmt::format("&::{}", name));
                -
                1386  }
                -
                1387 
                -
                1388 
                -
                1389  const auto codegen_float_variables_size = codegen_float_variables.size();
                -
                1390  for (int i = 0; i < codegen_float_variables_size; ++i) {
                -
                1391  const auto& float_var = codegen_float_variables[i];
                -
                1392  if (float_var->is_array()) {
                -
                1393  make_instance_args.push_back(
                -
                1394  fmt::format("_lmc.template data_array_ptr<{}, {}>()", i, float_var->get_length()));
                -
                1395  } else {
                -
                1396  make_instance_args.push_back(fmt::format("_lmc.template fpfield_ptr<{}>()", i));
                -
                1397  }
                -
                1398  }
                -
                1399 
                -
                1400  const auto codegen_int_variables_size = codegen_int_variables.size();
                -
                1401  for (size_t i = 0; i < codegen_int_variables_size; ++i) {
                -
                1402  const auto& var = codegen_int_variables[i];
                -
                1403  auto name = var.symbol->get_name();
                -
                1404  auto const variable = [&var, i]() -> std::string {
                -
                1405  if (var.is_index || var.is_integer) {
                -
                1406  return "";
                -
                1407  } else if (var.is_vdata) {
                -
                1408  return "";
                -
                1409  } else {
                -
                1410  return fmt::format("_lmc.template dptr_field_ptr<{}>()", i);
                -
                1411  }
                -
                1412  }();
                -
                1413  if (variable != "") {
                -
                1414  make_instance_args.push_back(variable);
                -
                1415  }
                -
                1416  }
                -
                1417 
                -
                1418  printer->add_multi_line(fmt::format("{}", fmt::join(make_instance_args, ",\n")));
                +
                1380 
                +
                1381  const auto codegen_float_variables_size = codegen_float_variables.size();
                +
                1382  for (int i = 0; i < codegen_float_variables_size; ++i) {
                +
                1383  const auto& float_var = codegen_float_variables[i];
                +
                1384  if (float_var->is_array()) {
                +
                1385  make_instance_args.push_back(
                +
                1386  fmt::format("_lmc.template data_array_ptr<{}, {}>()", i, float_var->get_length()));
                +
                1387  } else {
                +
                1388  make_instance_args.push_back(fmt::format("_lmc.template fpfield_ptr<{}>()", i));
                +
                1389  }
                +
                1390  }
                +
                1391 
                +
                1392  const auto codegen_int_variables_size = codegen_int_variables.size();
                +
                1393  for (size_t i = 0; i < codegen_int_variables_size; ++i) {
                +
                1394  const auto& var = codegen_int_variables[i];
                +
                1395  auto name = var.symbol->get_name();
                +
                1396  auto const variable = [&var, i]() -> std::string {
                +
                1397  if (var.is_index || var.is_integer) {
                +
                1398  return "";
                +
                1399  } else if (var.is_vdata) {
                +
                1400  return "";
                +
                1401  } else {
                +
                1402  return fmt::format("_lmc.template dptr_field_ptr<{}>()", i);
                +
                1403  }
                +
                1404  }();
                +
                1405  if (variable != "") {
                +
                1406  make_instance_args.push_back(variable);
                +
                1407  }
                +
                1408  }
                +
                1409 
                +
                1410  printer->add_multi_line(fmt::format("{}", fmt::join(make_instance_args, ",\n")));
                +
                1411 
                +
                1412  printer->pop_block(";");
                +
                1413  printer->pop_block();
                +
                1414 }
                +
                1415 
                + +
                1417  printer->add_newline(2);
                +
                1418  printer->fmt_push_block("struct {} ", node_data_struct());
                1419 
                -
                1420  printer->pop_block(";");
                -
                1421  printer->pop_block();
                -
                1422 }
                -
                1423 
                - -
                1425  printer->add_newline(2);
                -
                1426  printer->fmt_push_block("struct {} ", node_data_struct());
                -
                1427 
                -
                1428  // Pointers to node variables
                -
                1429  printer->add_line("int const * nodeindices;");
                -
                1430  printer->add_line("double const * node_voltages;");
                -
                1431  printer->add_line("double * node_diagonal;");
                -
                1432  printer->add_line("double * node_rhs;");
                -
                1433  printer->add_line("int nodecount;");
                -
                1434 
                -
                1435  printer->pop_block(";");
                -
                1436 }
                -
                1437 
                - -
                1439  printer->add_newline(2);
                -
                1440  printer->fmt_push_block("static {} make_node_data_{}(NrnThread& nt, Memb_list& _ml_arg)",
                -
                1441  node_data_struct(),
                -
                1442  info.mod_suffix);
                -
                1443 
                -
                1444  std::vector<std::string> make_node_data_args = {"_ml_arg.nodeindices",
                -
                1445  "nt.node_voltage_storage()",
                -
                1446  "nt.node_d_storage()",
                -
                1447  "nt.node_rhs_storage()",
                -
                1448  "_ml_arg.nodecount"};
                -
                1449 
                -
                1450  printer->fmt_push_block("return {}", node_data_struct());
                -
                1451  printer->add_multi_line(fmt::format("{}", fmt::join(make_node_data_args, ",\n")));
                -
                1452 
                -
                1453  printer->pop_block(";");
                -
                1454  printer->pop_block();
                -
                1455 }
                -
                1456 
                - -
                1458  if (codegen_thread_variables.empty()) {
                -
                1459  return;
                -
                1460  }
                +
                1420  // Pointers to node variables
                +
                1421  printer->add_line("int const * nodeindices;");
                +
                1422  printer->add_line("double const * node_voltages;");
                +
                1423  printer->add_line("double * node_diagonal;");
                +
                1424  printer->add_line("double * node_rhs;");
                +
                1425  printer->add_line("int nodecount;");
                +
                1426 
                +
                1427  printer->pop_block(";");
                +
                1428 }
                +
                1429 
                + +
                1431  printer->add_newline(2);
                +
                1432  printer->fmt_push_block("static {} make_node_data_{}(NrnThread& nt, Memb_list& _ml_arg)",
                +
                1433  node_data_struct(),
                +
                1434  info.mod_suffix);
                +
                1435 
                +
                1436  std::vector<std::string> make_node_data_args = {"_ml_arg.nodeindices",
                +
                1437  "nt.node_voltage_storage()",
                +
                1438  "nt.node_d_storage()",
                +
                1439  "nt.node_rhs_storage()",
                +
                1440  "_ml_arg.nodecount"};
                +
                1441 
                +
                1442  printer->fmt_push_block("return {}", node_data_struct());
                +
                1443  printer->add_multi_line(fmt::format("{}", fmt::join(make_node_data_args, ",\n")));
                +
                1444 
                +
                1445  printer->pop_block(";");
                +
                1446  printer->pop_block();
                +
                1447 }
                +
                1448 
                + +
                1450  if (codegen_thread_variables.empty()) {
                +
                1451  return;
                +
                1452  }
                +
                1453 
                +
                1454  printer->add_newline(2);
                +
                1455  printer->fmt_push_block("struct {} ", thread_variables_struct());
                +
                1456  printer->add_line("double * thread_data;");
                +
                1457  printer->add_newline();
                +
                1458 
                +
                1459  std::string simd_width = "1";
                +
                1460 
                1461 
                -
                1462  printer->add_newline(2);
                -
                1463  printer->fmt_push_block("struct {} ", thread_variables_struct());
                -
                1464  printer->add_line("double * thread_data;");
                -
                1465  printer->add_newline();
                +
                1462  for (const auto& var_info: codegen_thread_variables) {
                +
                1463  printer->fmt_push_block("double * {}_ptr(size_t id)", var_info.symbol->get_name());
                +
                1464  printer->fmt_line("return thread_data + {} + (id % {});", var_info.offset, simd_width);
                +
                1465  printer->pop_block();
                1466 
                -
                1467  std::string simd_width = "1";
                -
                1468 
                -
                1469 
                -
                1470  for (const auto& var_info: codegen_thread_variables) {
                -
                1471  printer->fmt_push_block("double * {}_ptr(size_t id)", var_info.symbol->get_name());
                -
                1472  printer->fmt_line("return thread_data + {} + (id % {});", var_info.offset, simd_width);
                -
                1473  printer->pop_block();
                -
                1474 
                -
                1475  printer->fmt_push_block("double & {}(size_t id)", var_info.symbol->get_name());
                -
                1476  printer->fmt_line("return thread_data[{} + (id % {})];", var_info.offset, simd_width);
                -
                1477  printer->pop_block();
                -
                1478  }
                -
                1479  printer->add_newline();
                +
                1467  printer->fmt_push_block("double & {}(size_t id)", var_info.symbol->get_name());
                +
                1468  printer->fmt_line("return thread_data[{} + (id % {})];", var_info.offset, simd_width);
                +
                1469  printer->pop_block();
                +
                1470  }
                +
                1471  printer->add_newline();
                +
                1472 
                +
                1473  printer->push_block(fmt::format("{}(double * const thread_data)", thread_variables_struct()));
                +
                1474  printer->fmt_line("this->thread_data = thread_data;");
                +
                1475  printer->pop_block();
                +
                1476 
                +
                1477  printer->pop_block(";");
                +
                1478 }
                +
                1479 
                1480 
                -
                1481  printer->push_block(fmt::format("{}(double * const thread_data)", thread_variables_struct()));
                -
                1482  printer->fmt_line("this->thread_data = thread_data;");
                -
                1483  printer->pop_block();
                -
                1484 
                -
                1485  printer->pop_block(";");
                -
                1486 }
                + +
                1482  // read ion statements
                +
                1483  auto read_statements = ion_read_statements(BlockType::Initial);
                +
                1484  for (auto& statement: read_statements) {
                +
                1485  printer->add_line(statement);
                +
                1486  }
                1487 
                -
                1488 
                - -
                1490  // read ion statements
                -
                1491  auto read_statements = ion_read_statements(BlockType::Initial);
                -
                1492  for (auto& statement: read_statements) {
                -
                1493  printer->add_line(statement);
                -
                1494  }
                -
                1495 
                -
                1496  // initial block
                -
                1497  if (node != nullptr) {
                -
                1498  const auto& block = node->get_statement_block();
                -
                1499  print_statement_block(*block, false, false);
                -
                1500  }
                +
                1488  // initial block
                +
                1489  if (node != nullptr) {
                +
                1490  const auto& block = node->get_statement_block();
                +
                1491  print_statement_block(*block, false, false);
                +
                1492  }
                +
                1493 
                +
                1494  // write ion statements
                +
                1495  auto write_statements = ion_write_statements(BlockType::Initial);
                +
                1496  for (auto& statement: write_statements) {
                +
                1497  auto text = process_shadow_update_statement(statement, BlockType::Initial);
                +
                1498  printer->add_line(text);
                +
                1499  }
                +
                1500 }
                1501 
                -
                1502  // write ion statements
                -
                1503  auto write_statements = ion_write_statements(BlockType::Initial);
                -
                1504  for (auto& statement: write_statements) {
                -
                1505  auto text = process_shadow_update_statement(statement, BlockType::Initial);
                -
                1506  printer->add_line(text);
                -
                1507  }
                -
                1508 }
                -
                1509 
                -
                1510 
                - -
                1512  const std::string& function_name) {
                -
                1513  std::string method = function_name.empty() ? compute_method_name(type) : function_name;
                -
                1514  ParamVector args = {{"", "const _nrn_model_sorted_token&", "", "_sorted_token"},
                -
                1515  {"", "NrnThread*", "", "nt"},
                -
                1516  {"", "Memb_list*", "", "_ml_arg"},
                -
                1517  {"", "int", "", "_type"}};
                -
                1518  printer->fmt_push_block("void {}({})", method, get_parameter_str(args));
                -
                1519 
                -
                1520  printer->add_line("_nrn_mechanism_cache_range _lmc{_sorted_token, *nt, *_ml_arg, _type};");
                -
                1521  printer->fmt_line("auto inst = make_instance_{}(_lmc);", info.mod_suffix);
                -
                1522  printer->fmt_line("auto node_data = make_node_data_{}(*nt, *_ml_arg);", info.mod_suffix);
                -
                1523 
                -
                1524  printer->add_line("auto nodecount = _ml_arg->nodecount;");
                -
                1525  printer->add_line("auto* _thread = _ml_arg->_thread;");
                -
                1526  if (!codegen_thread_variables.empty()) {
                -
                1527  printer->fmt_line("auto _thread_vars = {}(_thread[{}].get<double*>());",
                -
                1528  thread_variables_struct(),
                -
                1529  info.thread_var_thread_id);
                -
                1530  }
                -
                1531 }
                +
                1502 
                + +
                1504  const std::string& function_name) {
                +
                1505  std::string method = function_name.empty() ? compute_method_name(type) : function_name;
                +
                1506  ParamVector args = {{"", "const _nrn_model_sorted_token&", "", "_sorted_token"},
                +
                1507  {"", "NrnThread*", "", "nt"},
                +
                1508  {"", "Memb_list*", "", "_ml_arg"},
                +
                1509  {"", "int", "", "_type"}};
                +
                1510  printer->fmt_push_block("void {}({})", method, get_parameter_str(args));
                +
                1511 
                +
                1512  printer->add_line("_nrn_mechanism_cache_range _lmc{_sorted_token, *nt, *_ml_arg, _type};");
                +
                1513  printer->fmt_line("auto inst = make_instance_{}(_lmc);", info.mod_suffix);
                +
                1514  printer->fmt_line("auto node_data = make_node_data_{}(*nt, *_ml_arg);", info.mod_suffix);
                +
                1515 
                +
                1516  printer->add_line("auto nodecount = _ml_arg->nodecount;");
                +
                1517  printer->add_line("auto* _thread = _ml_arg->_thread;");
                +
                1518  if (!codegen_thread_variables.empty()) {
                +
                1519  printer->fmt_line("auto _thread_vars = {}(_thread[{}].get<double*>());",
                +
                1520  thread_variables_struct(),
                +
                1521  info.thread_var_thread_id);
                +
                1522  }
                +
                1523 }
                +
                1524 
                +
                1525 
                +
                1526 void CodegenNeuronCppVisitor::print_nrn_init(bool skip_init_check) {
                +
                1527  printer->add_newline(2);
                +
                1528 
                +
                1529  print_global_function_common_code(BlockType::Initial);
                +
                1530 
                +
                1531  printer->push_block("for (int id = 0; id < nodecount; id++)");
                1532 
                -
                1533 
                -
                1534 void CodegenNeuronCppVisitor::print_nrn_init(bool skip_init_check) {
                -
                1535  printer->add_newline(2);
                -
                1536 
                -
                1537  print_global_function_common_code(BlockType::Initial);
                -
                1538 
                -
                1539  printer->push_block("for (int id = 0; id < nodecount; id++)");
                -
                1540 
                -
                1541  printer->add_line("auto* _ppvar = _ml_arg->pdata[id];");
                -
                1542  if (!info.artificial_cell) {
                -
                1543  printer->add_line("int node_id = node_data.nodeindices[id];");
                -
                1544  printer->add_line("auto v = node_data.node_voltages[node_id];");
                -
                1545  printer->fmt_line("inst.{}[id] = v;", naming::VOLTAGE_UNUSED_VARIABLE);
                -
                1546  }
                -
                1547 
                -
                1548  print_initial_block(info.initial_node);
                -
                1549  printer->pop_block();
                -
                1550 
                -
                1551  printer->pop_block();
                -
                1552 }
                +
                1533  printer->add_line("auto* _ppvar = _ml_arg->pdata[id];");
                +
                1534  if (!info.artificial_cell) {
                +
                1535  printer->add_line("int node_id = node_data.nodeindices[id];");
                +
                1536  printer->add_line("auto v = node_data.node_voltages[node_id];");
                +
                1537  printer->fmt_line("inst.{}[id] = v;", naming::VOLTAGE_UNUSED_VARIABLE);
                +
                1538  }
                +
                1539 
                +
                1540  print_initial_block(info.initial_node);
                +
                1541  printer->pop_block();
                +
                1542 
                +
                1543  printer->pop_block();
                +
                1544 }
                +
                1545 
                + +
                1547  printer->add_newline(2);
                +
                1548 
                +
                1549  ParamVector args = {{"", "const _nrn_model_sorted_token&", "", "_sorted_token"},
                +
                1550  {"", "NrnThread*", "", "nt"},
                +
                1551  {"", "Memb_list*", "", "_ml_arg"},
                +
                1552  {"", "int", "", "_type"}};
                1553 
                - -
                1555  printer->add_newline(2);
                -
                1556 
                -
                1557  ParamVector args = {{"", "const _nrn_model_sorted_token&", "", "_sorted_token"},
                -
                1558  {"", "NrnThread*", "", "nt"},
                -
                1559  {"", "Memb_list*", "", "_ml_arg"},
                -
                1560  {"", "int", "", "_type"}};
                +
                1554  printer->fmt_push_block("static void {}({})",
                +
                1555  method_name(naming::NRN_JACOB_METHOD),
                +
                1556  get_parameter_str(args)); // begin function
                +
                1557 
                +
                1558 
                +
                1559  printer->add_multi_line(
                +
                1560  "_nrn_mechanism_cache_range _lmc{_sorted_token, *nt, *_ml_arg, _type};");
                1561 
                -
                1562  printer->fmt_push_block("static void {}({})",
                -
                1563  method_name(naming::NRN_JACOB_METHOD),
                -
                1564  get_parameter_str(args)); // begin function
                -
                1565 
                +
                1562  printer->fmt_line("auto inst = make_instance_{}(_lmc);", info.mod_suffix);
                +
                1563  printer->fmt_line("auto node_data = make_node_data_{}(*nt, *_ml_arg);", info.mod_suffix);
                +
                1564  printer->fmt_line("auto nodecount = _ml_arg->nodecount;");
                +
                1565  printer->push_block("for (int id = 0; id < nodecount; id++)"); // begin for
                1566 
                -
                1567  printer->add_multi_line(
                -
                1568  "_nrn_mechanism_cache_range _lmc{_sorted_token, *nt, *_ml_arg, _type};");
                -
                1569 
                -
                1570  printer->fmt_line("auto inst = make_instance_{}(_lmc);", info.mod_suffix);
                -
                1571  printer->fmt_line("auto node_data = make_node_data_{}(*nt, *_ml_arg);", info.mod_suffix);
                -
                1572  printer->fmt_line("auto nodecount = _ml_arg->nodecount;");
                -
                1573  printer->push_block("for (int id = 0; id < nodecount; id++)"); // begin for
                -
                1574 
                -
                1575  if (breakpoint_exist()) {
                -
                1576  printer->add_line("int node_id = node_data.nodeindices[id];");
                -
                1577  printer->fmt_line("node_data.node_diagonal[node_id] += inst.{}[id];",
                -
                1578  info.vectorize ? naming::CONDUCTANCE_UNUSED_VARIABLE
                - -
                1580  }
                -
                1581 
                -
                1582  printer->pop_block(); // end for
                -
                1583  printer->pop_block(); // end function
                -
                1584 }
                -
                1585 
                -
                1586 
                -
                1587 /// TODO: Edit for NEURON
                - -
                1589  return;
                -
                1590 }
                -
                1591 
                -
                1592 
                -
                1593 /// TODO: Edit for NEURON
                - -
                1595  return;
                -
                1596 }
                -
                1597 
                -
                1598 
                -
                1599 /// TODO: Print the equivalent of `nrn_alloc_<mech_name>`
                - -
                1601  printer->add_newline(2);
                -
                1602 
                -
                1603  auto method = method_name(naming::NRN_ALLOC_METHOD);
                -
                1604  printer->fmt_push_block("static void {}(Prop* _prop)", method);
                -
                1605  printer->add_line("Datum *_ppvar = nullptr;");
                -
                1606 
                -
                1607  if (info.point_process) {
                -
                1608  printer->push_block("if (nrn_point_prop_)");
                -
                1609  printer->add_multi_line(R"CODE(
                -
                1610  _nrn_mechanism_access_alloc_seq(_prop) = _nrn_mechanism_access_alloc_seq(nrn_point_prop_);
                -
                1611  _ppvar = _nrn_mechanism_access_dparam(nrn_point_prop_);
                -
                1612  )CODE");
                -
                1613  printer->chain_block("else");
                -
                1614  }
                -
                1615  if (info.semantic_variable_count) {
                -
                1616  printer->fmt_line("_ppvar = nrn_prop_datum_alloc(mech_type, {}, _prop);",
                -
                1617  info.semantic_variable_count);
                -
                1618  printer->add_line("_nrn_mechanism_access_dparam(_prop) = _ppvar;");
                -
                1619  }
                -
                1620  printer->add_multi_line(R"CODE(
                -
                1621  _nrn_mechanism_cache_instance _lmc{_prop};
                -
                1622  size_t const _iml = 0;
                -
                1623  )CODE");
                -
                1624  printer->fmt_line("assert(_nrn_mechanism_get_num_vars(_prop) == {});",
                -
                1625  codegen_float_variables.size());
                -
                1626  if (float_variables_size()) {
                -
                1627  printer->add_line("/*initialize range parameters*/");
                -
                1628  for (const auto& var: info.range_parameter_vars) {
                -
                1629  if (var->is_array()) {
                -
                1630  continue;
                -
                1631  }
                -
                1632  const auto& var_name = var->get_name();
                -
                1633  auto var_pos = position_of_float_var(var_name);
                -
                1634  double var_value = var->get_value() == nullptr ? 0.0 : *var->get_value();
                -
                1635 
                -
                1636  printer->fmt_line("_lmc.template fpfield<{}>(_iml) = {}; /* {} */",
                -
                1637  var_pos,
                -
                1638  var_value,
                -
                1639  var_name);
                -
                1640  }
                -
                1641  }
                -
                1642  if (info.point_process) {
                -
                1643  printer->pop_block();
                -
                1644  }
                -
                1645 
                -
                1646  if (info.semantic_variable_count) {
                -
                1647  printer->add_line("_nrn_mechanism_access_dparam(_prop) = _ppvar;");
                -
                1648  }
                -
                1649 
                -
                1650  const auto codegen_int_variables_size = codegen_int_variables.size();
                -
                1651 
                -
                1652  if (info.diam_used || info.area_used) {
                -
                1653  for (size_t i = 0; i < codegen_int_variables.size(); ++i) {
                -
                1654  auto var_info = codegen_int_variables[i];
                -
                1655  if (var_info.symbol->get_name() == naming::DIAM_VARIABLE) {
                -
                1656  printer->add_line("Symbol * morphology_sym = hoc_lookup(\"morphology\");");
                -
                1657  printer->fmt_line("Prop * morphology_prop = need_memb(morphology_sym);");
                -
                1658 
                -
                1659  printer->fmt_line(
                -
                1660  "_ppvar[{}] = _nrn_mechanism_get_param_handle(morphology_prop, 0);", i);
                -
                1661  }
                -
                1662  if (var_info.symbol->get_name() == naming::AREA_VARIABLE) {
                -
                1663  printer->fmt_line("_ppvar[{}] = _nrn_mechanism_get_area_handle(nrn_alloc_node_);",
                -
                1664  i);
                -
                1665  }
                -
                1666  }
                -
                1667  }
                +
                1567  if (breakpoint_exist()) {
                +
                1568  printer->add_line("int node_id = node_data.nodeindices[id];");
                +
                1569  printer->fmt_line("node_data.node_diagonal[node_id] += inst.{}[id];",
                +
                1570  info.vectorize ? naming::CONDUCTANCE_UNUSED_VARIABLE
                + +
                1572  }
                +
                1573 
                +
                1574  printer->pop_block(); // end for
                +
                1575  printer->pop_block(); // end function
                +
                1576 }
                +
                1577 
                +
                1578 
                +
                1579 /// TODO: Edit for NEURON
                + +
                1581  return;
                +
                1582 }
                +
                1583 
                +
                1584 
                +
                1585 /// TODO: Edit for NEURON
                + +
                1587  return;
                +
                1588 }
                +
                1589 
                +
                1590 
                +
                1591 /// TODO: Print the equivalent of `nrn_alloc_<mech_name>`
                + +
                1593  printer->add_newline(2);
                +
                1594 
                +
                1595  auto method = method_name(naming::NRN_ALLOC_METHOD);
                +
                1596  printer->fmt_push_block("static void {}(Prop* _prop)", method);
                +
                1597  printer->add_line("Datum *_ppvar = nullptr;");
                +
                1598 
                +
                1599  if (info.point_process) {
                +
                1600  printer->push_block("if (nrn_point_prop_)");
                +
                1601  printer->add_multi_line(R"CODE(
                +
                1602  _nrn_mechanism_access_alloc_seq(_prop) = _nrn_mechanism_access_alloc_seq(nrn_point_prop_);
                +
                1603  _ppvar = _nrn_mechanism_access_dparam(nrn_point_prop_);
                +
                1604  )CODE");
                +
                1605  printer->chain_block("else");
                +
                1606  }
                +
                1607  if (info.semantic_variable_count) {
                +
                1608  printer->fmt_line("_ppvar = nrn_prop_datum_alloc(mech_type, {}, _prop);",
                +
                1609  info.semantic_variable_count);
                +
                1610  printer->add_line("_nrn_mechanism_access_dparam(_prop) = _ppvar;");
                +
                1611  }
                +
                1612  printer->add_multi_line(R"CODE(
                +
                1613  _nrn_mechanism_cache_instance _lmc{_prop};
                +
                1614  size_t const _iml = 0;
                +
                1615  )CODE");
                +
                1616  printer->fmt_line("assert(_nrn_mechanism_get_num_vars(_prop) == {});",
                +
                1617  codegen_float_variables.size());
                +
                1618  if (float_variables_size()) {
                +
                1619  printer->add_line("/*initialize range parameters*/");
                +
                1620  for (const auto& var: info.range_parameter_vars) {
                +
                1621  if (var->is_array()) {
                +
                1622  continue;
                +
                1623  }
                +
                1624  const auto& var_name = var->get_name();
                +
                1625  auto var_pos = position_of_float_var(var_name);
                +
                1626  double var_value = var->get_value() == nullptr ? 0.0 : *var->get_value();
                +
                1627 
                +
                1628  printer->fmt_line("_lmc.template fpfield<{}>(_iml) = {}; /* {} */",
                +
                1629  var_pos,
                +
                1630  var_value,
                +
                1631  var_name);
                +
                1632  }
                +
                1633  }
                +
                1634  if (info.point_process) {
                +
                1635  printer->pop_block();
                +
                1636  }
                +
                1637 
                +
                1638  if (info.semantic_variable_count) {
                +
                1639  printer->add_line("_nrn_mechanism_access_dparam(_prop) = _ppvar;");
                +
                1640  }
                +
                1641 
                +
                1642  const auto codegen_int_variables_size = codegen_int_variables.size();
                +
                1643 
                +
                1644  if (info.diam_used || info.area_used) {
                +
                1645  for (size_t i = 0; i < codegen_int_variables.size(); ++i) {
                +
                1646  auto var_info = codegen_int_variables[i];
                +
                1647  if (var_info.symbol->get_name() == naming::DIAM_VARIABLE) {
                +
                1648  printer->add_line("Symbol * morphology_sym = hoc_lookup(\"morphology\");");
                +
                1649  printer->fmt_line("Prop * morphology_prop = need_memb(morphology_sym);");
                +
                1650 
                +
                1651  printer->fmt_line(
                +
                1652  "_ppvar[{}] = _nrn_mechanism_get_param_handle(morphology_prop, 0);", i);
                +
                1653  }
                +
                1654  if (var_info.symbol->get_name() == naming::AREA_VARIABLE) {
                +
                1655  printer->fmt_line("_ppvar[{}] = _nrn_mechanism_get_area_handle(nrn_alloc_node_);",
                +
                1656  i);
                +
                1657  }
                +
                1658  }
                +
                1659  }
                +
                1660 
                +
                1661  for (const auto& ion: info.ions) {
                +
                1662  printer->fmt_line("Symbol * {}_sym = hoc_lookup(\"{}_ion\");", ion.name, ion.name);
                +
                1663  printer->fmt_line("Prop * {}_prop = need_memb({}_sym);", ion.name, ion.name);
                +
                1664 
                +
                1665  if (ion.is_exterior_conc_written()) {
                +
                1666  printer->fmt_line("nrn_check_conc_write(_prop, {}_prop, 0);", ion.name);
                +
                1667  }
                1668 
                -
                1669  for (const auto& ion: info.ions) {
                -
                1670  printer->fmt_line("Symbol * {}_sym = hoc_lookup(\"{}_ion\");", ion.name, ion.name);
                -
                1671  printer->fmt_line("Prop * {}_prop = need_memb({}_sym);", ion.name, ion.name);
                +
                1669  if (ion.is_interior_conc_written()) {
                +
                1670  printer->fmt_line("nrn_check_conc_write(_prop, {}_prop, 1);", ion.name);
                +
                1671  }
                1672 
                -
                1673  if (ion.is_exterior_conc_written()) {
                -
                1674  printer->fmt_line("nrn_check_conc_write(_prop, {}_prop, 0);", ion.name);
                -
                1675  }
                -
                1676 
                -
                1677  if (ion.is_interior_conc_written()) {
                -
                1678  printer->fmt_line("nrn_check_conc_write(_prop, {}_prop, 1);", ion.name);
                -
                1679  }
                +
                1673  int conc = ion.is_conc_written() ? 3 : int(ion.is_conc_read());
                +
                1674  int rev = ion.is_rev_written() ? 3 : int(ion.is_rev_read());
                +
                1675 
                +
                1676  printer->fmt_line("nrn_promote({}_prop, {}, {});", ion.name, conc, rev);
                +
                1677 
                +
                1678  for (size_t i = 0; i < codegen_int_variables_size; ++i) {
                +
                1679  const auto& var = codegen_int_variables[i];
                1680 
                -
                1681  int conc = ion.is_conc_written() ? 3 : int(ion.is_conc_read());
                -
                1682  int rev = ion.is_rev_written() ? 3 : int(ion.is_rev_read());
                -
                1683 
                -
                1684  printer->fmt_line("nrn_promote({}_prop, {}, {});", ion.name, conc, rev);
                -
                1685 
                -
                1686  for (size_t i = 0; i < codegen_int_variables_size; ++i) {
                -
                1687  const auto& var = codegen_int_variables[i];
                -
                1688 
                -
                1689  const std::string& var_name = var.symbol->get_name();
                -
                1690 
                -
                1691  if (stringutils::starts_with(var_name, "ion_")) {
                -
                1692  std::string ion_var_name = std::string(var_name.begin() + 4, var_name.end());
                -
                1693  if (ion.is_ionic_variable(ion_var_name) ||
                -
                1694  ion.is_current_derivative(ion_var_name) || ion.is_rev_potential(ion_var_name)) {
                -
                1695  printer->fmt_line("_ppvar[{}] = _nrn_mechanism_get_param_handle({}_prop, {});",
                -
                1696  i,
                -
                1697  ion.name,
                -
                1698  ion.variable_index(ion_var_name));
                +
                1681  const std::string& var_name = var.symbol->get_name();
                +
                1682 
                +
                1683  if (stringutils::starts_with(var_name, "ion_")) {
                +
                1684  std::string ion_var_name = std::string(var_name.begin() + 4, var_name.end());
                +
                1685  if (ion.is_ionic_variable(ion_var_name) ||
                +
                1686  ion.is_current_derivative(ion_var_name) || ion.is_rev_potential(ion_var_name)) {
                +
                1687  printer->fmt_line("_ppvar[{}] = _nrn_mechanism_get_param_handle({}_prop, {});",
                +
                1688  i,
                +
                1689  ion.name,
                +
                1690  ion.variable_index(ion_var_name));
                +
                1691  }
                +
                1692  } else {
                +
                1693  if (ion.is_style(var_name)) {
                +
                1694  printer->fmt_line(
                +
                1695  "_ppvar[{}] = {{neuron::container::do_not_search, "
                +
                1696  "&(_nrn_mechanism_access_dparam({}_prop)[0].literal_value<int>())}};",
                +
                1697  i,
                +
                1698  ion.name);
                1699  }
                -
                1700  } else {
                -
                1701  if (ion.is_style(var_name)) {
                -
                1702  printer->fmt_line(
                -
                1703  "_ppvar[{}] = {{neuron::container::do_not_search, "
                -
                1704  "&(_nrn_mechanism_access_dparam({}_prop)[0].literal_value<int>())}};",
                -
                1705  i,
                -
                1706  ion.name);
                -
                1707  }
                -
                1708  }
                -
                1709  }
                -
                1710  }
                -
                1711 
                -
                1712  /// TODO: CONSTRUCTOR call
                +
                1700  }
                +
                1701  }
                +
                1702  }
                +
                1703 
                +
                1704  /// TODO: CONSTRUCTOR call
                +
                1705 
                +
                1706  printer->pop_block();
                +
                1707 }
                +
                1708 
                +
                1709 
                +
                1710 /****************************************************************************************/
                +
                1711 /* Print nrn_state routine */
                +
                1712 /****************************************************************************************/
                1713 
                -
                1714  printer->pop_block();
                -
                1715 }
                -
                1716 
                -
                1717 
                -
                1718 /****************************************************************************************/
                -
                1719 /* Print nrn_state routine */
                -
                1720 /****************************************************************************************/
                -
                1721 
                -
                1722 /// TODO: Edit for NEURON
                - -
                1724  if (!nrn_state_required()) {
                -
                1725  return;
                -
                1726  }
                -
                1727 
                -
                1728  printer->add_newline(2);
                -
                1729  print_global_function_common_code(BlockType::State);
                -
                1730 
                -
                1731  printer->push_block("for (int id = 0; id < nodecount; id++)");
                -
                1732  printer->add_line("int node_id = node_data.nodeindices[id];");
                -
                1733  printer->add_line("auto* _ppvar = _ml_arg->pdata[id];");
                -
                1734  printer->add_line("auto v = node_data.node_voltages[node_id];");
                -
                1735 
                -
                1736  /**
                -
                1737  * \todo Eigen solver node also emits IonCurVar variable in the functor
                -
                1738  * but that shouldn't update ions in derivative block
                -
                1739  */
                -
                1740  if (ion_variable_struct_required()) {
                -
                1741  throw std::runtime_error("Not implemented.");
                -
                1742  }
                -
                1743 
                -
                1744  auto read_statements = ion_read_statements(BlockType::State);
                -
                1745  for (auto& statement: read_statements) {
                -
                1746  printer->add_line(statement);
                -
                1747  }
                -
                1748 
                -
                1749  if (info.nrn_state_block) {
                -
                1750  info.nrn_state_block->visit_children(*this);
                -
                1751  }
                -
                1752 
                -
                1753  if (info.currents.empty() && info.breakpoint_node != nullptr) {
                -
                1754  auto block = info.breakpoint_node->get_statement_block();
                -
                1755  print_statement_block(*block, false, false);
                -
                1756  }
                -
                1757 
                -
                1758  const auto& write_statements = ion_write_statements(BlockType::State);
                -
                1759  for (auto& statement: write_statements) {
                -
                1760  const auto& text = process_shadow_update_statement(statement, BlockType::State);
                -
                1761  printer->add_line(text);
                -
                1762  }
                -
                1763 
                -
                1764  printer->pop_block();
                -
                1765  printer->pop_block();
                -
                1766 }
                -
                1767 
                +
                1714 /// TODO: Edit for NEURON
                + +
                1716  if (!nrn_state_required()) {
                +
                1717  return;
                +
                1718  }
                +
                1719 
                +
                1720  printer->add_newline(2);
                +
                1721  print_global_function_common_code(BlockType::State);
                +
                1722 
                +
                1723  printer->push_block("for (int id = 0; id < nodecount; id++)");
                +
                1724  printer->add_line("int node_id = node_data.nodeindices[id];");
                +
                1725  printer->add_line("auto* _ppvar = _ml_arg->pdata[id];");
                +
                1726  printer->add_line("auto v = node_data.node_voltages[node_id];");
                +
                1727 
                +
                1728  /**
                +
                1729  * \todo Eigen solver node also emits IonCurVar variable in the functor
                +
                1730  * but that shouldn't update ions in derivative block
                +
                1731  */
                +
                1732  if (ion_variable_struct_required()) {
                +
                1733  throw std::runtime_error("Not implemented.");
                +
                1734  }
                +
                1735 
                +
                1736  auto read_statements = ion_read_statements(BlockType::State);
                +
                1737  for (auto& statement: read_statements) {
                +
                1738  printer->add_line(statement);
                +
                1739  }
                +
                1740 
                +
                1741  if (info.nrn_state_block) {
                +
                1742  info.nrn_state_block->visit_children(*this);
                +
                1743  }
                +
                1744 
                +
                1745  if (info.currents.empty() && info.breakpoint_node != nullptr) {
                +
                1746  auto block = info.breakpoint_node->get_statement_block();
                +
                1747  print_statement_block(*block, false, false);
                +
                1748  }
                +
                1749 
                +
                1750  const auto& write_statements = ion_write_statements(BlockType::State);
                +
                1751  for (auto& statement: write_statements) {
                +
                1752  const auto& text = process_shadow_update_statement(statement, BlockType::State);
                +
                1753  printer->add_line(text);
                +
                1754  }
                +
                1755 
                +
                1756  printer->pop_block();
                +
                1757  printer->pop_block();
                +
                1758 }
                +
                1759 
                +
                1760 
                +
                1761 /****************************************************************************************/
                +
                1762 /* Print nrn_cur related routines */
                +
                1763 /****************************************************************************************/
                +
                1764 
                + +
                1766  return get_arg_str(nrn_current_parameters());
                +
                1767 }
                1768 
                -
                1769 /****************************************************************************************/
                -
                1770 /* Print nrn_cur related routines */
                -
                1771 /****************************************************************************************/
                -
                1772 
                - -
                1774  return get_arg_str(nrn_current_parameters());
                -
                1775 }
                -
                1776 
                -
                1777 
                - -
                1779  if (ion_variable_struct_required()) {
                -
                1780  throw std::runtime_error("Not implemented.");
                -
                1781  }
                -
                1782 
                -
                1783  ParamVector params = {{"", "_nrn_mechanism_cache_range&", "", "_lmc"},
                -
                1784  {"", "NrnThread*", "", "nt"},
                -
                1785  {"", "Datum*", "", "_ppvar"},
                -
                1786  {"", "Datum*", "", "_thread"}};
                -
                1787 
                -
                1788  if (info.thread_callback_register) {
                -
                1789  auto type_name = fmt::format("{}&", thread_variables_struct());
                -
                1790  params.emplace_back("", type_name, "", "_thread_vars");
                -
                1791  }
                -
                1792  params.emplace_back("", "size_t", "", "id");
                -
                1793  params.emplace_back("", fmt::format("{}&", instance_struct()), "", "inst");
                -
                1794  params.emplace_back("", fmt::format("{}&", node_data_struct()), "", "node_data");
                -
                1795  params.emplace_back("", "double", "", "v");
                -
                1796  return params;
                -
                1797 }
                -
                1798 
                -
                1799 
                -
                1800 /// TODO: Edit for NEURON
                - -
                1802  const auto& args = nrn_current_parameters();
                -
                1803  const auto& block = node.get_statement_block();
                -
                1804  printer->add_newline(2);
                -
                1805  printer->fmt_push_block("inline double nrn_current_{}({})",
                -
                1806  info.mod_suffix,
                -
                1807  get_parameter_str(args));
                -
                1808  printer->add_line("double current = 0.0;");
                -
                1809  print_statement_block(*block, false, false);
                -
                1810  for (auto& current: info.currents) {
                -
                1811  const auto& name = get_variable_name(current);
                -
                1812  printer->fmt_line("current += {};", name);
                -
                1813  }
                -
                1814  printer->add_line("return current;");
                -
                1815  printer->pop_block();
                -
                1816 }
                -
                1817 
                -
                1818 
                -
                1819 /// TODO: Edit for NEURON
                - -
                1821  const auto& block = node.get_statement_block();
                -
                1822  print_statement_block(*block, false, false);
                -
                1823  if (!info.currents.empty()) {
                -
                1824  std::string sum;
                -
                1825  for (const auto& current: info.currents) {
                -
                1826  auto var = breakpoint_current(current);
                -
                1827  sum += get_variable_name(var);
                -
                1828  if (&current != &info.currents.back()) {
                -
                1829  sum += "+";
                -
                1830  }
                -
                1831  }
                -
                1832  printer->fmt_line("double rhs = {};", sum);
                -
                1833  }
                -
                1834 
                -
                1835  std::string sum;
                -
                1836  for (const auto& conductance: info.conductances) {
                -
                1837  auto var = breakpoint_current(conductance.variable);
                -
                1838  sum += get_variable_name(var);
                -
                1839  if (&conductance != &info.conductances.back()) {
                -
                1840  sum += "+";
                -
                1841  }
                -
                1842  }
                -
                1843  printer->fmt_line("double g = {};", sum);
                -
                1844 
                -
                1845  for (const auto& conductance: info.conductances) {
                -
                1846  if (!conductance.ion.empty()) {
                -
                1847  const auto& lhs = std::string(naming::ION_VARNAME_PREFIX) + "di" + conductance.ion +
                -
                1848  "dv";
                -
                1849  const auto& rhs = get_variable_name(conductance.variable);
                -
                1850  const ShadowUseStatement statement{lhs, "+=", rhs};
                -
                1851  const auto& text = process_shadow_update_statement(statement, BlockType::Equation);
                -
                1852  printer->add_line(text);
                -
                1853  }
                -
                1854  }
                -
                1855 }
                -
                1856 
                -
                1857 
                -
                1858 /// TODO: Edit for NEURON
                - -
                1860  printer->fmt_line("double I1 = nrn_current_{}({}+0.001);",
                -
                1861  info.mod_suffix,
                -
                1862  nrn_current_arguments());
                -
                1863  for (auto& ion: info.ions) {
                -
                1864  for (auto& var: ion.writes) {
                -
                1865  if (ion.is_ionic_current(var)) {
                -
                1866  const auto& name = get_variable_name(var);
                -
                1867  printer->fmt_line("double di{} = {};", ion.name, name);
                -
                1868  }
                -
                1869  }
                -
                1870  }
                -
                1871  printer->fmt_line("double I0 = nrn_current_{}({});", info.mod_suffix, nrn_current_arguments());
                -
                1872  printer->add_line("double rhs = I0;");
                -
                1873 
                -
                1874  printer->add_line("double g = (I1-I0)/0.001;");
                -
                1875  for (auto& ion: info.ions) {
                -
                1876  for (auto& var: ion.writes) {
                -
                1877  if (ion.is_ionic_current(var)) {
                -
                1878  const auto& lhs = std::string(naming::ION_VARNAME_PREFIX) + "di" + ion.name + "dv";
                -
                1879  auto rhs = fmt::format("(di{}-{})/0.001", ion.name, get_variable_name(var));
                -
                1880  if (info.point_process) {
                -
                1881  auto area = get_variable_name(naming::NODE_AREA_VARIABLE);
                -
                1882  rhs += fmt::format("*1.e2/{}", area);
                -
                1883  }
                -
                1884  const ShadowUseStatement statement{lhs, "+=", rhs};
                -
                1885  const auto& text = process_shadow_update_statement(statement, BlockType::Equation);
                -
                1886  printer->add_line(text);
                -
                1887  }
                -
                1888  }
                -
                1889  }
                -
                1890 }
                -
                1891 
                -
                1892 
                -
                1893 /// TODO: Edit for NEURON
                - -
                1895  printer->add_line("int node_id = node_data.nodeindices[id];");
                -
                1896  printer->add_line("double v = node_data.node_voltages[node_id];");
                -
                1897  printer->add_line("auto* _ppvar = _ml_arg->pdata[id];");
                -
                1898  const auto& read_statements = ion_read_statements(BlockType::Equation);
                -
                1899  for (auto& statement: read_statements) {
                -
                1900  printer->add_line(statement);
                -
                1901  }
                -
                1902 
                -
                1903  if (info.conductances.empty()) {
                -
                1904  print_nrn_cur_non_conductance_kernel();
                -
                1905  } else {
                -
                1906  print_nrn_cur_conductance_kernel(node);
                -
                1907  }
                -
                1908 
                -
                1909  const auto& write_statements = ion_write_statements(BlockType::Equation);
                -
                1910  for (auto& statement: write_statements) {
                -
                1911  auto text = process_shadow_update_statement(statement, BlockType::Equation);
                -
                1912  printer->add_line(text);
                -
                1913  }
                -
                1914 
                -
                1915  if (info.point_process) {
                -
                1916  const auto& area = get_variable_name(naming::NODE_AREA_VARIABLE);
                -
                1917  printer->fmt_line("double mfactor = 1.e2/{};", area);
                -
                1918  printer->add_line("g = g*mfactor;");
                -
                1919  printer->add_line("rhs = rhs*mfactor;");
                -
                1920  }
                -
                1921 
                -
                1922  // print_g_unused();
                -
                1923 }
                -
                1924 
                -
                1925 
                -
                1926 /// TODO: Edit for NEURON
                - -
                1928  return;
                -
                1929 }
                -
                1930 
                -
                1931 
                -
                1932 /// TODO: Edit for NEURON
                - -
                1934  if (!nrn_cur_required()) {
                -
                1935  return;
                -
                1936  }
                -
                1937 
                -
                1938  if (info.conductances.empty()) {
                -
                1939  print_nrn_current(*info.breakpoint_node);
                -
                1940  }
                -
                1941 
                -
                1942  printer->add_newline(2);
                -
                1943  printer->add_line("/** update current */");
                -
                1944  print_global_function_common_code(BlockType::Equation);
                -
                1945  // print_channel_iteration_block_parallel_hint(BlockType::Equation, info.breakpoint_node);
                -
                1946  printer->push_block("for (int id = 0; id < nodecount; id++)");
                -
                1947  print_nrn_cur_kernel(*info.breakpoint_node);
                -
                1948  // print_nrn_cur_matrix_shadow_update();
                -
                1949  // if (!nrn_cur_reduction_loop_required()) {
                -
                1950  // print_fast_imem_calculation();
                -
                1951  // }
                -
                1952 
                -
                1953 
                -
                1954  printer->add_line("node_data.node_rhs[node_id] -= rhs;");
                -
                1955 
                -
                1956  if (breakpoint_exist()) {
                -
                1957  printer->fmt_line("inst.{}[id] = g;",
                -
                1958  info.vectorize ? naming::CONDUCTANCE_UNUSED_VARIABLE
                - -
                1960  }
                -
                1961  printer->pop_block();
                -
                1962 
                -
                1963  // if (nrn_cur_reduction_loop_required()) {
                -
                1964  // printer->push_block("for (int id = 0; id < nodecount; id++)");
                -
                1965  // print_nrn_cur_matrix_shadow_reduction();
                -
                1966  // printer->pop_block();
                -
                1967  // print_fast_imem_calculation();
                -
                1968  // }
                -
                1969 
                -
                1970  // print_kernel_data_present_annotation_block_end();
                -
                1971  printer->pop_block();
                -
                1972 }
                -
                1973 
                +
                1769 
                + +
                1771  if (ion_variable_struct_required()) {
                +
                1772  throw std::runtime_error("Not implemented.");
                +
                1773  }
                +
                1774 
                +
                1775  ParamVector params = {{"", "_nrn_mechanism_cache_range&", "", "_lmc"},
                +
                1776  {"", "NrnThread*", "", "nt"},
                +
                1777  {"", "Datum*", "", "_ppvar"},
                +
                1778  {"", "Datum*", "", "_thread"}};
                +
                1779 
                +
                1780  if (info.thread_callback_register) {
                +
                1781  auto type_name = fmt::format("{}&", thread_variables_struct());
                +
                1782  params.emplace_back("", type_name, "", "_thread_vars");
                +
                1783  }
                +
                1784  params.emplace_back("", "size_t", "", "id");
                +
                1785  params.emplace_back("", fmt::format("{}&", instance_struct()), "", "inst");
                +
                1786  params.emplace_back("", fmt::format("{}&", node_data_struct()), "", "node_data");
                +
                1787  params.emplace_back("", "double", "", "v");
                +
                1788  return params;
                +
                1789 }
                +
                1790 
                +
                1791 
                +
                1792 /// TODO: Edit for NEURON
                + +
                1794  const auto& args = nrn_current_parameters();
                +
                1795  const auto& block = node.get_statement_block();
                +
                1796  printer->add_newline(2);
                +
                1797  printer->fmt_push_block("inline double nrn_current_{}({})",
                +
                1798  info.mod_suffix,
                +
                1799  get_parameter_str(args));
                +
                1800  printer->add_line("double current = 0.0;");
                +
                1801  print_statement_block(*block, false, false);
                +
                1802  for (auto& current: info.currents) {
                +
                1803  const auto& name = get_variable_name(current);
                +
                1804  printer->fmt_line("current += {};", name);
                +
                1805  }
                +
                1806  printer->add_line("return current;");
                +
                1807  printer->pop_block();
                +
                1808 }
                +
                1809 
                +
                1810 
                +
                1811 /// TODO: Edit for NEURON
                + +
                1813  const auto& block = node.get_statement_block();
                +
                1814  print_statement_block(*block, false, false);
                +
                1815  if (!info.currents.empty()) {
                +
                1816  std::string sum;
                +
                1817  for (const auto& current: info.currents) {
                +
                1818  auto var = breakpoint_current(current);
                +
                1819  sum += get_variable_name(var);
                +
                1820  if (&current != &info.currents.back()) {
                +
                1821  sum += "+";
                +
                1822  }
                +
                1823  }
                +
                1824  printer->fmt_line("double rhs = {};", sum);
                +
                1825  }
                +
                1826 
                +
                1827  std::string sum;
                +
                1828  for (const auto& conductance: info.conductances) {
                +
                1829  auto var = breakpoint_current(conductance.variable);
                +
                1830  sum += get_variable_name(var);
                +
                1831  if (&conductance != &info.conductances.back()) {
                +
                1832  sum += "+";
                +
                1833  }
                +
                1834  }
                +
                1835  printer->fmt_line("double g = {};", sum);
                +
                1836 
                +
                1837  for (const auto& conductance: info.conductances) {
                +
                1838  if (!conductance.ion.empty()) {
                +
                1839  const auto& lhs = std::string(naming::ION_VARNAME_PREFIX) + "di" + conductance.ion +
                +
                1840  "dv";
                +
                1841  const auto& rhs = get_variable_name(conductance.variable);
                +
                1842  const ShadowUseStatement statement{lhs, "+=", rhs};
                +
                1843  const auto& text = process_shadow_update_statement(statement, BlockType::Equation);
                +
                1844  printer->add_line(text);
                +
                1845  }
                +
                1846  }
                +
                1847 }
                +
                1848 
                +
                1849 
                +
                1850 /// TODO: Edit for NEURON
                + +
                1852  printer->fmt_line("double I1 = nrn_current_{}({}+0.001);",
                +
                1853  info.mod_suffix,
                +
                1854  nrn_current_arguments());
                +
                1855  for (auto& ion: info.ions) {
                +
                1856  for (auto& var: ion.writes) {
                +
                1857  if (ion.is_ionic_current(var)) {
                +
                1858  const auto& name = get_variable_name(var);
                +
                1859  printer->fmt_line("double di{} = {};", ion.name, name);
                +
                1860  }
                +
                1861  }
                +
                1862  }
                +
                1863  printer->fmt_line("double I0 = nrn_current_{}({});", info.mod_suffix, nrn_current_arguments());
                +
                1864  printer->add_line("double rhs = I0;");
                +
                1865 
                +
                1866  printer->add_line("double g = (I1-I0)/0.001;");
                +
                1867  for (auto& ion: info.ions) {
                +
                1868  for (auto& var: ion.writes) {
                +
                1869  if (ion.is_ionic_current(var)) {
                +
                1870  const auto& lhs = std::string(naming::ION_VARNAME_PREFIX) + "di" + ion.name + "dv";
                +
                1871  auto rhs = fmt::format("(di{}-{})/0.001", ion.name, get_variable_name(var));
                +
                1872  if (info.point_process) {
                +
                1873  auto area = get_variable_name(naming::NODE_AREA_VARIABLE);
                +
                1874  rhs += fmt::format("*1.e2/{}", area);
                +
                1875  }
                +
                1876  const ShadowUseStatement statement{lhs, "+=", rhs};
                +
                1877  const auto& text = process_shadow_update_statement(statement, BlockType::Equation);
                +
                1878  printer->add_line(text);
                +
                1879  }
                +
                1880  }
                +
                1881  }
                +
                1882 }
                +
                1883 
                +
                1884 
                +
                1885 /// TODO: Edit for NEURON
                + +
                1887  printer->add_line("int node_id = node_data.nodeindices[id];");
                +
                1888  printer->add_line("double v = node_data.node_voltages[node_id];");
                +
                1889  printer->add_line("auto* _ppvar = _ml_arg->pdata[id];");
                +
                1890  const auto& read_statements = ion_read_statements(BlockType::Equation);
                +
                1891  for (auto& statement: read_statements) {
                +
                1892  printer->add_line(statement);
                +
                1893  }
                +
                1894 
                +
                1895  if (info.conductances.empty()) {
                +
                1896  print_nrn_cur_non_conductance_kernel();
                +
                1897  } else {
                +
                1898  print_nrn_cur_conductance_kernel(node);
                +
                1899  }
                +
                1900 
                +
                1901  const auto& write_statements = ion_write_statements(BlockType::Equation);
                +
                1902  for (auto& statement: write_statements) {
                +
                1903  auto text = process_shadow_update_statement(statement, BlockType::Equation);
                +
                1904  printer->add_line(text);
                +
                1905  }
                +
                1906 
                +
                1907  if (info.point_process) {
                +
                1908  const auto& area = get_variable_name(naming::NODE_AREA_VARIABLE);
                +
                1909  printer->fmt_line("double mfactor = 1.e2/{};", area);
                +
                1910  printer->add_line("g = g*mfactor;");
                +
                1911  printer->add_line("rhs = rhs*mfactor;");
                +
                1912  }
                +
                1913 
                +
                1914  // print_g_unused();
                +
                1915 }
                +
                1916 
                +
                1917 
                +
                1918 /// TODO: Edit for NEURON
                + +
                1920  return;
                +
                1921 }
                +
                1922 
                +
                1923 
                +
                1924 /// TODO: Edit for NEURON
                + +
                1926  if (!nrn_cur_required()) {
                +
                1927  return;
                +
                1928  }
                +
                1929 
                +
                1930  if (info.conductances.empty()) {
                +
                1931  print_nrn_current(*info.breakpoint_node);
                +
                1932  }
                +
                1933 
                +
                1934  printer->add_newline(2);
                +
                1935  printer->add_line("/** update current */");
                +
                1936  print_global_function_common_code(BlockType::Equation);
                +
                1937  // print_channel_iteration_block_parallel_hint(BlockType::Equation, info.breakpoint_node);
                +
                1938  printer->push_block("for (int id = 0; id < nodecount; id++)");
                +
                1939  print_nrn_cur_kernel(*info.breakpoint_node);
                +
                1940  // print_nrn_cur_matrix_shadow_update();
                +
                1941  // if (!nrn_cur_reduction_loop_required()) {
                +
                1942  // print_fast_imem_calculation();
                +
                1943  // }
                +
                1944 
                +
                1945 
                +
                1946  printer->add_line("node_data.node_rhs[node_id] -= rhs;");
                +
                1947 
                +
                1948  if (breakpoint_exist()) {
                +
                1949  printer->fmt_line("inst.{}[id] = g;",
                +
                1950  info.vectorize ? naming::CONDUCTANCE_UNUSED_VARIABLE
                + +
                1952  }
                +
                1953  printer->pop_block();
                +
                1954 
                +
                1955  // if (nrn_cur_reduction_loop_required()) {
                +
                1956  // printer->push_block("for (int id = 0; id < nodecount; id++)");
                +
                1957  // print_nrn_cur_matrix_shadow_reduction();
                +
                1958  // printer->pop_block();
                +
                1959  // print_fast_imem_calculation();
                +
                1960  // }
                +
                1961 
                +
                1962  // print_kernel_data_present_annotation_block_end();
                +
                1963  printer->pop_block();
                +
                1964 }
                +
                1965 
                +
                1966 
                +
                1967 /****************************************************************************************/
                +
                1968 /* Main code printing entry points */
                +
                1969 /****************************************************************************************/
                +
                1970 
                + +
                1972  print_standard_includes();
                +
                1973  print_neuron_includes();
                1974 
                -
                1975 /****************************************************************************************/
                -
                1976 /* Main code printing entry points */
                -
                1977 /****************************************************************************************/
                -
                1978 
                - -
                1980  print_standard_includes();
                -
                1981  print_neuron_includes();
                -
                1982 
                -
                1983  if (info.thread_callback_register) {
                -
                1984  printer->add_line("extern void _nrn_thread_reg(int, int, void(*)(Datum*));");
                -
                1985  }
                +
                1975  if (info.thread_callback_register) {
                +
                1976  printer->add_line("extern void _nrn_thread_reg(int, int, void(*)(Datum*));");
                +
                1977  }
                +
                1978 }
                +
                1979 
                +
                1980 
                + +
                1982  print_global_macros();
                +
                1983  print_mechanism_variables_macros();
                +
                1984 
                +
                1985  printer->add_line("extern Node* nrn_alloc_node_;");
                1986 }
                1987 
                1988 
                - -
                1990  print_global_macros();
                -
                1991  print_mechanism_variables_macros();
                -
                1992 
                -
                1993  printer->add_line("extern Node* nrn_alloc_node_;");
                -
                1994 }
                -
                1995 
                -
                1996 
                - -
                1998  printer->add_newline();
                -
                1999  printer->add_line("/* NEURON global macro definitions */");
                -
                2000  if (info.vectorize) {
                -
                2001  printer->add_multi_line(R"CODE(
                -
                2002  /* VECTORIZED */
                -
                2003  #define NRN_VECTORIZED 1
                -
                2004  )CODE");
                -
                2005  } else {
                -
                2006  printer->add_multi_line(R"CODE(
                -
                2007  /* NOT VECTORIZED */
                -
                2008  #define NRN_VECTORIZED 0
                -
                2009  )CODE");
                -
                2010  }
                -
                2011 }
                -
                2012 
                -
                2013 
                - -
                2015  printer->add_newline();
                -
                2016  printer->add_line("static constexpr auto number_of_datum_variables = ",
                -
                2017  std::to_string(int_variables_size()),
                -
                2018  ";");
                -
                2019  printer->add_line("static constexpr auto number_of_floating_point_variables = ",
                -
                2020  std::to_string(codegen_float_variables.size()),
                -
                2021  ";");
                -
                2022  printer->add_newline();
                -
                2023  printer->add_multi_line(R"CODE(
                -
                2024  namespace {
                -
                2025  template <typename T>
                -
                2026  using _nrn_mechanism_std_vector = std::vector<T>;
                -
                2027  using _nrn_model_sorted_token = neuron::model_sorted_token;
                -
                2028  using _nrn_mechanism_cache_range = neuron::cache::MechanismRange<number_of_floating_point_variables, number_of_datum_variables>;
                -
                2029  using _nrn_mechanism_cache_instance = neuron::cache::MechanismInstance<number_of_floating_point_variables, number_of_datum_variables>;
                -
                2030  using _nrn_non_owning_id_without_container = neuron::container::non_owning_identifier_without_container;
                -
                2031  template <typename T>
                -
                2032  using _nrn_mechanism_field = neuron::mechanism::field<T>;
                -
                2033  template <typename... Args>
                -
                2034  void _nrn_mechanism_register_data_fields(Args&&... args) {
                -
                2035  neuron::mechanism::register_data_fields(std::forward<Args>(args)...);
                -
                2036  }
                -
                2037  } // namespace
                -
                2038  )CODE");
                -
                2039 
                -
                2040  if (info.point_process) {
                -
                2041  printer->add_line("extern Prop* nrn_point_prop_;");
                -
                2042  } else {
                -
                2043  printer->add_line("Prop* hoc_getdata_range(int type);");
                -
                2044  }
                -
                2045  /// TODO: More prints here?
                -
                2046  // for registration of tables
                -
                2047  if (info.table_count > 0) {
                -
                2048  printer->add_line("void _nrn_thread_table_reg(int, nrn_thread_table_check_t);");
                -
                2049  }
                -
                2050 }
                -
                2051 
                -
                2052 
                - -
                2054  print_namespace_start();
                -
                2055 }
                -
                2056 
                -
                2057 
                - -
                2059  print_namespace_stop();
                -
                2060 }
                -
                2061 
                -
                2062 
                -
                2063 void CodegenNeuronCppVisitor::print_data_structures(bool print_initializers) {
                -
                2064  print_mechanism_global_var_structure(print_initializers);
                -
                2065  print_mechanism_range_var_structure(print_initializers);
                -
                2066  print_node_data_structure(print_initializers);
                -
                2067  print_thread_variables_structure(print_initializers);
                -
                2068  print_make_instance();
                -
                2069  print_make_node_data();
                -
                2070 }
                -
                2071 
                -
                2072 
                - -
                2074  if (!info.vectorize) {
                -
                2075  return;
                -
                2076  }
                -
                2077  printer->add_multi_line(R"CODE(
                -
                2078  #if NRN_PRCELLSTATE
                -
                2079  inst->v_unused[id] = v;
                -
                2080  #endif
                -
                2081  )CODE");
                -
                2082 }
                -
                2083 
                + +
                1990  printer->add_newline();
                +
                1991  printer->add_line("/* NEURON global macro definitions */");
                +
                1992  if (info.vectorize) {
                +
                1993  printer->add_multi_line(R"CODE(
                +
                1994  /* VECTORIZED */
                +
                1995  #define NRN_VECTORIZED 1
                +
                1996  )CODE");
                +
                1997  } else {
                +
                1998  printer->add_multi_line(R"CODE(
                +
                1999  /* NOT VECTORIZED */
                +
                2000  #define NRN_VECTORIZED 0
                +
                2001  )CODE");
                +
                2002  }
                +
                2003 }
                +
                2004 
                +
                2005 
                + +
                2007  printer->add_newline();
                +
                2008  printer->add_line("static constexpr auto number_of_datum_variables = ",
                +
                2009  std::to_string(int_variables_size()),
                +
                2010  ";");
                +
                2011  printer->add_line("static constexpr auto number_of_floating_point_variables = ",
                +
                2012  std::to_string(codegen_float_variables.size()),
                +
                2013  ";");
                +
                2014  printer->add_newline();
                +
                2015  printer->add_multi_line(R"CODE(
                +
                2016  namespace {
                +
                2017  template <typename T>
                +
                2018  using _nrn_mechanism_std_vector = std::vector<T>;
                +
                2019  using _nrn_model_sorted_token = neuron::model_sorted_token;
                +
                2020  using _nrn_mechanism_cache_range = neuron::cache::MechanismRange<number_of_floating_point_variables, number_of_datum_variables>;
                +
                2021  using _nrn_mechanism_cache_instance = neuron::cache::MechanismInstance<number_of_floating_point_variables, number_of_datum_variables>;
                +
                2022  using _nrn_non_owning_id_without_container = neuron::container::non_owning_identifier_without_container;
                +
                2023  template <typename T>
                +
                2024  using _nrn_mechanism_field = neuron::mechanism::field<T>;
                +
                2025  template <typename... Args>
                +
                2026  void _nrn_mechanism_register_data_fields(Args&&... args) {
                +
                2027  neuron::mechanism::register_data_fields(std::forward<Args>(args)...);
                +
                2028  }
                +
                2029  } // namespace
                +
                2030  )CODE");
                +
                2031 
                +
                2032  if (info.point_process) {
                +
                2033  printer->add_line("extern Prop* nrn_point_prop_;");
                +
                2034  } else {
                +
                2035  printer->add_line("Prop* hoc_getdata_range(int type);");
                +
                2036  }
                +
                2037  /// TODO: More prints here?
                +
                2038  // for registration of tables
                +
                2039  if (info.table_count > 0) {
                +
                2040  printer->add_line("void _nrn_thread_table_reg(int, nrn_thread_table_check_t);");
                +
                2041  }
                +
                2042 }
                +
                2043 
                +
                2044 
                + +
                2046  print_namespace_start();
                +
                2047 }
                +
                2048 
                +
                2049 
                + +
                2051  print_namespace_stop();
                +
                2052 }
                +
                2053 
                +
                2054 
                +
                2055 void CodegenNeuronCppVisitor::print_data_structures(bool print_initializers) {
                +
                2056  print_mechanism_global_var_structure(print_initializers);
                +
                2057  print_mechanism_range_var_structure(print_initializers);
                +
                2058  print_node_data_structure(print_initializers);
                +
                2059  print_thread_variables_structure(print_initializers);
                +
                2060  print_make_instance();
                +
                2061  print_make_node_data();
                +
                2062 }
                +
                2063 
                +
                2064 
                + +
                2066  if (!info.vectorize) {
                +
                2067  return;
                +
                2068  }
                +
                2069  printer->add_multi_line(R"CODE(
                +
                2070  #if NRN_PRCELLSTATE
                +
                2071  inst->v_unused[id] = v;
                +
                2072  #endif
                +
                2073  )CODE");
                +
                2074 }
                +
                2075 
                +
                2076 
                + +
                2078  printer->add_multi_line(R"CODE(
                +
                2079  #if NRN_PRCELLSTATE
                +
                2080  inst->g_unused[id] = g;
                +
                2081  #endif
                +
                2082  )CODE");
                +
                2083 }
                2084 
                - -
                2086  printer->add_multi_line(R"CODE(
                -
                2087  #if NRN_PRCELLSTATE
                -
                2088  inst->g_unused[id] = g;
                -
                2089  #endif
                -
                2090  )CODE");
                -
                2091 }
                -
                2092 
                -
                2093 
                -
                2094 /// TODO: Edit for NEURON
                - -
                2096  print_hoc_py_wrapper_function_definitions();
                -
                2097  for (const auto& procedure: info.procedures) {
                -
                2098  print_procedure(*procedure);
                -
                2099  }
                -
                2100  for (const auto& function: info.functions) {
                -
                2101  print_function(*function);
                -
                2102  }
                -
                2103  print_nrn_init();
                -
                2104  print_nrn_cur();
                -
                2105  print_nrn_state();
                -
                2106  print_nrn_jacob();
                -
                2107  print_net_receive();
                -
                2108 }
                -
                2109 
                -
                2110 
                -
                2111 /// TODO: Edit for NEURON
                - -
                2113  print_backend_info();
                -
                2114  print_headers_include();
                -
                2115  print_macro_definitions();
                -
                2116  print_neuron_global_variable_declarations();
                -
                2117  print_namespace_begin();
                -
                2118  print_nmodl_constants();
                -
                2119  print_prcellstate_macros();
                -
                2120  print_mechanism_info();
                -
                2121  print_data_structures(true);
                -
                2122  print_nrn_alloc();
                -
                2123  print_function_prototypes();
                -
                2124  print_functors_definitions();
                -
                2125  print_global_variables_for_hoc();
                -
                2126  print_thread_memory_callbacks();
                -
                2127  print_compute_functions(); // only nrn_cur and nrn_state
                -
                2128  print_sdlists_init(true);
                -
                2129  print_mechanism_register();
                -
                2130  print_namespace_end();
                -
                2131 }
                +
                2085 
                +
                2086 /// TODO: Edit for NEURON
                + +
                2088  print_hoc_py_wrapper_function_definitions();
                +
                2089  for (const auto& procedure: info.procedures) {
                +
                2090  print_procedure(*procedure);
                +
                2091  }
                +
                2092  for (const auto& function: info.functions) {
                +
                2093  print_function(*function);
                +
                2094  }
                +
                2095  print_nrn_init();
                +
                2096  print_nrn_cur();
                +
                2097  print_nrn_state();
                +
                2098  print_nrn_jacob();
                +
                2099  print_net_receive();
                +
                2100 }
                +
                2101 
                +
                2102 
                +
                2103 /// TODO: Edit for NEURON
                + +
                2105  print_backend_info();
                +
                2106  print_headers_include();
                +
                2107  print_macro_definitions();
                +
                2108  print_neuron_global_variable_declarations();
                +
                2109  print_namespace_begin();
                +
                2110  print_nmodl_constants();
                +
                2111  print_prcellstate_macros();
                +
                2112  print_mechanism_info();
                +
                2113  print_data_structures(true);
                +
                2114  print_nrn_alloc();
                +
                2115  print_function_prototypes();
                +
                2116  print_functors_definitions();
                +
                2117  print_global_variables_for_hoc();
                +
                2118  print_thread_memory_callbacks();
                +
                2119  print_compute_functions(); // only nrn_cur and nrn_state
                +
                2120  print_sdlists_init(true);
                +
                2121  print_mechanism_register();
                +
                2122  print_namespace_end();
                +
                2123 }
                +
                2124 
                + +
                2126  throw std::runtime_error("Not implemented.");
                +
                2127 }
                +
                2128 
                +
                2129 
                + +
                2131  auto const& arguments = node.get_arguments();
                2132 
                - -
                2134  throw std::runtime_error("Not implemented.");
                -
                2135 }
                +
                2133  if (printing_net_init) {
                +
                2134  throw std::runtime_error("Not implemented. [jfiwoei]");
                +
                2135  }
                2136 
                -
                2137 
                - -
                2139  auto const& arguments = node.get_arguments();
                -
                2140 
                -
                2141  if (printing_net_init) {
                -
                2142  throw std::runtime_error("Not implemented. [jfiwoei]");
                -
                2143  }
                +
                2137  std::string weight_pointer = "nullptr";
                +
                2138  auto point_process = get_variable_name(naming::POINT_PROCESS_VARIABLE,
                +
                2139  /* use_instance */ false);
                +
                2140  if (!printing_net_receive) {
                +
                2141  point_process += ".get<Point_process*>()";
                +
                2142  }
                +
                2143  const auto& tqitem = get_variable_name("tqitem", /* use_instance */ false);
                2144 
                -
                2145  std::string weight_pointer = "nullptr";
                -
                2146  auto point_process = get_variable_name(naming::POINT_PROCESS_VARIABLE,
                -
                2147  /* use_instance */ false);
                -
                2148  if (!printing_net_receive) {
                -
                2149  point_process += ".get<Point_process*>()";
                -
                2150  }
                -
                2151  const auto& tqitem = get_variable_name("tqitem", /* use_instance */ false);
                -
                2152 
                -
                2153  printer->fmt_text("net_send(/* tqitem */ &{}, {}, {}, {} + ",
                -
                2154  tqitem,
                -
                2155  weight_pointer,
                -
                2156  point_process,
                -
                2157  get_variable_name("t"));
                -
                2158  print_vector_elements(arguments, ", ");
                -
                2159  printer->add_text(')');
                -
                2160 }
                -
                2161 
                - -
                2163  const auto& point_process = get_variable_name("point_process", /* use_instance */ false);
                -
                2164  const auto& tqitem = get_variable_name("tqitem", /* use_instance */ false);
                -
                2165 
                -
                2166  printer->fmt_text("net_move(/* tqitem */ &{}, {}, ", tqitem, point_process);
                -
                2167 
                -
                2168  print_vector_elements(node.get_arguments(), ", ");
                -
                2169  printer->add_text(')');
                -
                2170 }
                -
                2171 
                - -
                2173  const auto& point_process = get_variable_name(naming::POINT_PROCESS_VARIABLE,
                -
                2174  /* use_instance */ false);
                -
                2175  printer->fmt_text("net_event({}, t)", point_process);
                -
                2176 }
                -
                2177 
                -
                2178 /**
                -
                2179  * Rename arguments to NET_RECEIVE block with corresponding pointer variable
                +
                2145  printer->fmt_text("net_send(/* tqitem */ &{}, {}, {}, {} + ",
                +
                2146  tqitem,
                +
                2147  weight_pointer,
                +
                2148  point_process,
                +
                2149  get_variable_name("t"));
                +
                2150  print_vector_elements(arguments, ", ");
                +
                2151  printer->add_text(')');
                +
                2152 }
                +
                2153 
                + +
                2155  const auto& point_process = get_variable_name("point_process", /* use_instance */ false);
                +
                2156  const auto& tqitem = get_variable_name("tqitem", /* use_instance */ false);
                +
                2157 
                +
                2158  printer->fmt_text("net_move(/* tqitem */ &{}, {}, ", tqitem, point_process);
                +
                2159 
                +
                2160  print_vector_elements(node.get_arguments(), ", ");
                +
                2161  printer->add_text(')');
                +
                2162 }
                +
                2163 
                + +
                2165  const auto& point_process = get_variable_name(naming::POINT_PROCESS_VARIABLE,
                +
                2166  /* use_instance */ false);
                +
                2167  printer->fmt_text("net_event({}, t)", point_process);
                +
                2168 }
                +
                2169 
                +
                2170 /**
                +
                2171  * Rename arguments to NET_RECEIVE block with corresponding pointer variable
                +
                2172  *
                +
                2173  * \code{.mod}
                +
                2174  * NET_RECEIVE (weight, R){
                +
                2175  * x = R
                +
                2176  * }
                +
                2177  * \endcode
                +
                2178  *
                +
                2179  * then generated code should be:
                2180  *
                -
                2181  * \code{.mod}
                -
                2182  * NET_RECEIVE (weight, R){
                -
                2183  * x = R
                -
                2184  * }
                -
                2185  * \endcode
                -
                2186  *
                -
                2187  * then generated code should be:
                -
                2188  *
                -
                2189  * \code{.cpp}
                -
                2190  * x[id] = _args[1];
                -
                2191  * \endcode
                -
                2192  *
                -
                2193  * So, the `R` in AST needs to be renamed with `_args[1]`.
                -
                2194  */
                -
                2195 static void rename_net_receive_arguments(const ast::NetReceiveBlock& net_receive_node,
                -
                2196  const ast::Node& node) {
                -
                2197  const auto& parameters = net_receive_node.get_parameters();
                -
                2198 
                -
                2199  auto n_parameters = parameters.size();
                -
                2200  for (size_t i = 0; i < n_parameters; ++i) {
                -
                2201  const auto& name = parameters[i]->get_node_name();
                -
                2202  auto var_used = VarUsageVisitor().variable_used(node, name);
                -
                2203  if (var_used) {
                -
                2204  RenameVisitor vr(name, fmt::format("_args[{}]", i));
                -
                2205  node.get_statement_block()->visit_children(vr);
                -
                2206  }
                +
                2181  * \code{.cpp}
                +
                2182  * x[id] = _args[1];
                +
                2183  * \endcode
                +
                2184  *
                +
                2185  * So, the `R` in AST needs to be renamed with `_args[1]`.
                +
                2186  */
                +
                2187 static void rename_net_receive_arguments(const ast::NetReceiveBlock& net_receive_node,
                +
                2188  const ast::Node& node) {
                +
                2189  const auto& parameters = net_receive_node.get_parameters();
                +
                2190 
                +
                2191  auto n_parameters = parameters.size();
                +
                2192  for (size_t i = 0; i < n_parameters; ++i) {
                +
                2193  const auto& name = parameters[i]->get_node_name();
                +
                2194  auto var_used = VarUsageVisitor().variable_used(node, name);
                +
                2195  if (var_used) {
                +
                2196  RenameVisitor vr(name, fmt::format("_args[{}]", i));
                +
                2197  node.get_statement_block()->visit_children(vr);
                +
                2198  }
                +
                2199  }
                +
                2200 }
                +
                2201 
                + +
                2203  printing_net_receive = true;
                +
                2204  auto node = info.net_receive_node;
                +
                2205  if (!node) {
                +
                2206  return;
                2207  }
                -
                2208 }
                -
                2209 
                - -
                2211  printing_net_receive = true;
                -
                2212  auto node = info.net_receive_node;
                -
                2213  if (!node) {
                -
                2214  return;
                -
                2215  }
                +
                2208 
                +
                2209  ParamVector args = {{"", "Point_process*", "", "_pnt"},
                +
                2210  {"", "double*", "", "_args"},
                +
                2211  {"", "double", "", "flag"}};
                +
                2212 
                +
                2213  printer->fmt_push_block("static void nrn_net_receive_{}({})",
                +
                2214  info.mod_suffix,
                +
                2215  get_parameter_str(args));
                2216 
                -
                2217  ParamVector args = {{"", "Point_process*", "", "_pnt"},
                -
                2218  {"", "double*", "", "_args"},
                -
                2219  {"", "double", "", "flag"}};
                -
                2220 
                -
                2221  printer->fmt_push_block("static void nrn_net_receive_{}({})",
                -
                2222  info.mod_suffix,
                -
                2223  get_parameter_str(args));
                -
                2224 
                -
                2225  rename_net_receive_arguments(*node, *node);
                -
                2226 
                -
                2227  printer->add_line("_nrn_mechanism_cache_instance _lmc{_pnt->prop};");
                -
                2228  printer->add_line("auto * nt = static_cast<NrnThread*>(_pnt->_vnt);");
                -
                2229  printer->add_line("auto * _ppvar = _nrn_mechanism_access_dparam(_pnt->prop);");
                -
                2230 
                -
                2231  printer->fmt_line("auto inst = make_instance_{}(_lmc);", info.mod_suffix);
                -
                2232  printer->fmt_line("// nocmodl has a nullptr dereference for thread variables.");
                -
                2233  printer->fmt_line("// NMODL will fail to compile at a later point, because of");
                -
                2234  printer->fmt_line("// missing '_thread_vars'.");
                -
                2235  printer->fmt_line("Datum * _thread = nullptr;");
                -
                2236 
                -
                2237  printer->add_line("size_t id = 0;");
                -
                2238  printer->add_line("double t = nt->_t;");
                +
                2217  rename_net_receive_arguments(*node, *node);
                +
                2218 
                +
                2219  printer->add_line("_nrn_mechanism_cache_instance _lmc{_pnt->prop};");
                +
                2220  printer->add_line("auto * nt = static_cast<NrnThread*>(_pnt->_vnt);");
                +
                2221  printer->add_line("auto * _ppvar = _nrn_mechanism_access_dparam(_pnt->prop);");
                +
                2222 
                +
                2223  printer->fmt_line("auto inst = make_instance_{}(_lmc);", info.mod_suffix);
                +
                2224  printer->fmt_line("// nocmodl has a nullptr dereference for thread variables.");
                +
                2225  printer->fmt_line("// NMODL will fail to compile at a later point, because of");
                +
                2226  printer->fmt_line("// missing '_thread_vars'.");
                +
                2227  printer->fmt_line("Datum * _thread = nullptr;");
                +
                2228 
                +
                2229  printer->add_line("size_t id = 0;");
                +
                2230  printer->add_line("double t = nt->_t;");
                +
                2231 
                +
                2232  print_statement_block(*node->get_statement_block(), false, false);
                +
                2233 
                +
                2234  printer->add_newline();
                +
                2235  printer->pop_block();
                +
                2236  printing_net_receive = false;
                +
                2237 }
                +
                2238 
                2239 
                -
                2240  print_statement_block(*node->get_statement_block(), false, false);
                -
                2241 
                -
                2242  printer->add_newline();
                -
                2243  printer->pop_block();
                -
                2244  printing_net_receive = false;
                -
                2245 }
                -
                2246 
                -
                2247 
                -
                2248 /****************************************************************************************/
                -
                2249 /* Overloaded visitor routines */
                -
                2250 /****************************************************************************************/
                -
                2251 
                -
                2252 /// TODO: Edit for NEURON
                - -
                2254  return;
                -
                2255 }
                -
                2256 
                -
                2257 
                -
                2258 } // namespace codegen
                -
                2259 } // namespace nmodl
                +
                2240 /****************************************************************************************/
                +
                2241 /* Overloaded visitor routines */
                +
                2242 /****************************************************************************************/
                +
                2243 
                +
                2244 /// TODO: Edit for NEURON
                + +
                2246  return;
                +
                2247 }
                +
                2248 
                +
                2249 
                +
                2250 } // namespace codegen
                +
                2251 } // namespace nmodl
                static bool starts_with(const std::string &haystack, const std::string &needle)
                Check if haystack starts with needle.
                -
                void print_nrn_destructor() override
                Print nrn_destructor function definition.
                +
                void print_nrn_destructor() override
                Print nrn_destructor function definition.
                Base class for all AST node.
                Definition: node.hpp:40
                bool is_index
                if this is pure index (e.g.
                -
                void print_nrn_cur_non_conductance_kernel() override
                Print the nrn_cur kernel without NMODL conductance keyword provisions.
                -
                std::string py_function_signature(const std::string &function_or_procedure_name) const
                Get the signature of the npy <func_or_proc_name> function.
                +
                void print_nrn_cur_non_conductance_kernel() override
                Print the nrn_cur kernel without NMODL conductance keyword provisions.
                +
                std::string py_function_signature(const std::string &function_or_procedure_name) const
                Get the signature of the npy <func_or_proc_name> function.
                Helper to represent information about index/int variables.
                -
                void print_nrn_cur() override
                Print nrn_cur / current update function definition.
                -
                void print_macro_definitions()
                Print all NEURON macros.
                +
                void print_nrn_cur() override
                Print nrn_cur / current update function definition.
                +
                void print_macro_definitions()
                Print all NEURON macros.
                -
                void print_net_event_call(const ast::FunctionCall &node) override
                Print call to net_event.
                +
                void print_net_event_call(const ast::FunctionCall &node) override
                Print call to net_event.
                static constexpr char POINT_PROCESS_VARIABLE[]
                inbuilt neuron variable for point process
                -
                void print_neuron_includes()
                Print includes from NEURON.
                +
                void print_neuron_includes()
                Print includes from NEURON.
                static constexpr char NRN_JACOB_METHOD[]
                nrn_jacob method in generated code
                -
                void print_nrn_init(bool skip_init_check=true)
                Print the nrn_init function definition.
                +
                void print_nrn_init(bool skip_init_check=true)
                Print the nrn_init function definition.
                -
                void print_hoc_py_wrapper_function_body(const ast::Block *function_or_procedure_block, InterpreterWrapper wrapper_type)
                -
                std::string internal_method_arguments() override
                Arguments for functions that are defined and used internally.
                +
                void print_hoc_py_wrapper_function_body(const ast::Block *function_or_procedure_block, InterpreterWrapper wrapper_type)
                +
                std::string internal_method_arguments() override
                Arguments for functions that are defined and used internally.
                std::shared_ptr< symtab::Symbol > SymbolType
                -
                void print_nrn_alloc() override
                Print nrn_alloc function definition.
                +
                void print_nrn_alloc() override
                Print nrn_alloc function definition.
                static constexpr char VOLTAGE_UNUSED_VARIABLE[]
                range variable for voltage when unused (for vectorized model)
                -
                std::string register_mechanism_arguments() const override
                Arguments for register_mech or point_register_mech function.
                -
                int position_of_int_var(const std::string &name) const override
                Determine the position in the data array for a given int variable.
                +
                std::string register_mechanism_arguments() const override
                Arguments for register_mech or point_register_mech function.
                +
                int position_of_int_var(const std::string &name) const override
                Determine the position in the data array for a given int variable.
                const ArgumentVector & get_parameters() const noexcept override
                Getter for member variable NetReceiveBlock::parameters.
                - -
                std::string table_thread_function_name() const
                Name of the threaded table checking function.
                -
                bool optimize_ion_variable_copies() const override
                Check if ion variable copies should be avoided.
                -
                std::string hoc_function_name(const std::string &function_or_procedure_name) const
                All functions and procedures need a hoc <func_or_proc_name> to be available to the HOC interpreter.
                + +
                std::string table_thread_function_name() const
                Name of the threaded table checking function.
                +
                bool optimize_ion_variable_copies() const override
                Check if ion variable copies should be avoided.
                +
                std::string hoc_function_name(const std::string &function_or_procedure_name) const
                All functions and procedures need a hoc <func_or_proc_name> to be available to the HOC interpreter.
                encapsulates code generation backend implementations
                Definition: ast_common.hpp:26
                std::shared_ptr< StatementBlock > get_statement_block() const noexcept override
                Getter for member variable InitialBlock::statement_block.
                -
                std::string global_variable_name(const SymbolType &symbol, bool use_instance=true) const override
                Determine the variable name for a global variable given its symbol.
                -
                Represent ions used in mod file.
                -
                std::string nrn_thread_internal_arguments() override
                Arguments for "_threadargs_" macro in neuron implementation.
                +
                std::string global_variable_name(const SymbolType &symbol, bool use_instance=true) const override
                Determine the variable name for a global variable given its symbol.
                +
                Represent ions used in mod file.
                +
                std::string nrn_thread_internal_arguments() override
                Arguments for "_threadargs_" macro in neuron implementation.
                Visitor for printing C++ code compatible with legacy api of NEURON
                -
                std::string backend_name() const override
                Name of the code generation backend.
                -
                std::string process_verbatim_text(std::string const &text) override
                Process a verbatim block for possible variable renaming.
                - -
                std::string name
                name of the ion
                +
                std::string backend_name() const override
                Name of the code generation backend.
                +
                std::string process_verbatim_text(std::string const &text) override
                Process a verbatim block for possible variable renaming.
                + +
                std::string name
                name of the ion
                static constexpr char NTHREAD_DT_VARIABLE[]
                dt variable in neuron thread structure
                -
                void print_g_unused() const override
                Set g_unused (conductance) for NRN_PRCELLSTATE feature.
                -
                void visit_watch_statement(const ast::WatchStatement &node) override
                TODO: Edit for NEURON.
                +
                void print_g_unused() const override
                Set g_unused (conductance) for NRN_PRCELLSTATE feature.
                +
                void visit_watch_statement(const ast::WatchStatement &node) override
                TODO: Edit for NEURON.
                virtual bool is_procedure_block() const noexcept
                Check if the ast node is an instance of ast::ProcedureBlock.
                Definition: ast.cpp:144
                -
                void print_net_send_call(const ast::FunctionCall &node) override
                Print call to net_send.
                +
                void print_net_send_call(const ast::FunctionCall &node) override
                Print call to net_send.
                Check if variable is used in given block.
                Implement string manipulation functions.
                -
                void print_namespace_end() override
                Print end of namespaces.
                -
                void print_net_move_call(const ast::FunctionCall &node) override
                Print call to net_move.
                -
                std::string thread_variable_name(const ThreadVariableInfo &var_info, bool use_instance=true) const
                Determine the C++ string to print for thread variables.
                +
                void print_namespace_end() override
                Print end of namespaces.
                +
                void print_net_move_call(const ast::FunctionCall &node) override
                Print call to net_move.
                +
                std::string thread_variable_name(const ThreadVariableInfo &var_info, bool use_instance=true) const
                Determine the C++ string to print for thread variables.
                static constexpr char NODE_AREA_VARIABLE[]
                inbuilt neuron variable for area of the compartment
                -
                void print_nrn_state() override
                Print nrn_state / state update function definition.
                +
                void print_nrn_state() override
                Print nrn_state / state update function definition.
                virtual bool is_function_block() const noexcept
                Check if the ast node is an instance of ast::FunctionBlock.
                Definition: ast.cpp:142
                static constexpr char NRN_ALLOC_METHOD[]
                nrn_alloc method in generated code
                -
                void print_initial_block(const ast::InitialBlock *node)
                Print the initial block.
                +
                void print_initial_block(const ast::InitialBlock *node)
                Print the initial block.
                bool is_integer
                if this is an integer (e.g.
                -
                void print_global_function_common_code(BlockType type, const std::string &function_name="") override
                Print common code for global functions like nrn_init, nrn_cur and nrn_state.
                -
                std::string float_variable_name(const SymbolType &symbol, bool use_instance) const override
                Determine the name of a float variable given its symbol.
                -
                std::string extra_conc_pointer_name() const
                -
                void print_function(const ast::FunctionBlock &node) override
                Print NMODL function in target backend code.
                +
                void print_global_function_common_code(BlockType type, const std::string &function_name="") override
                Print common code for global functions like nrn_init, nrn_cur and nrn_state.
                +
                std::string float_variable_name(const SymbolType &symbol, bool use_instance) const override
                Determine the name of a float variable given its symbol.
                +
                std::string extra_conc_pointer_name() const
                +
                void print_function(const ast::FunctionBlock &node) override
                Print NMODL function in target backend code.
                std::shared_ptr< StatementBlock > get_statement_block() const noexcept override
                Getter for member variable BreakpointBlock::statement_block.
                - -
                std::string rev_potential_pointer_name() const
                -
                void print_v_unused() const override
                Set v_unused (voltage) for NRN_PRCELLSTATE feature.
                - + +
                std::string rev_potential_pointer_name() const
                +
                void print_v_unused() const override
                Set v_unused (voltage) for NRN_PRCELLSTATE feature.
                +
                static constexpr char CONDUCTANCE_VARIABLE[]
                range variable for conductance
                -
                ParamVector functor_params() override
                The parameters of the Newton solver "functor".
                +
                ParamVector functor_params() override
                The parameters of the Newton solver "functor".
                Visitor for printing C++ code compatible with legacy api of CoreNEURON
                Check if variable is used in given block.
                Base class for all block scoped nodes.
                Definition: block.hpp:41
                Represents a INITIAL block in the NMODL.
                -
                void print_point_process_function_definitions()
                Print POINT_PROCESS related functions Wrap external NEURON functions related to POINT_PROCESS mechani...
                +
                void print_point_process_function_definitions()
                Print POINT_PROCESS related functions Wrap external NEURON functions related to POINT_PROCESS mechani...
                Utility functions for visitors implementation.
                @ Equation
                breakpoint block
                static constexpr char USE_TABLE_VARIABLE[]
                global variable to indicate if table is used
                Represent WATCH statement in NMODL.
                -
                void print_neuron_global_variable_declarations()
                Print extern declarations for neuron global variables.
                +
                void print_neuron_global_variable_declarations()
                Print extern declarations for neuron global variables.
                Represents a BREAKPOINT block in NMODL.
                -
                void print_nrn_cur_conductance_kernel(const ast::BreakpointBlock &node) override
                Print the nrn_cur kernel with NMODL conductance keyword provisions.
                -
                std::string int_variable_name(const IndexVariableInfo &symbol, const std::string &name, bool use_instance) const override
                Determine the name of an int variable given its symbol.
                +
                void print_nrn_cur_conductance_kernel(const ast::BreakpointBlock &node) override
                Print the nrn_cur kernel with NMODL conductance keyword provisions.
                +
                std::string int_variable_name(const IndexVariableInfo &symbol, const std::string &name, bool use_instance) const override
                Determine the name of an int variable given its symbol.
                InterpreterWrapper
                Enum to switch between HOC and Python wrappers for functions and procedures defined in mechanisms.
                -
                void print_namespace_begin() override
                Print start of namespaces.
                +
                void print_namespace_begin() override
                Print start of namespaces.
                -
                void print_global_variables_for_hoc() override
                Print byte arrays that register scalar and vector variables for hoc interface.
                -
                void print_standard_includes() override
                Print standard C/C++ includes.
                -
                void print_mechanism_range_var_structure(bool print_initializers) override
                Print the structure that wraps all range and int variables required for the NMODL.
                -
                void print_procedure(const ast::ProcedureBlock &node) override
                Print NMODL procedure in target backend code.
                -
                void add_variable_tqitem(std::vector< IndexVariableInfo > &variables) override
                Add the variable tqitem during get_int_variables.
                -
                std::string hoc_function_signature(const std::string &function_or_procedure_name) const
                Get the signature of the hoc <func_or_proc_name> function.
                -
                void print_namespace_start() override
                Prints the start of the neuron namespace.
                -
                void print_thread_variables_structure(bool print_initializers)
                Print the data structure used to access thread variables.
                +
                void print_global_variables_for_hoc() override
                Print byte arrays that register scalar and vector variables for hoc interface.
                +
                void print_standard_includes() override
                Print standard C/C++ includes.
                +
                void print_mechanism_range_var_structure(bool print_initializers) override
                Print the structure that wraps all range and int variables required for the NMODL.
                +
                void print_procedure(const ast::ProcedureBlock &node) override
                Print NMODL procedure in target backend code.
                +
                void add_variable_tqitem(std::vector< IndexVariableInfo > &variables) override
                Add the variable tqitem during get_int_variables.
                +
                std::string hoc_function_signature(const std::string &function_or_procedure_name) const
                Get the signature of the hoc <func_or_proc_name> function.
                +
                void print_namespace_start() override
                Prints the start of the neuron namespace.
                +
                void print_thread_variables_structure(bool print_initializers)
                Print the data structure used to access thread variables.
                std::string to_string(const T &obj)
                -
                void print_compute_functions() override
                Print all compute functions for every backend.
                +
                void print_compute_functions() override
                Print all compute functions for every backend.
                static constexpr char NRN_INIT_METHOD[]
                nrn_init method in generated code
                const ExpressionVector & get_arguments() const noexcept
                Getter for member variable FunctionCall::arguments.
                -
                void print_thread_memory_callbacks()
                Print thread variable (de-)initialization functions.
                +
                void print_thread_memory_callbacks()
                Print thread variable (de-)initialization functions.
                static void rename_net_receive_arguments(const ast::NetReceiveBlock &net_receive_node, const ast::Node &node)
                Rename arguments to NET_RECEIVE block with corresponding pointer variable.
                -
                void print_nrn_cur_kernel(const ast::BreakpointBlock &node) override
                Print main body of nrn_cur function.
                +
                void print_nrn_cur_kernel(const ast::BreakpointBlock &node) override
                Print main body of nrn_cur function.
                Blindly rename given variable to new name
                static constexpr char NRN_CUR_METHOD[]
                nrn_cur method in generated code
                -
                void print_mechanism_register() override
                Print the mechanism registration function.
                +
                void print_mechanism_register() override
                Print the mechanism registration function.
                Implement utility functions for codegen visitors.
                static constexpr char TQITEM_VARIABLE[]
                inbuilt neuron variable for tqitem process
                -
                void print_nrn_jacob()
                Print nrn_jacob function definition.
                +
                void print_nrn_jacob()
                Print nrn_jacob function definition.
                -
                void print_fast_imem_calculation() override
                Print fast membrane current calculation code.
                -
                void print_data_structures(bool print_initializers) override
                Print all classes.
                +
                void print_fast_imem_calculation() override
                Print fast membrane current calculation code.
                +
                void print_data_structures(bool print_initializers) override
                Print all classes.
                std::string get_node_name() const override
                Return name of the node.
                Definition: ast.cpp:3963
                -
                void print_sdlists_init(bool print_initializers) override
                -
                const std::string external_method_arguments() noexcept override
                Arguments for external functions called from generated code.
                -
                std::string py_function_name(const std::string &function_or_procedure_name) const
                In non POINT_PROCESS mechanisms all functions and procedures need a py <func_or_proc_name> to be avai...
                +
                void print_sdlists_init(bool print_initializers) override
                +
                const std::string external_method_arguments() noexcept override
                Arguments for external functions called from generated code.
                +
                std::string py_function_name(const std::string &function_or_procedure_name) const
                In non POINT_PROCESS mechanisms all functions and procedures need a py <func_or_proc_name> to be avai...
                size_t offset
                The global variables ahead of this one require offset doubles to store.
                -
                void print_node_data_structure(bool print_initializers)
                Print the structure that wraps all node variables required for the NMODL.
                +
                void print_node_data_structure(bool print_initializers)
                Print the structure that wraps all node variables required for the NMODL.
                static constexpr char INST_GLOBAL_MEMBER[]
                instance struct member pointing to the global variable structure
                -
                void print_make_instance() const
                Print make_*_instance.
                -
                void print_atomic_reduction_pragma() override
                Print atomic update pragma for reduction statements.
                +
                void print_make_instance() const
                Print make_*_instance.
                +
                void print_atomic_reduction_pragma() override
                Print atomic update pragma for reduction statements.
                NmodlType
                NMODL variable properties.
                -
                void print_namespace_stop() override
                Prints the end of the neuron namespace.
                -
                void print_setdata_functions()
                Print NEURON functions related to setting global variables of the mechanism.
                +
                void print_namespace_stop() override
                Prints the end of the neuron namespace.
                +
                void print_setdata_functions()
                Print NEURON functions related to setting global variables of the mechanism.
                Represents ion write statement during code generation.
                -
                void print_mechanism_variables_macros()
                Print mechanism variables' related macros.
                -
                void print_nrn_constructor() override
                Print nrn_constructor function definition.
                -
                void print_check_table_function_prototypes()
                Print all check_* function declarations.
                +
                void print_mechanism_variables_macros()
                Print mechanism variables' related macros.
                +
                void print_nrn_constructor() override
                Print nrn_constructor function definition.
                +
                void print_check_table_function_prototypes()
                Print all check_* function declarations.
                std::shared_ptr< StatementBlock > get_statement_block() const noexcept override
                Getter for member variable FunctionBlock::statement_block.
                BlockType
                Helper to represent various block types.
                -
                void print_headers_include() override
                Print all includes.
                -
                const ParamVector external_method_parameters(bool table=false) noexcept override
                Parameters for functions in generated code that are called back from external code.
                -
                void print_function_or_procedure(const ast::Block &node, const std::string &name, const std::unordered_set< CppObjectSpecifier > &specifiers={ CppObjectSpecifier::Inline}) override
                Print nmodl function or procedure (common code)
                +
                void print_headers_include() override
                Print all includes.
                +
                const ParamVector external_method_parameters(bool table=false) noexcept override
                Parameters for functions in generated code that are called back from external code.
                +
                void print_function_or_procedure(const ast::Block &node, const std::string &name, const std::unordered_set< CppObjectSpecifier > &specifiers={ CppObjectSpecifier::Inline}) override
                Print nmodl function or procedure (common code)
                static constexpr char NRN_STATE_METHOD[]
                nrn_state method in generated code
                const std::shared_ptr< symtab::Symbol > symbol
                Version information and units file path.
                -
                void print_nrn_current(const ast::BreakpointBlock &node) override
                Print the nrn_current kernel.
                -
                int position_of_float_var(const std::string &name) const override
                Determine the position in the data array for a given float variable.
                -
                std::string get_variable_name(const std::string &name, bool use_instance=true) const override
                Determine variable name in the structure of mechanism properties.
                +
                void print_nrn_current(const ast::BreakpointBlock &node) override
                Print the nrn_current kernel.
                +
                int position_of_float_var(const std::string &name) const override
                Determine the position in the data array for a given float variable.
                +
                std::string get_variable_name(const std::string &name, bool use_instance=true) const override
                Determine variable name in the structure of mechanism properties.
                static constexpr char AREA_VARIABLE[]
                similar to node_area but user can explicitly declare it as area
                -
                void print_make_node_data() const
                Print make_*_node_data.
                +
                void print_make_node_data() const
                Print make_*_node_data.
                virtual std::shared_ptr< StatementBlock > get_statement_block() const
                Return associated statement block for the AST node.
                Definition: ast.cpp:32
                -
                std::string simulator_name() override
                Name of the simulator the code was generated for.
                -
                void print_function_procedure_helper(const ast::Block &node) override
                Common helper function to help printing function or procedure blocks.
                +
                std::string simulator_name() override
                Name of the simulator the code was generated for.
                +
                void print_function_procedure_helper(const ast::Block &node) override
                Common helper function to help printing function or procedure blocks.
                static constexpr char NTHREAD_T_VARIABLE[]
                t variable in neuron thread structure
                -
                void add_variable_point_process(std::vector< IndexVariableInfo > &variables) override
                Add the variable point_process during get_int_variables.
                +
                void add_variable_point_process(std::vector< IndexVariableInfo > &variables) override
                Add the variable point_process during get_int_variables.
                Blindly rename given variable to new name
                @ State
                derivative block
                static constexpr char DIAM_VARIABLE[]
                inbuilt neuron variable for diameter of the compartment
                virtual const ArgumentVector & get_parameters() const
                Definition: block.hpp:50
                bool variable_used(const ast::Node &node, std::string name)
                -
                std::string nrn_thread_arguments() const override
                Arguments for "_threadargs_" macro in neuron implementation.
                +
                std::string nrn_thread_arguments() const override
                Arguments for "_threadargs_" macro in neuron implementation.
                static bool ends_with(const std::string &haystack, const std::string &needle)
                Check if haystack ends with needle.
                static constexpr char CONDUCTANCE_UNUSED_VARIABLE[]
                range variable when conductance is not used (for vectorized model)
                -
                void print_codegen_routines() override
                Print entry point to code generation.
                +
                void print_codegen_routines() override
                Print entry point to code generation.
                -
                void append_conc_write_statements(std::vector< ShadowUseStatement > &statements, const Ion &ion, const std::string &concentration) override
                Generate Function call statement for nrn_wrote_conc.
                +
                void append_conc_write_statements(std::vector< ShadowUseStatement > &statements, const Ion &ion, const std::string &concentration) override
                Generate Function call statement for nrn_wrote_conc.
                static constexpr char NRN_POINTERINDEX[]
                hoc_nrnpointerindex name
                -
                ParamVector internal_method_parameters() override
                Parameters for internally defined functions.
                +
                ParamVector internal_method_parameters() override
                Parameters for internally defined functions.
                virtual std::string get_node_name() const
                Return name of of the node.
                Definition: ast.cpp:28
                Auto generated AST classes declaration.
                -
                void print_net_receive()
                Print net_receive call-back.
                -
                void print_function_prototypes() override
                Print function and procedures prototype declaration.
                -
                void print_mechanism_global_var_structure(bool print_initializers) override
                Print the structure that wraps all global variables used in the NMODL.
                -
                void print_global_macros()
                Print NEURON global variable macros.
                -
                std::string intra_conc_pointer_name() const
                +
                void print_net_receive()
                Print net_receive call-back.
                +
                void print_function_prototypes() override
                Print function and procedures prototype declaration.
                +
                void print_mechanism_global_var_structure(bool print_initializers) override
                Print the structure that wraps all global variables used in the NMODL.
                +
                void print_global_macros()
                Print NEURON global variable macros.
                +
                std::string intra_conc_pointer_name() const
                std::vector< std::tuple< std::string, std::string, std::string, std::string > > ParamVector
                A vector of parameters represented by a 4-tuple of strings:
                static constexpr char ION_VARNAME_PREFIX[]
                prefix for ion variable
                diff --git a/doxygen/structnmodl_1_1codegen_1_1_codegen_info.html b/doxygen/structnmodl_1_1codegen_1_1_codegen_info.html index 6458f85a7..73357bfce 100644 --- a/doxygen/structnmodl_1_1codegen_1_1_codegen_info.html +++ b/doxygen/structnmodl_1_1codegen_1_1_codegen_info.html @@ -107,7 +107,7 @@

                Code generation passes require different information from AST. This information is gathered in this single class.

                Todo:
                Need to store all Define i.e. macro definitions?
                -

                Definition at line 292 of file codegen_info.hpp.

                +

                Definition at line 296 of file codegen_info.hpp.

                #include <codegen_info.hpp>

                @@ -405,7 +405,7 @@

                -

                Definition at line 448 of file codegen_info.hpp.

                +

                Definition at line 452 of file codegen_info.hpp.

                @@ -435,7 +435,7 @@

                Definition at line 580 of file codegen_info.hpp.

                +

                Definition at line 584 of file codegen_info.hpp.

                @@ -462,7 +462,7 @@

                -

                Definition at line 575 of file codegen_info.hpp.

                +

                Definition at line 579 of file codegen_info.hpp.

                @@ -756,7 +756,7 @@

                Definition at line 571 of file codegen_info.hpp.

                +

                Definition at line 575 of file codegen_info.hpp.

                @@ -798,7 +798,7 @@

                Definition at line 340 of file codegen_info.hpp.

                +

                Definition at line 344 of file codegen_info.hpp.

                @@ -816,7 +816,7 @@

                Definition at line 316 of file codegen_info.hpp.

                +

                Definition at line 320 of file codegen_info.hpp.

                @@ -834,7 +834,7 @@

                Definition at line 457 of file codegen_info.hpp.

                +

                Definition at line 461 of file codegen_info.hpp.

                @@ -852,7 +852,7 @@

                Definition at line 325 of file codegen_info.hpp.

                +

                Definition at line 329 of file codegen_info.hpp.

                @@ -870,7 +870,7 @@

                Definition at line 535 of file codegen_info.hpp.

                +

                Definition at line 539 of file codegen_info.hpp.

                @@ -888,7 +888,7 @@

                Definition at line 407 of file codegen_info.hpp.

                +

                Definition at line 411 of file codegen_info.hpp.

                @@ -906,7 +906,7 @@

                Definition at line 488 of file codegen_info.hpp.

                +

                Definition at line 492 of file codegen_info.hpp.

                @@ -924,7 +924,7 @@

                Definition at line 517 of file codegen_info.hpp.

                +

                Definition at line 521 of file codegen_info.hpp.

                @@ -942,7 +942,7 @@

                Definition at line 494 of file codegen_info.hpp.

                +

                Definition at line 498 of file codegen_info.hpp.

                @@ -960,7 +960,7 @@

                Definition at line 425 of file codegen_info.hpp.

                +

                Definition at line 429 of file codegen_info.hpp.

                @@ -978,7 +978,7 @@

                Definition at line 523 of file codegen_info.hpp.

                +

                Definition at line 527 of file codegen_info.hpp.

                @@ -996,7 +996,7 @@

                Definition at line 434 of file codegen_info.hpp.

                +

                Definition at line 438 of file codegen_info.hpp.

                @@ -1014,7 +1014,7 @@

                Definition at line 384 of file codegen_info.hpp.

                +

                Definition at line 388 of file codegen_info.hpp.

                @@ -1032,7 +1032,7 @@

                Definition at line 381 of file codegen_info.hpp.

                +

                Definition at line 385 of file codegen_info.hpp.

                @@ -1050,7 +1050,7 @@

                Definition at line 428 of file codegen_info.hpp.

                +

                Definition at line 432 of file codegen_info.hpp.

                @@ -1068,7 +1068,7 @@

                Definition at line 337 of file codegen_info.hpp.

                +

                Definition at line 341 of file codegen_info.hpp.

                @@ -1086,7 +1086,7 @@

                Definition at line 547 of file codegen_info.hpp.

                +

                Definition at line 551 of file codegen_info.hpp.

                @@ -1104,7 +1104,7 @@

                Definition at line 544 of file codegen_info.hpp.

                +

                Definition at line 548 of file codegen_info.hpp.

                @@ -1122,7 +1122,7 @@

                Definition at line 319 of file codegen_info.hpp.

                +

                Definition at line 323 of file codegen_info.hpp.

                @@ -1140,7 +1140,7 @@

                Definition at line 404 of file codegen_info.hpp.

                +

                Definition at line 408 of file codegen_info.hpp.

                @@ -1158,7 +1158,7 @@

                Definition at line 443 of file codegen_info.hpp.

                +

                Definition at line 447 of file codegen_info.hpp.

                @@ -1176,7 +1176,7 @@

                Definition at line 477 of file codegen_info.hpp.

                +

                Definition at line 481 of file codegen_info.hpp.

                @@ -1194,7 +1194,7 @@

                Definition at line 480 of file codegen_info.hpp.

                +

                Definition at line 484 of file codegen_info.hpp.

                @@ -1212,7 +1212,7 @@

                Definition at line 343 of file codegen_info.hpp.

                +

                Definition at line 347 of file codegen_info.hpp.

                @@ -1230,7 +1230,7 @@

                Definition at line 440 of file codegen_info.hpp.

                +

                Definition at line 444 of file codegen_info.hpp.

                @@ -1248,7 +1248,7 @@

                Definition at line 437 of file codegen_info.hpp.

                +

                Definition at line 441 of file codegen_info.hpp.

                @@ -1266,7 +1266,7 @@

                Definition at line 514 of file codegen_info.hpp.

                +

                Definition at line 518 of file codegen_info.hpp.

                @@ -1284,7 +1284,7 @@

                Definition at line 541 of file codegen_info.hpp.

                +

                Definition at line 545 of file codegen_info.hpp.

                @@ -1302,7 +1302,7 @@

                Definition at line 491 of file codegen_info.hpp.

                +

                Definition at line 495 of file codegen_info.hpp.

                @@ -1320,7 +1320,7 @@

                Definition at line 422 of file codegen_info.hpp.

                +

                Definition at line 426 of file codegen_info.hpp.

                @@ -1338,7 +1338,7 @@

                Definition at line 446 of file codegen_info.hpp.

                +

                Definition at line 450 of file codegen_info.hpp.

                @@ -1356,7 +1356,7 @@

                Definition at line 294 of file codegen_info.hpp.

                +

                Definition at line 298 of file codegen_info.hpp.

                @@ -1374,7 +1374,7 @@

                Definition at line 297 of file codegen_info.hpp.

                +

                Definition at line 301 of file codegen_info.hpp.

                @@ -1392,7 +1392,7 @@

                Definition at line 334 of file codegen_info.hpp.

                +

                Definition at line 338 of file codegen_info.hpp.

                @@ -1410,7 +1410,7 @@

                Definition at line 419 of file codegen_info.hpp.

                +

                Definition at line 423 of file codegen_info.hpp.

                @@ -1428,7 +1428,7 @@

                Definition at line 413 of file codegen_info.hpp.

                +

                Definition at line 417 of file codegen_info.hpp.

                @@ -1446,7 +1446,7 @@

                Definition at line 331 of file codegen_info.hpp.

                +

                Definition at line 335 of file codegen_info.hpp.

                @@ -1464,7 +1464,7 @@

                Definition at line 511 of file codegen_info.hpp.

                +

                Definition at line 515 of file codegen_info.hpp.

                @@ -1482,7 +1482,7 @@

                Definition at line 410 of file codegen_info.hpp.

                +

                Definition at line 414 of file codegen_info.hpp.

                @@ -1501,7 +1501,7 @@

                Definition at line 397 of file codegen_info.hpp.

                +

                Definition at line 401 of file codegen_info.hpp.

                @@ -1519,7 +1519,7 @@

                Definition at line 416 of file codegen_info.hpp.

                +

                Definition at line 420 of file codegen_info.hpp.

                @@ -1537,7 +1537,7 @@

                Definition at line 390 of file codegen_info.hpp.

                +

                Definition at line 394 of file codegen_info.hpp.

                @@ -1555,7 +1555,7 @@

                Definition at line 387 of file codegen_info.hpp.

                +

                Definition at line 391 of file codegen_info.hpp.

                @@ -1573,7 +1573,7 @@

                Definition at line 313 of file codegen_info.hpp.

                +

                Definition at line 317 of file codegen_info.hpp.

                @@ -1591,7 +1591,7 @@

                Definition at line 471 of file codegen_info.hpp.

                +

                Definition at line 475 of file codegen_info.hpp.

                @@ -1609,7 +1609,7 @@

                Definition at line 504 of file codegen_info.hpp.

                +

                Definition at line 508 of file codegen_info.hpp.

                @@ -1627,7 +1627,7 @@

                Definition at line 393 of file codegen_info.hpp.

                +

                Definition at line 397 of file codegen_info.hpp.

                @@ -1645,7 +1645,7 @@

                Definition at line 431 of file codegen_info.hpp.

                +

                Definition at line 435 of file codegen_info.hpp.

                @@ -1663,7 +1663,7 @@

                Definition at line 474 of file codegen_info.hpp.

                +

                Definition at line 478 of file codegen_info.hpp.

                @@ -1681,7 +1681,7 @@

                Definition at line 454 of file codegen_info.hpp.

                +

                Definition at line 458 of file codegen_info.hpp.

                @@ -1699,7 +1699,7 @@

                Definition at line 451 of file codegen_info.hpp.

                +

                Definition at line 455 of file codegen_info.hpp.

                @@ -1718,7 +1718,7 @@

                -

                Definition at line 465 of file codegen_info.hpp.

                +

                Definition at line 469 of file codegen_info.hpp.

                @@ -1736,7 +1736,7 @@

                Definition at line 593 of file codegen_info.hpp.

                +

                Definition at line 597 of file codegen_info.hpp.

                @@ -1754,7 +1754,7 @@

                Definition at line 300 of file codegen_info.hpp.

                +

                Definition at line 304 of file codegen_info.hpp.

                @@ -1772,7 +1772,7 @@

                Definition at line 400 of file codegen_info.hpp.

                +

                Definition at line 404 of file codegen_info.hpp.

                @@ -1790,7 +1790,7 @@

                Definition at line 520 of file codegen_info.hpp.

                +

                Definition at line 524 of file codegen_info.hpp.

                @@ -1808,7 +1808,7 @@

                Definition at line 460 of file codegen_info.hpp.

                +

                Definition at line 464 of file codegen_info.hpp.

                @@ -1824,7 +1824,7 @@

                -

                Definition at line 508 of file codegen_info.hpp.

                +

                Definition at line 512 of file codegen_info.hpp.

                @@ -1842,7 +1842,7 @@

                Definition at line 349 of file codegen_info.hpp.

                +

                Definition at line 353 of file codegen_info.hpp.

                @@ -1860,7 +1860,7 @@

                Definition at line 507 of file codegen_info.hpp.

                +

                Definition at line 511 of file codegen_info.hpp.

                @@ -1878,7 +1878,7 @@

                Definition at line 322 of file codegen_info.hpp.

                +

                Definition at line 326 of file codegen_info.hpp.

                @@ -1897,7 +1897,7 @@

                Definition at line 357 of file codegen_info.hpp.

                +

                Definition at line 361 of file codegen_info.hpp.

                @@ -1915,7 +1915,7 @@

                Definition at line 310 of file codegen_info.hpp.

                +

                Definition at line 314 of file codegen_info.hpp.

                @@ -1933,7 +1933,7 @@

                Definition at line 378 of file codegen_info.hpp.

                +

                Definition at line 382 of file codegen_info.hpp.

                @@ -1951,7 +1951,7 @@

                Definition at line 375 of file codegen_info.hpp.

                +

                Definition at line 379 of file codegen_info.hpp.

                @@ -1969,7 +1969,7 @@

                Definition at line 497 of file codegen_info.hpp.

                +

                Definition at line 501 of file codegen_info.hpp.

                @@ -1987,7 +1987,7 @@

                Definition at line 526 of file codegen_info.hpp.

                +

                Definition at line 530 of file codegen_info.hpp.

                @@ -2006,7 +2006,7 @@

                Definition at line 369 of file codegen_info.hpp.

                +

                Definition at line 373 of file codegen_info.hpp.

                @@ -2024,7 +2024,7 @@

                Definition at line 372 of file codegen_info.hpp.

                +

                Definition at line 376 of file codegen_info.hpp.

                @@ -2042,7 +2042,7 @@

                Definition at line 468 of file codegen_info.hpp.

                +

                Definition at line 472 of file codegen_info.hpp.

                @@ -2060,7 +2060,7 @@

                Definition at line 529 of file codegen_info.hpp.

                +

                Definition at line 533 of file codegen_info.hpp.

                @@ -2078,7 +2078,7 @@

                Definition at line 484 of file codegen_info.hpp.

                +

                Definition at line 488 of file codegen_info.hpp.

                @@ -2096,7 +2096,7 @@

                Definition at line 500 of file codegen_info.hpp.

                +

                Definition at line 504 of file codegen_info.hpp.

                @@ -2114,7 +2114,7 @@

                Definition at line 538 of file codegen_info.hpp.

                +

                Definition at line 542 of file codegen_info.hpp.

                @@ -2133,7 +2133,7 @@

                Definition at line 307 of file codegen_info.hpp.

                +

                Definition at line 311 of file codegen_info.hpp.

                @@ -2151,7 +2151,7 @@

                Definition at line 346 of file codegen_info.hpp.

                +

                Definition at line 350 of file codegen_info.hpp.

                @@ -2169,7 +2169,7 @@

                Definition at line 532 of file codegen_info.hpp.

                +

                Definition at line 536 of file codegen_info.hpp.

                @@ -2187,7 +2187,7 @@

                Definition at line 328 of file codegen_info.hpp.

                +

                Definition at line 332 of file codegen_info.hpp.

                diff --git a/doxygen/structnmodl_1_1codegen_1_1_conductance.html b/doxygen/structnmodl_1_1codegen_1_1_conductance.html index 30e69ad9a..f6aba5dbe 100644 --- a/doxygen/structnmodl_1_1codegen_1_1_conductance.html +++ b/doxygen/structnmodl_1_1codegen_1_1_conductance.html @@ -103,7 +103,7 @@

                Detailed Description

                Represent conductance statements used in mod file.

                -

                Definition at line 38 of file codegen_info.hpp.

                +

                Definition at line 39 of file codegen_info.hpp.

                #include <codegen_info.hpp>

                @@ -131,7 +131,7 @@

                Definition at line 40 of file codegen_info.hpp.

                +

                Definition at line 41 of file codegen_info.hpp.

                @@ -149,7 +149,7 @@

                Definition at line 43 of file codegen_info.hpp.

                +

                Definition at line 44 of file codegen_info.hpp.

                diff --git a/doxygen/structnmodl_1_1codegen_1_1_index_semantics.html b/doxygen/structnmodl_1_1codegen_1_1_index_semantics.html index 83d59a6a1..ea470cf93 100644 --- a/doxygen/structnmodl_1_1codegen_1_1_index_semantics.html +++ b/doxygen/structnmodl_1_1codegen_1_1_index_semantics.html @@ -104,7 +104,7 @@

                Detailed Description

                Represent semantic information for index variable.

                -

                Definition at line 265 of file codegen_info.hpp.

                +

                Definition at line 269 of file codegen_info.hpp.

                #include <codegen_info.hpp>

                @@ -193,7 +193,7 @@

                -

                Definition at line 276 of file codegen_info.hpp.

                +

                Definition at line 280 of file codegen_info.hpp.

                @@ -212,7 +212,7 @@

                Definition at line 267 of file codegen_info.hpp.

                +

                Definition at line 271 of file codegen_info.hpp.

                @@ -230,7 +230,7 @@

                Definition at line 270 of file codegen_info.hpp.

                +

                Definition at line 274 of file codegen_info.hpp.

                @@ -248,7 +248,7 @@

                Definition at line 273 of file codegen_info.hpp.

                +

                Definition at line 277 of file codegen_info.hpp.

                diff --git a/doxygen/structnmodl_1_1codegen_1_1_ion-members.html b/doxygen/structnmodl_1_1codegen_1_1_ion-members.html index f65f8130c..f8accf2be 100644 --- a/doxygen/structnmodl_1_1codegen_1_1_ion-members.html +++ b/doxygen/structnmodl_1_1codegen_1_1_ion-members.html @@ -132,8 +132,9 @@

                - - + + +
                readsnmodl::codegen::Ion
                rev_potential_name() constnmodl::codegen::Ioninline
                rev_potential_pointer_name() constnmodl::codegen::Ioninline
                variable_index(const std::string &var_name) constnmodl::codegen::Ioninline
                writesnmodl::codegen::Ion
                valencenmodl::codegen::Ion
                variable_index(const std::string &var_name) constnmodl::codegen::Ioninline
                writesnmodl::codegen::Ion
                diff --git a/doxygen/structnmodl_1_1codegen_1_1_ion.html b/doxygen/structnmodl_1_1codegen_1_1_ion.html index 2c99b5430..102cb4f4b 100644 --- a/doxygen/structnmodl_1_1codegen_1_1_ion.html +++ b/doxygen/structnmodl_1_1codegen_1_1_ion.html @@ -105,7 +105,7 @@

                Detailed Description

                Represent ions used in mod file.

                -

                Definition at line 51 of file codegen_info.hpp.

                +

                Definition at line 52 of file codegen_info.hpp.

                #include <codegen_info.hpp>

                @@ -202,6 +202,9 @@ + + + @@ -256,7 +259,7 @@

                -

                Definition at line 69 of file codegen_info.hpp.

                +

                Definition at line 73 of file codegen_info.hpp.

                @@ -284,7 +287,7 @@

                -

                Definition at line 209 of file codegen_info.hpp.

                +

                Definition at line 213 of file codegen_info.hpp.

                @@ -311,7 +314,7 @@

                -

                Definition at line 213 of file codegen_info.hpp.

                +

                Definition at line 217 of file codegen_info.hpp.

                @@ -338,7 +341,7 @@

                -

                Definition at line 185 of file codegen_info.hpp.

                +

                Definition at line 189 of file codegen_info.hpp.

                @@ -365,7 +368,7 @@

                -

                Definition at line 189 of file codegen_info.hpp.

                +

                Definition at line 193 of file codegen_info.hpp.

                @@ -395,7 +398,7 @@

                Definition at line 220 of file codegen_info.hpp.

                +

                Definition at line 224 of file codegen_info.hpp.

                @@ -422,7 +425,7 @@

                -

                Definition at line 177 of file codegen_info.hpp.

                +

                Definition at line 181 of file codegen_info.hpp.

                @@ -449,7 +452,7 @@

                -

                Definition at line 181 of file codegen_info.hpp.

                +

                Definition at line 185 of file codegen_info.hpp.

                @@ -476,7 +479,7 @@

                -

                Definition at line 201 of file codegen_info.hpp.

                +

                Definition at line 205 of file codegen_info.hpp.

                @@ -503,7 +506,7 @@

                -

                Definition at line 205 of file codegen_info.hpp.

                +

                Definition at line 209 of file codegen_info.hpp.

                @@ -530,7 +533,7 @@

                -

                Definition at line 78 of file codegen_info.hpp.

                +

                Definition at line 82 of file codegen_info.hpp.

                @@ -557,7 +560,7 @@

                -

                Definition at line 94 of file codegen_info.hpp.

                +

                Definition at line 98 of file codegen_info.hpp.

                @@ -585,7 +588,7 @@

                -

                Definition at line 173 of file codegen_info.hpp.

                +

                Definition at line 177 of file codegen_info.hpp.

                @@ -612,7 +615,7 @@

                -

                Definition at line 86 of file codegen_info.hpp.

                +

                Definition at line 90 of file codegen_info.hpp.

                @@ -639,7 +642,7 @@

                -

                Definition at line 102 of file codegen_info.hpp.

                +

                Definition at line 106 of file codegen_info.hpp.

                @@ -670,7 +673,7 @@

                Definition at line 139 of file codegen_info.hpp.

                +

                Definition at line 143 of file codegen_info.hpp.

                @@ -697,7 +700,7 @@

                -

                Definition at line 82 of file codegen_info.hpp.

                +

                Definition at line 86 of file codegen_info.hpp.

                @@ -724,7 +727,7 @@

                -

                Definition at line 98 of file codegen_info.hpp.

                +

                Definition at line 102 of file codegen_info.hpp.

                @@ -755,7 +758,7 @@

                Definition at line 130 of file codegen_info.hpp.

                +

                Definition at line 134 of file codegen_info.hpp.

                @@ -785,7 +788,7 @@

                Definition at line 154 of file codegen_info.hpp.

                +

                Definition at line 158 of file codegen_info.hpp.

                @@ -816,7 +819,7 @@

                Definition at line 121 of file codegen_info.hpp.

                +

                Definition at line 125 of file codegen_info.hpp.

                @@ -847,7 +850,7 @@

                , "ina", "nai" and "nao"; but not ion_ina, etc.

                -

                Definition at line 162 of file codegen_info.hpp.

                +

                Definition at line 166 of file codegen_info.hpp.

                @@ -875,7 +878,7 @@

                -

                Definition at line 72 of file codegen_info.hpp.

                +

                Definition at line 76 of file codegen_info.hpp.

                @@ -906,7 +909,7 @@

                Definition at line 148 of file codegen_info.hpp.

                +

                Definition at line 152 of file codegen_info.hpp.

                @@ -933,7 +936,7 @@

                -

                Definition at line 106 of file codegen_info.hpp.

                +

                Definition at line 110 of file codegen_info.hpp.

                @@ -960,7 +963,7 @@

                -

                Definition at line 110 of file codegen_info.hpp.

                +

                Definition at line 114 of file codegen_info.hpp.

                @@ -991,7 +994,7 @@

                .

                -

                Definition at line 169 of file codegen_info.hpp.

                +

                Definition at line 173 of file codegen_info.hpp.

                @@ -1019,7 +1022,7 @@

                -

                Definition at line 90 of file codegen_info.hpp.

                +

                Definition at line 94 of file codegen_info.hpp.

                @@ -1046,7 +1049,7 @@

                -

                Definition at line 193 of file codegen_info.hpp.

                +

                Definition at line 197 of file codegen_info.hpp.

                @@ -1073,7 +1076,7 @@

                -

                Definition at line 197 of file codegen_info.hpp.

                +

                Definition at line 201 of file codegen_info.hpp.

                @@ -1105,7 +1108,7 @@

                Definition at line 239 of file codegen_info.hpp.

                +

                Definition at line 243 of file codegen_info.hpp.

                @@ -1124,7 +1127,7 @@

                Definition at line 59 of file codegen_info.hpp.

                +

                Definition at line 60 of file codegen_info.hpp.

                @@ -1142,7 +1145,7 @@

                Definition at line 53 of file codegen_info.hpp.

                +

                Definition at line 54 of file codegen_info.hpp.

                @@ -1160,7 +1163,7 @@

                Definition at line 65 of file codegen_info.hpp.

                +

                Definition at line 69 of file codegen_info.hpp.

                @@ -1178,7 +1181,25 @@

                Definition at line 56 of file codegen_info.hpp.

                +

                Definition at line 57 of file codegen_info.hpp.

                + + + + +

                ◆ valence

                + +
                +
                +

                std::vector< std::string > writes
                 ion variables that are being written More...
                 
                std::optional< double > valence
                 ion valence More...
                 
                bool need_style = false
                 if style semantic needed More...
                 
                + + + +
                std::optional<double> nmodl::codegen::Ion::valence
                +
                + +

                ion valence

                + +

                Definition at line 66 of file codegen_info.hpp.

                @@ -1196,7 +1217,7 @@

                Definition at line 62 of file codegen_info.hpp.

                +

                Definition at line 63 of file codegen_info.hpp.

                diff --git a/doxygen/structnmodl_1_1codegen_1_1_ion.js b/doxygen/structnmodl_1_1codegen_1_1_ion.js index 2d86ddc6a..882e3c815 100644 --- a/doxygen/structnmodl_1_1codegen_1_1_ion.js +++ b/doxygen/structnmodl_1_1codegen_1_1_ion.js @@ -36,5 +36,6 @@ var structnmodl_1_1codegen_1_1_ion = [ "name", "structnmodl_1_1codegen_1_1_ion.html#a1ef3560064c6ec5b850f6e9f2b345190", null ], [ "need_style", "structnmodl_1_1codegen_1_1_ion.html#a5fef7a697395c4ccf380fed9a7fff241", null ], [ "reads", "structnmodl_1_1codegen_1_1_ion.html#ad3b1eb176f8e00671fb36cc625ad0f49", null ], + [ "valence", "structnmodl_1_1codegen_1_1_ion.html#ab464eca5bf873be2df1ea2aaea2f0533", null ], [ "writes", "structnmodl_1_1codegen_1_1_ion.html#ae116633adc4f16ce78feae5b4d2f8a12", null ] ]; \ No newline at end of file diff --git a/doxygen/symtab__visitor__helper_8hpp_source.html b/doxygen/symtab__visitor__helper_8hpp_source.html index 9035afa5f..d6519eb2b 100644 --- a/doxygen/symtab__visitor__helper_8hpp_source.html +++ b/doxygen/symtab__visitor__helper_8hpp_source.html @@ -369,7 +369,7 @@
                Base class for all AST node.
                Definition: node.hpp:40
                std::vector< std::string > get_external_functions()
                Return functions that can be used in the NMODL.
                Base class for all Abstract Syntax Tree node types.
                Definition: ast.hpp:69
                -
                static std::vector< std::string > get_possible_variables(const std::string &ion_name)
                for a given ion, return different variable names/properties like internal/external concentration,...
                +
                static std::vector< std::string > get_possible_variables(const std::string &ion_name)
                for a given ion, return different variable names/properties like internal/external concentration,...
                Represents a statement in ASSIGNED or STATE block.
                void add_model_symbol_with_property(ast::Node *node, symtab::syminfo::NmodlType property)
                virtual bool is_local_var() const noexcept
                Check if the ast node is an instance of ast::LocalVar.
                Definition: ast.cpp:172
                diff --git a/notebooks/nmodl-kinetic-schemes.ipynb b/notebooks/nmodl-kinetic-schemes.ipynb index 0b34dec98..ce45db613 100644 --- a/notebooks/nmodl-kinetic-schemes.ipynb +++ b/notebooks/nmodl-kinetic-schemes.ipynb @@ -152,10 +152,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:32.660499Z", - "iopub.status.busy": "2024-07-12T14:02:32.660305Z", - "iopub.status.idle": "2024-07-12T14:02:33.450144Z", - "shell.execute_reply": "2024-07-12T14:02:33.449274Z" + "iopub.execute_input": "2024-07-15T08:35:49.671242Z", + "iopub.status.busy": "2024-07-15T08:35:49.671055Z", + "iopub.status.idle": "2024-07-15T08:35:50.563590Z", + "shell.execute_reply": "2024-07-15T08:35:50.562728Z" } }, "outputs": [], @@ -169,10 +169,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:33.453425Z", - "iopub.status.busy": "2024-07-12T14:02:33.452968Z", - "iopub.status.idle": "2024-07-12T14:02:33.482731Z", - "shell.execute_reply": "2024-07-12T14:02:33.481973Z" + "iopub.execute_input": "2024-07-15T08:35:50.566737Z", + "iopub.status.busy": "2024-07-15T08:35:50.566516Z", + "iopub.status.idle": "2024-07-15T08:35:50.596189Z", + "shell.execute_reply": "2024-07-15T08:35:50.595419Z" } }, "outputs": [], @@ -277,10 +277,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:33.485504Z", - "iopub.status.busy": "2024-07-12T14:02:33.485252Z", - "iopub.status.idle": "2024-07-12T14:02:33.489968Z", - "shell.execute_reply": "2024-07-12T14:02:33.489322Z" + "iopub.execute_input": "2024-07-15T08:35:50.598803Z", + "iopub.status.busy": "2024-07-15T08:35:50.598592Z", + "iopub.status.idle": "2024-07-15T08:35:50.603550Z", + "shell.execute_reply": "2024-07-15T08:35:50.602900Z" } }, "outputs": [ @@ -323,10 +323,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:33.522368Z", - "iopub.status.busy": "2024-07-12T14:02:33.521813Z", - "iopub.status.idle": "2024-07-12T14:02:33.525742Z", - "shell.execute_reply": "2024-07-12T14:02:33.525040Z" + "iopub.execute_input": "2024-07-15T08:35:50.637043Z", + "iopub.status.busy": "2024-07-15T08:35:50.636825Z", + "iopub.status.idle": "2024-07-15T08:35:50.640979Z", + "shell.execute_reply": "2024-07-15T08:35:50.640292Z" } }, "outputs": [ @@ -367,10 +367,10 @@ "execution_count": 5, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:33.528410Z", - "iopub.status.busy": "2024-07-12T14:02:33.528036Z", - "iopub.status.idle": "2024-07-12T14:02:33.531651Z", - "shell.execute_reply": "2024-07-12T14:02:33.530985Z" + "iopub.execute_input": "2024-07-15T08:35:50.643445Z", + "iopub.status.busy": "2024-07-15T08:35:50.643055Z", + "iopub.status.idle": "2024-07-15T08:35:50.646991Z", + "shell.execute_reply": "2024-07-15T08:35:50.646312Z" }, "scrolled": true }, @@ -412,10 +412,10 @@ "execution_count": 6, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:33.534273Z", - "iopub.status.busy": "2024-07-12T14:02:33.533780Z", - "iopub.status.idle": "2024-07-12T14:02:33.537579Z", - "shell.execute_reply": "2024-07-12T14:02:33.536939Z" + "iopub.execute_input": "2024-07-15T08:35:50.649506Z", + "iopub.status.busy": "2024-07-15T08:35:50.649197Z", + "iopub.status.idle": "2024-07-15T08:35:50.653089Z", + "shell.execute_reply": "2024-07-15T08:35:50.652440Z" }, "scrolled": true }, @@ -459,10 +459,10 @@ "execution_count": 7, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:33.540068Z", - "iopub.status.busy": "2024-07-12T14:02:33.539667Z", - "iopub.status.idle": "2024-07-12T14:02:33.544484Z", - "shell.execute_reply": "2024-07-12T14:02:33.543803Z" + "iopub.execute_input": "2024-07-15T08:35:50.655743Z", + "iopub.status.busy": "2024-07-15T08:35:50.655346Z", + "iopub.status.idle": "2024-07-15T08:35:50.659721Z", + "shell.execute_reply": "2024-07-15T08:35:50.659042Z" } }, "outputs": [ diff --git a/notebooks/nmodl-python-tutorial.ipynb b/notebooks/nmodl-python-tutorial.ipynb index 22789c48b..0e24c9e2d 100644 --- a/notebooks/nmodl-python-tutorial.ipynb +++ b/notebooks/nmodl-python-tutorial.ipynb @@ -30,10 +30,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:42.130631Z", - "iopub.status.busy": "2024-07-12T14:02:42.130153Z", - "iopub.status.idle": "2024-07-12T14:02:42.918685Z", - "shell.execute_reply": "2024-07-12T14:02:42.917772Z" + "iopub.execute_input": "2024-07-15T08:35:56.049675Z", + "iopub.status.busy": "2024-07-15T08:35:56.049471Z", + "iopub.status.idle": "2024-07-15T08:35:56.839412Z", + "shell.execute_reply": "2024-07-15T08:35:56.838608Z" } }, "outputs": [], @@ -63,10 +63,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:42.922257Z", - "iopub.status.busy": "2024-07-12T14:02:42.921793Z", - "iopub.status.idle": "2024-07-12T14:02:42.950002Z", - "shell.execute_reply": "2024-07-12T14:02:42.949356Z" + "iopub.execute_input": "2024-07-15T08:35:56.842727Z", + "iopub.status.busy": "2024-07-15T08:35:56.842296Z", + "iopub.status.idle": "2024-07-15T08:35:56.870363Z", + "shell.execute_reply": "2024-07-15T08:35:56.869747Z" } }, "outputs": [], @@ -86,10 +86,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:42.952826Z", - "iopub.status.busy": "2024-07-12T14:02:42.952456Z", - "iopub.status.idle": "2024-07-12T14:02:42.956160Z", - "shell.execute_reply": "2024-07-12T14:02:42.955604Z" + "iopub.execute_input": "2024-07-15T08:35:56.873129Z", + "iopub.status.busy": "2024-07-15T08:35:56.872741Z", + "iopub.status.idle": "2024-07-15T08:35:56.876217Z", + "shell.execute_reply": "2024-07-15T08:35:56.875638Z" } }, "outputs": [], @@ -152,10 +152,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:42.958509Z", - "iopub.status.busy": "2024-07-12T14:02:42.958315Z", - "iopub.status.idle": "2024-07-12T14:02:42.962186Z", - "shell.execute_reply": "2024-07-12T14:02:42.961505Z" + "iopub.execute_input": "2024-07-15T08:35:56.878560Z", + "iopub.status.busy": "2024-07-15T08:35:56.878213Z", + "iopub.status.idle": "2024-07-15T08:35:56.882045Z", + "shell.execute_reply": "2024-07-15T08:35:56.881367Z" } }, "outputs": [], @@ -183,10 +183,10 @@ "execution_count": 5, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:42.964623Z", - "iopub.status.busy": "2024-07-12T14:02:42.964260Z", - "iopub.status.idle": "2024-07-12T14:02:42.967932Z", - "shell.execute_reply": "2024-07-12T14:02:42.967310Z" + "iopub.execute_input": "2024-07-15T08:35:56.884596Z", + "iopub.status.busy": "2024-07-15T08:35:56.884210Z", + "iopub.status.idle": "2024-07-15T08:35:56.888135Z", + "shell.execute_reply": "2024-07-15T08:35:56.887409Z" } }, "outputs": [ @@ -235,10 +235,10 @@ "execution_count": 6, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:42.970451Z", - "iopub.status.busy": "2024-07-12T14:02:42.970062Z", - "iopub.status.idle": "2024-07-12T14:02:42.973866Z", - "shell.execute_reply": "2024-07-12T14:02:42.973329Z" + "iopub.execute_input": "2024-07-15T08:35:56.890538Z", + "iopub.status.busy": "2024-07-15T08:35:56.890171Z", + "iopub.status.idle": "2024-07-15T08:35:56.894244Z", + "shell.execute_reply": "2024-07-15T08:35:56.893619Z" } }, "outputs": [], @@ -260,10 +260,10 @@ "execution_count": 7, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:42.976286Z", - "iopub.status.busy": "2024-07-12T14:02:42.975904Z", - "iopub.status.idle": "2024-07-12T14:02:42.979774Z", - "shell.execute_reply": "2024-07-12T14:02:42.979115Z" + "iopub.execute_input": "2024-07-15T08:35:56.896907Z", + "iopub.status.busy": "2024-07-15T08:35:56.896533Z", + "iopub.status.idle": "2024-07-15T08:35:56.900122Z", + "shell.execute_reply": "2024-07-15T08:35:56.899410Z" } }, "outputs": [ @@ -297,10 +297,10 @@ "execution_count": 8, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:42.982233Z", - "iopub.status.busy": "2024-07-12T14:02:42.981816Z", - "iopub.status.idle": "2024-07-12T14:02:42.989452Z", - "shell.execute_reply": "2024-07-12T14:02:42.988787Z" + "iopub.execute_input": "2024-07-15T08:35:56.902741Z", + "iopub.status.busy": "2024-07-15T08:35:56.902360Z", + "iopub.status.idle": "2024-07-15T08:35:56.909594Z", + "shell.execute_reply": "2024-07-15T08:35:56.908896Z" } }, "outputs": [ @@ -365,10 +365,10 @@ "execution_count": 9, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:42.991822Z", - "iopub.status.busy": "2024-07-12T14:02:42.991517Z", - "iopub.status.idle": "2024-07-12T14:02:42.996016Z", - "shell.execute_reply": "2024-07-12T14:02:42.995449Z" + "iopub.execute_input": "2024-07-15T08:35:56.912246Z", + "iopub.status.busy": "2024-07-15T08:35:56.911868Z", + "iopub.status.idle": "2024-07-15T08:35:56.916088Z", + "shell.execute_reply": "2024-07-15T08:35:56.915430Z" } }, "outputs": [ @@ -416,10 +416,10 @@ "execution_count": 10, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:42.998603Z", - "iopub.status.busy": "2024-07-12T14:02:42.998219Z", - "iopub.status.idle": "2024-07-12T14:02:43.001293Z", - "shell.execute_reply": "2024-07-12T14:02:43.000706Z" + "iopub.execute_input": "2024-07-15T08:35:56.918584Z", + "iopub.status.busy": "2024-07-15T08:35:56.918215Z", + "iopub.status.idle": "2024-07-15T08:35:56.921295Z", + "shell.execute_reply": "2024-07-15T08:35:56.920768Z" } }, "outputs": [], @@ -441,10 +441,10 @@ "execution_count": 11, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:43.003669Z", - "iopub.status.busy": "2024-07-12T14:02:43.003277Z", - "iopub.status.idle": "2024-07-12T14:02:43.006952Z", - "shell.execute_reply": "2024-07-12T14:02:43.006286Z" + "iopub.execute_input": "2024-07-15T08:35:56.923803Z", + "iopub.status.busy": "2024-07-15T08:35:56.923410Z", + "iopub.status.idle": "2024-07-15T08:35:56.927115Z", + "shell.execute_reply": "2024-07-15T08:35:56.926438Z" } }, "outputs": [ @@ -510,10 +510,10 @@ "execution_count": 12, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:43.009466Z", - "iopub.status.busy": "2024-07-12T14:02:43.009088Z", - "iopub.status.idle": "2024-07-12T14:02:43.012374Z", - "shell.execute_reply": "2024-07-12T14:02:43.011723Z" + "iopub.execute_input": "2024-07-15T08:35:56.929618Z", + "iopub.status.busy": "2024-07-15T08:35:56.929244Z", + "iopub.status.idle": "2024-07-15T08:35:56.932493Z", + "shell.execute_reply": "2024-07-15T08:35:56.931823Z" } }, "outputs": [ @@ -548,10 +548,10 @@ "execution_count": 13, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:43.014965Z", - "iopub.status.busy": "2024-07-12T14:02:43.014593Z", - "iopub.status.idle": "2024-07-12T14:02:43.018055Z", - "shell.execute_reply": "2024-07-12T14:02:43.017361Z" + "iopub.execute_input": "2024-07-15T08:35:56.934981Z", + "iopub.status.busy": "2024-07-15T08:35:56.934651Z", + "iopub.status.idle": "2024-07-15T08:35:56.938155Z", + "shell.execute_reply": "2024-07-15T08:35:56.937482Z" } }, "outputs": [ @@ -584,10 +584,10 @@ "execution_count": 14, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:43.020506Z", - "iopub.status.busy": "2024-07-12T14:02:43.020117Z", - "iopub.status.idle": "2024-07-12T14:02:43.023632Z", - "shell.execute_reply": "2024-07-12T14:02:43.022978Z" + "iopub.execute_input": "2024-07-15T08:35:56.940692Z", + "iopub.status.busy": "2024-07-15T08:35:56.940316Z", + "iopub.status.idle": "2024-07-15T08:35:56.943859Z", + "shell.execute_reply": "2024-07-15T08:35:56.943165Z" } }, "outputs": [ @@ -622,10 +622,10 @@ "execution_count": 15, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:43.026145Z", - "iopub.status.busy": "2024-07-12T14:02:43.025758Z", - "iopub.status.idle": "2024-07-12T14:02:43.029794Z", - "shell.execute_reply": "2024-07-12T14:02:43.029124Z" + "iopub.execute_input": "2024-07-15T08:35:56.946382Z", + "iopub.status.busy": "2024-07-15T08:35:56.946005Z", + "iopub.status.idle": "2024-07-15T08:35:56.949953Z", + "shell.execute_reply": "2024-07-15T08:35:56.949286Z" } }, "outputs": [ @@ -669,10 +669,10 @@ "execution_count": 16, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:43.032338Z", - "iopub.status.busy": "2024-07-12T14:02:43.031956Z", - "iopub.status.idle": "2024-07-12T14:02:43.037191Z", - "shell.execute_reply": "2024-07-12T14:02:43.036526Z" + "iopub.execute_input": "2024-07-15T08:35:56.952266Z", + "iopub.status.busy": "2024-07-15T08:35:56.952068Z", + "iopub.status.idle": "2024-07-15T08:35:56.957340Z", + "shell.execute_reply": "2024-07-15T08:35:56.956666Z" } }, "outputs": [ @@ -733,10 +733,10 @@ "execution_count": 17, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:43.039701Z", - "iopub.status.busy": "2024-07-12T14:02:43.039320Z", - "iopub.status.idle": "2024-07-12T14:02:43.042885Z", - "shell.execute_reply": "2024-07-12T14:02:43.042236Z" + "iopub.execute_input": "2024-07-15T08:35:56.959865Z", + "iopub.status.busy": "2024-07-15T08:35:56.959494Z", + "iopub.status.idle": "2024-07-15T08:35:56.963077Z", + "shell.execute_reply": "2024-07-15T08:35:56.962432Z" } }, "outputs": [], @@ -761,10 +761,10 @@ "execution_count": 18, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:43.045341Z", - "iopub.status.busy": "2024-07-12T14:02:43.044872Z", - "iopub.status.idle": "2024-07-12T14:02:43.055075Z", - "shell.execute_reply": "2024-07-12T14:02:43.054422Z" + "iopub.execute_input": "2024-07-15T08:35:56.965483Z", + "iopub.status.busy": "2024-07-15T08:35:56.965098Z", + "iopub.status.idle": "2024-07-15T08:35:56.975172Z", + "shell.execute_reply": "2024-07-15T08:35:56.974587Z" } }, "outputs": [], @@ -857,10 +857,10 @@ "execution_count": 19, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:43.057617Z", - "iopub.status.busy": "2024-07-12T14:02:43.057254Z", - "iopub.status.idle": "2024-07-12T14:02:43.060894Z", - "shell.execute_reply": "2024-07-12T14:02:43.060228Z" + "iopub.execute_input": "2024-07-15T08:35:56.977566Z", + "iopub.status.busy": "2024-07-15T08:35:56.977237Z", + "iopub.status.idle": "2024-07-15T08:35:56.980917Z", + "shell.execute_reply": "2024-07-15T08:35:56.980257Z" } }, "outputs": [ @@ -897,10 +897,10 @@ "execution_count": 20, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:43.063428Z", - "iopub.status.busy": "2024-07-12T14:02:43.063043Z", - "iopub.status.idle": "2024-07-12T14:02:43.068835Z", - "shell.execute_reply": "2024-07-12T14:02:43.068193Z" + "iopub.execute_input": "2024-07-15T08:35:56.983395Z", + "iopub.status.busy": "2024-07-15T08:35:56.983038Z", + "iopub.status.idle": "2024-07-15T08:35:56.988564Z", + "shell.execute_reply": "2024-07-15T08:35:56.987903Z" } }, "outputs": [ diff --git a/notebooks/nmodl-sympy-conductance.ipynb b/notebooks/nmodl-sympy-conductance.ipynb index 7a036f787..acab6b387 100644 --- a/notebooks/nmodl-sympy-conductance.ipynb +++ b/notebooks/nmodl-sympy-conductance.ipynb @@ -86,10 +86,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:45.578799Z", - "iopub.status.busy": "2024-07-12T14:02:45.578600Z", - "iopub.status.idle": "2024-07-12T14:02:46.371542Z", - "shell.execute_reply": "2024-07-12T14:02:46.370575Z" + "iopub.execute_input": "2024-07-15T08:35:59.456021Z", + "iopub.status.busy": "2024-07-15T08:35:59.455813Z", + "iopub.status.idle": "2024-07-15T08:36:00.241945Z", + "shell.execute_reply": "2024-07-15T08:36:00.241043Z" } }, "outputs": [], @@ -103,10 +103,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:46.374971Z", - "iopub.status.busy": "2024-07-12T14:02:46.374535Z", - "iopub.status.idle": "2024-07-12T14:02:46.408459Z", - "shell.execute_reply": "2024-07-12T14:02:46.407590Z" + "iopub.execute_input": "2024-07-15T08:36:00.245157Z", + "iopub.status.busy": "2024-07-15T08:36:00.244936Z", + "iopub.status.idle": "2024-07-15T08:36:00.275293Z", + "shell.execute_reply": "2024-07-15T08:36:00.274672Z" } }, "outputs": [], @@ -149,10 +149,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:46.411530Z", - "iopub.status.busy": "2024-07-12T14:02:46.411259Z", - "iopub.status.idle": "2024-07-12T14:02:46.683993Z", - "shell.execute_reply": "2024-07-12T14:02:46.683248Z" + "iopub.execute_input": "2024-07-15T08:36:00.278067Z", + "iopub.status.busy": "2024-07-15T08:36:00.277583Z", + "iopub.status.idle": "2024-07-15T08:36:00.546016Z", + "shell.execute_reply": "2024-07-15T08:36:00.545327Z" } }, "outputs": [ @@ -196,10 +196,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:46.686530Z", - "iopub.status.busy": "2024-07-12T14:02:46.686297Z", - "iopub.status.idle": "2024-07-12T14:02:46.819028Z", - "shell.execute_reply": "2024-07-12T14:02:46.818183Z" + "iopub.execute_input": "2024-07-15T08:36:00.548875Z", + "iopub.status.busy": "2024-07-15T08:36:00.548472Z", + "iopub.status.idle": "2024-07-15T08:36:00.680237Z", + "shell.execute_reply": "2024-07-15T08:36:00.679583Z" } }, "outputs": [ @@ -243,10 +243,10 @@ "execution_count": 5, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:46.821986Z", - "iopub.status.busy": "2024-07-12T14:02:46.821462Z", - "iopub.status.idle": "2024-07-12T14:02:46.830251Z", - "shell.execute_reply": "2024-07-12T14:02:46.829560Z" + "iopub.execute_input": "2024-07-15T08:36:00.682918Z", + "iopub.status.busy": "2024-07-15T08:36:00.682535Z", + "iopub.status.idle": "2024-07-15T08:36:00.690181Z", + "shell.execute_reply": "2024-07-15T08:36:00.689513Z" } }, "outputs": [ @@ -290,10 +290,10 @@ "execution_count": 6, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:46.832686Z", - "iopub.status.busy": "2024-07-12T14:02:46.832316Z", - "iopub.status.idle": "2024-07-12T14:02:46.850361Z", - "shell.execute_reply": "2024-07-12T14:02:46.849762Z" + "iopub.execute_input": "2024-07-15T08:36:00.692900Z", + "iopub.status.busy": "2024-07-15T08:36:00.692520Z", + "iopub.status.idle": "2024-07-15T08:36:00.710209Z", + "shell.execute_reply": "2024-07-15T08:36:00.709621Z" } }, "outputs": [ @@ -337,10 +337,10 @@ "execution_count": 7, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:46.853025Z", - "iopub.status.busy": "2024-07-12T14:02:46.852545Z", - "iopub.status.idle": "2024-07-12T14:02:46.970028Z", - "shell.execute_reply": "2024-07-12T14:02:46.969308Z" + "iopub.execute_input": "2024-07-15T08:36:00.712794Z", + "iopub.status.busy": "2024-07-15T08:36:00.712416Z", + "iopub.status.idle": "2024-07-15T08:36:00.831935Z", + "shell.execute_reply": "2024-07-15T08:36:00.831310Z" } }, "outputs": [ @@ -400,10 +400,10 @@ "execution_count": 8, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:46.972610Z", - "iopub.status.busy": "2024-07-12T14:02:46.972408Z", - "iopub.status.idle": "2024-07-12T14:02:47.066874Z", - "shell.execute_reply": "2024-07-12T14:02:47.066202Z" + "iopub.execute_input": "2024-07-15T08:36:00.834409Z", + "iopub.status.busy": "2024-07-15T08:36:00.834024Z", + "iopub.status.idle": "2024-07-15T08:36:00.928545Z", + "shell.execute_reply": "2024-07-15T08:36:00.927966Z" } }, "outputs": [ @@ -456,10 +456,10 @@ "execution_count": 9, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:47.069430Z", - "iopub.status.busy": "2024-07-12T14:02:47.069062Z", - "iopub.status.idle": "2024-07-12T14:02:47.143051Z", - "shell.execute_reply": "2024-07-12T14:02:47.142389Z" + "iopub.execute_input": "2024-07-15T08:36:00.931040Z", + "iopub.status.busy": "2024-07-15T08:36:00.930656Z", + "iopub.status.idle": "2024-07-15T08:36:01.004508Z", + "shell.execute_reply": "2024-07-15T08:36:01.003885Z" } }, "outputs": [ diff --git a/notebooks/nmodl-sympy-solver-cnexp.ipynb b/notebooks/nmodl-sympy-solver-cnexp.ipynb index 1a96fdf9b..a1680e4a3 100644 --- a/notebooks/nmodl-sympy-solver-cnexp.ipynb +++ b/notebooks/nmodl-sympy-solver-cnexp.ipynb @@ -62,10 +62,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:49.058507Z", - "iopub.status.busy": "2024-07-12T14:02:49.058304Z", - "iopub.status.idle": "2024-07-12T14:02:49.854439Z", - "shell.execute_reply": "2024-07-12T14:02:49.853537Z" + "iopub.execute_input": "2024-07-15T08:36:02.923125Z", + "iopub.status.busy": "2024-07-15T08:36:02.922935Z", + "iopub.status.idle": "2024-07-15T08:36:03.706385Z", + "shell.execute_reply": "2024-07-15T08:36:03.705640Z" } }, "outputs": [], @@ -79,10 +79,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:49.857718Z", - "iopub.status.busy": "2024-07-12T14:02:49.857287Z", - "iopub.status.idle": "2024-07-12T14:02:49.887417Z", - "shell.execute_reply": "2024-07-12T14:02:49.886789Z" + "iopub.execute_input": "2024-07-15T08:36:03.709562Z", + "iopub.status.busy": "2024-07-15T08:36:03.709174Z", + "iopub.status.idle": "2024-07-15T08:36:03.739233Z", + "shell.execute_reply": "2024-07-15T08:36:03.738508Z" } }, "outputs": [], @@ -123,10 +123,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:49.890225Z", - "iopub.status.busy": "2024-07-12T14:02:49.889826Z", - "iopub.status.idle": "2024-07-12T14:02:50.307079Z", - "shell.execute_reply": "2024-07-12T14:02:50.306269Z" + "iopub.execute_input": "2024-07-15T08:36:03.741995Z", + "iopub.status.busy": "2024-07-15T08:36:03.741785Z", + "iopub.status.idle": "2024-07-15T08:36:04.157333Z", + "shell.execute_reply": "2024-07-15T08:36:04.156592Z" } }, "outputs": [ @@ -165,10 +165,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:50.309964Z", - "iopub.status.busy": "2024-07-12T14:02:50.309483Z", - "iopub.status.idle": "2024-07-12T14:02:50.420565Z", - "shell.execute_reply": "2024-07-12T14:02:50.419955Z" + "iopub.execute_input": "2024-07-15T08:36:04.160377Z", + "iopub.status.busy": "2024-07-15T08:36:04.159903Z", + "iopub.status.idle": "2024-07-15T08:36:04.272371Z", + "shell.execute_reply": "2024-07-15T08:36:04.271668Z" } }, "outputs": [ @@ -207,10 +207,10 @@ "execution_count": 5, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:50.423245Z", - "iopub.status.busy": "2024-07-12T14:02:50.422839Z", - "iopub.status.idle": "2024-07-12T14:02:50.619519Z", - "shell.execute_reply": "2024-07-12T14:02:50.618878Z" + "iopub.execute_input": "2024-07-15T08:36:04.274861Z", + "iopub.status.busy": "2024-07-15T08:36:04.274660Z", + "iopub.status.idle": "2024-07-15T08:36:04.481294Z", + "shell.execute_reply": "2024-07-15T08:36:04.480699Z" } }, "outputs": [ @@ -255,10 +255,10 @@ "execution_count": 6, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:50.622294Z", - "iopub.status.busy": "2024-07-12T14:02:50.621819Z", - "iopub.status.idle": "2024-07-12T14:02:50.779053Z", - "shell.execute_reply": "2024-07-12T14:02:50.778415Z" + "iopub.execute_input": "2024-07-15T08:36:04.483757Z", + "iopub.status.busy": "2024-07-15T08:36:04.483539Z", + "iopub.status.idle": "2024-07-15T08:36:04.644712Z", + "shell.execute_reply": "2024-07-15T08:36:04.644006Z" } }, "outputs": [ @@ -303,10 +303,10 @@ "execution_count": 7, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:50.781600Z", - "iopub.status.busy": "2024-07-12T14:02:50.781184Z", - "iopub.status.idle": "2024-07-12T14:02:52.536734Z", - "shell.execute_reply": "2024-07-12T14:02:52.536006Z" + "iopub.execute_input": "2024-07-15T08:36:04.647242Z", + "iopub.status.busy": "2024-07-15T08:36:04.647030Z", + "iopub.status.idle": "2024-07-15T08:36:06.394817Z", + "shell.execute_reply": "2024-07-15T08:36:06.394179Z" } }, "outputs": [ @@ -351,10 +351,10 @@ "execution_count": 8, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:52.539339Z", - "iopub.status.busy": "2024-07-12T14:02:52.539135Z", - "iopub.status.idle": "2024-07-12T14:02:54.724911Z", - "shell.execute_reply": "2024-07-12T14:02:54.724178Z" + "iopub.execute_input": "2024-07-15T08:36:06.397287Z", + "iopub.status.busy": "2024-07-15T08:36:06.397082Z", + "iopub.status.idle": "2024-07-15T08:36:08.663862Z", + "shell.execute_reply": "2024-07-15T08:36:08.663252Z" } }, "outputs": [ diff --git a/notebooks/nmodl-sympy-solver-derivimplicit.ipynb b/notebooks/nmodl-sympy-solver-derivimplicit.ipynb index 644fe6d59..4213374b6 100644 --- a/notebooks/nmodl-sympy-solver-derivimplicit.ipynb +++ b/notebooks/nmodl-sympy-solver-derivimplicit.ipynb @@ -39,10 +39,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:56.495316Z", - "iopub.status.busy": "2024-07-12T14:02:56.495121Z", - "iopub.status.idle": "2024-07-12T14:02:57.311811Z", - "shell.execute_reply": "2024-07-12T14:02:57.311053Z" + "iopub.execute_input": "2024-07-15T08:36:10.289503Z", + "iopub.status.busy": "2024-07-15T08:36:10.288910Z", + "iopub.status.idle": "2024-07-15T08:36:11.072528Z", + "shell.execute_reply": "2024-07-15T08:36:11.071753Z" } }, "outputs": [], @@ -56,10 +56,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:57.315108Z", - "iopub.status.busy": "2024-07-12T14:02:57.314673Z", - "iopub.status.idle": "2024-07-12T14:02:57.344651Z", - "shell.execute_reply": "2024-07-12T14:02:57.343898Z" + "iopub.execute_input": "2024-07-15T08:36:11.075716Z", + "iopub.status.busy": "2024-07-15T08:36:11.075423Z", + "iopub.status.idle": "2024-07-15T08:36:11.105140Z", + "shell.execute_reply": "2024-07-15T08:36:11.104517Z" } }, "outputs": [], @@ -100,10 +100,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:57.347677Z", - "iopub.status.busy": "2024-07-12T14:02:57.347293Z", - "iopub.status.idle": "2024-07-12T14:02:57.805988Z", - "shell.execute_reply": "2024-07-12T14:02:57.805272Z" + "iopub.execute_input": "2024-07-15T08:36:11.107995Z", + "iopub.status.busy": "2024-07-15T08:36:11.107600Z", + "iopub.status.idle": "2024-07-15T08:36:11.568097Z", + "shell.execute_reply": "2024-07-15T08:36:11.567391Z" } }, "outputs": [ @@ -165,10 +165,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:57.808767Z", - "iopub.status.busy": "2024-07-12T14:02:57.808352Z", - "iopub.status.idle": "2024-07-12T14:02:58.024800Z", - "shell.execute_reply": "2024-07-12T14:02:58.024154Z" + "iopub.execute_input": "2024-07-15T08:36:11.571010Z", + "iopub.status.busy": "2024-07-15T08:36:11.570577Z", + "iopub.status.idle": "2024-07-15T08:36:11.786533Z", + "shell.execute_reply": "2024-07-15T08:36:11.785890Z" } }, "outputs": [ diff --git a/notebooks/nmodl-sympy-solver-sparse.ipynb b/notebooks/nmodl-sympy-solver-sparse.ipynb index 2dc04380e..a0013479b 100644 --- a/notebooks/nmodl-sympy-solver-sparse.ipynb +++ b/notebooks/nmodl-sympy-solver-sparse.ipynb @@ -39,10 +39,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:02:59.532310Z", - "iopub.status.busy": "2024-07-12T14:02:59.532114Z", - "iopub.status.idle": "2024-07-12T14:03:00.340512Z", - "shell.execute_reply": "2024-07-12T14:03:00.339611Z" + "iopub.execute_input": "2024-07-15T08:36:13.273561Z", + "iopub.status.busy": "2024-07-15T08:36:13.273004Z", + "iopub.status.idle": "2024-07-15T08:36:14.055222Z", + "shell.execute_reply": "2024-07-15T08:36:14.054418Z" } }, "outputs": [], @@ -56,10 +56,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:03:00.343576Z", - "iopub.status.busy": "2024-07-12T14:03:00.343361Z", - "iopub.status.idle": "2024-07-12T14:03:00.373520Z", - "shell.execute_reply": "2024-07-12T14:03:00.372722Z" + "iopub.execute_input": "2024-07-15T08:36:14.058506Z", + "iopub.status.busy": "2024-07-15T08:36:14.058073Z", + "iopub.status.idle": "2024-07-15T08:36:14.088084Z", + "shell.execute_reply": "2024-07-15T08:36:14.087449Z" } }, "outputs": [], @@ -100,10 +100,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:03:00.376862Z", - "iopub.status.busy": "2024-07-12T14:03:00.376451Z", - "iopub.status.idle": "2024-07-12T14:03:00.839981Z", - "shell.execute_reply": "2024-07-12T14:03:00.839202Z" + "iopub.execute_input": "2024-07-15T08:36:14.090804Z", + "iopub.status.busy": "2024-07-15T08:36:14.090422Z", + "iopub.status.idle": "2024-07-15T08:36:14.552245Z", + "shell.execute_reply": "2024-07-15T08:36:14.551490Z" } }, "outputs": [ @@ -165,10 +165,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-07-12T14:03:00.842550Z", - "iopub.status.busy": "2024-07-12T14:03:00.842305Z", - "iopub.status.idle": "2024-07-12T14:03:01.058641Z", - "shell.execute_reply": "2024-07-12T14:03:01.057940Z" + "iopub.execute_input": "2024-07-15T08:36:14.555109Z", + "iopub.status.busy": "2024-07-15T08:36:14.554848Z", + "iopub.status.idle": "2024-07-15T08:36:14.770763Z", + "shell.execute_reply": "2024-07-15T08:36:14.770107Z" } }, "outputs": [