From a8d3b389c5907cc1cdfba62b1da985b01c70c4e6 Mon Sep 17 00:00:00 2001 From: Goran Jelic-Cizmek Date: Thu, 29 Aug 2024 11:47:57 +0200 Subject: [PATCH] Remove `cvodematsol` --- src/nmodl/deriv.cpp | 71 ++++++++++++++++++++++----------------------- 1 file changed, 34 insertions(+), 37 deletions(-) diff --git a/src/nmodl/deriv.cpp b/src/nmodl/deriv.cpp index 6b9a6fac6d..8ea9829ed3 100644 --- a/src/nmodl/deriv.cpp +++ b/src/nmodl/deriv.cpp @@ -573,42 +573,23 @@ is not allowed on the left hand side."); } lappendstr(procfunc, "return _reset;\n}\n"); - /* don't emit _ode_matsol if the user has defined cvodematsol */ - if (!lookup("cvodematsol")) { - Item* qq; - Item* qextra = q1->next->next->next->next; - Sprintf(buf, "static int _ode_matsol%d", numlist); - Lappendstr(procfunc, buf); - vectorize_substitute(lappendstr(procfunc, "() {\n"), "(_internalthreadargsproto_) {\n"); - qq = procfunc->next; - cvode_cnexp_possible = 1; - ITERATE(q, cvode_diffeq_list) { - Symbol* s; - Item *q1, *q2; - s = SYM(q); - q = q->next; - q1 = ITM(q); - q = q->next; - q2 = ITM(q); -#if 1 - while (qextra != q1) { /* must first have any intervening statements */ - switch (qextra->itemtype) { - case STRING: - Lappendstr(procfunc, STR(qextra)); - break; - case SYMBOL: - Lappendsym(procfunc, SYM(qextra)); - break; - } - qextra = qextra->next; - } -#endif - cvode_diffeq(s, q1, q2); - qextra = q2->next; - } + Item* qq; + Item* qextra = q1->next->next->next->next; + Sprintf(buf, "static int _ode_matsol%d", numlist); + Lappendstr(procfunc, buf); + vectorize_substitute(lappendstr(procfunc, "() {\n"), "(_internalthreadargsproto_) {\n"); + qq = procfunc->next; + cvode_cnexp_possible = 1; + ITERATE(q, cvode_diffeq_list) { + Symbol* s; + Item *q1, *q2; + s = SYM(q); + q = q->next; + q1 = ITM(q); + q = q->next; + q2 = ITM(q); #if 1 - /* if we are not at the end, there is more extra */ - while (qextra != q4) { + while (qextra != q1) { /* must first have any intervening statements */ switch (qextra->itemtype) { case STRING: Lappendstr(procfunc, STR(qextra)); @@ -620,9 +601,25 @@ is not allowed on the left hand side."); qextra = qextra->next; } #endif - Lappendstr(procfunc, " return 0;\n}\n"); - vectorize_scan_for_func(qq, procfunc); + cvode_diffeq(s, q1, q2); + qextra = q2->next; + } +#if 1 + /* if we are not at the end, there is more extra */ + while (qextra != q4) { + switch (qextra->itemtype) { + case STRING: + Lappendstr(procfunc, STR(qextra)); + break; + case SYMBOL: + Lappendsym(procfunc, SYM(qextra)); + break; + } + qextra = qextra->next; } +#endif + Lappendstr(procfunc, " return 0;\n}\n"); + vectorize_scan_for_func(qq, procfunc); Lappendstr(procfunc, "/*END CVODE*/\n"); if (cvode_cnexp_solve && cvode_cnexp_success(q1, q4)) {