Skip to content

Commit

Permalink
Move method descriptions to header
Browse files Browse the repository at this point in the history
  • Loading branch information
JCGoran committed Oct 28, 2024
1 parent 25ff744 commit 3acc4b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 0 additions & 4 deletions src/codegen/codegen_neuron_cpp_visitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2646,7 +2646,6 @@ CodegenCppVisitor::ParamVector CodegenNeuronCppVisitor::cvode_update_parameters(
}


/* print the function returning the # of ODEs to solve */
void CodegenNeuronCppVisitor::print_cvode_count() {
printer->fmt_push_block("static constexpr int {}(int _type)",
method_name(naming::CVODE_COUNT_NAME));
Expand All @@ -2655,7 +2654,6 @@ void CodegenNeuronCppVisitor::print_cvode_count() {
printer->add_newline(2);
}

/* print the function for setup of tolerances */
void CodegenNeuronCppVisitor::print_cvode_tolerances() {
const CodegenNeuronCppVisitor::ParamVector tolerances_parameters = {
{"", "Prop*", "", "_prop"},
Expand Down Expand Up @@ -2692,7 +2690,6 @@ void CodegenNeuronCppVisitor::print_cvode_tolerances() {
printer->add_newline(2);
}

/* print the CVODE update function (called ``name``) from ``block`` */
void CodegenNeuronCppVisitor::print_cvode_update(const std::string& name,
const ast::StatementBlock& block) {
printer->fmt_push_block("static int {}({})",
Expand All @@ -2709,7 +2706,6 @@ void CodegenNeuronCppVisitor::print_cvode_update(const std::string& name,
printer->add_newline(2);
}

/* print the setup function (that calls an update function) */
void CodegenNeuronCppVisitor::print_cvode_setup(const std::string& setup_name,
const std::string& update_name) {
printer->fmt_push_block("static void {}({})",
Expand Down
7 changes: 6 additions & 1 deletion src/codegen/codegen_neuron_cpp_visitor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -784,12 +784,17 @@ class CodegenNeuronCppVisitor: public CodegenCppVisitor {
*/
void print_cvode_definitions();

/* print the CVODE function returning the # of ODEs to solve */
void print_cvode_count();

/* print the CVODE function for setup of tolerances */
void print_cvode_tolerances();

void print_cvode_update(const std::string& name, const ast::StatementBlock& node);
/* print the CVODE update function ``name`` from ``block`` */
void print_cvode_update(const std::string& name, const ast::StatementBlock& block);

/* print the CVODE setup function ``setup_name`` that calls the CVODE update function
* ``update_name`` */
void print_cvode_setup(const std::string& setup_name, const std::string& update_name);


Expand Down

0 comments on commit 3acc4b3

Please sign in to comment.