Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix FUNCTION, PROCEDURE with Newton. #1343

Merged
merged 1 commit into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions src/codegen/codegen_neuron_cpp_visitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -831,15 +831,8 @@
}

CodegenCppVisitor::ParamVector CodegenNeuronCppVisitor::functor_params() {
auto params = ParamVector{};
params.push_back({"", "NrnThread*", "", "nt"});
params.push_back({"", fmt::format("{}&", instance_struct()), "", "inst"});
params.push_back({"", "int", "", "id"});
auto params = internal_method_parameters();

Check warning on line 834 in src/codegen/codegen_neuron_cpp_visitor.cpp

View check run for this annotation

Codecov / codecov/patch

src/codegen/codegen_neuron_cpp_visitor.cpp#L834

Added line #L834 was not covered by tests
params.push_back({"", "double", "", "v"});
params.push_back({"", "Datum*", "", "_thread"});
if (!codegen_thread_variables.empty()) {
params.push_back({"", fmt::format("{}&", thread_variables_struct()), "", "_thread_vars"});
}

return params;
}
Expand Down
14 changes: 12 additions & 2 deletions test/usecases/kinetic/X2Y.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
NEURON {
SUFFIX X2Y
RANGE X, Y
RANGE X, Y, c1, c2
NONSPECIFIC_CURRENT il
}

Expand All @@ -12,6 +12,8 @@ STATE {
ASSIGNED {
il
i
c1
c2
}

BREAKPOINT {
Expand All @@ -22,9 +24,17 @@ BREAKPOINT {
INITIAL {
X = 0
Y = 1
c1 = 0.0
c2 = 0.0
}

KINETIC state {
~ X <-> Y (0.4, 0.5)
rates()
~ X <-> Y (c1, c2)
i = (f_flux-b_flux)
}

PROCEDURE rates() {
c1 = 0.4
c2 = 0.5
}
Loading