Skip to content

Commit

Permalink
Improve names.
Browse files Browse the repository at this point in the history
  • Loading branch information
1uc committed Oct 10, 2024
1 parent 0d428cf commit d88ad52
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions src/language/nmodl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1152,15 +1152,15 @@
type: Expression

- LinEquation:
brief: "TODO"
brief: "One equation in a system of equations tha collectively form a LINEAR block."
nmodl: "~ "
members:
- left_linxpression:
brief: "TODO"
- lhs:
brief: "Left-hand-side of the equation."
type: Expression
suffix: {value: " = "}
- linxpression:
brief: "TODO"
- rhs:
brief: "Right-hand-side of the equation."
type: Expression

- FunctionCall:
Expand Down
4 changes: 2 additions & 2 deletions src/visitors/sympy_replace_solutions_visitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,11 @@ void SympyReplaceSolutionsVisitor::visit_diff_eq_expression(ast::DiffEqExpressio
void SympyReplaceSolutionsVisitor::visit_lin_equation(ast::LinEquation& node) {
logger->debug("SympyReplaceSolutionsVisitor :: visit {}", to_nmodl(node));
auto get_lhs = [](const ast::Node& node) -> std::shared_ptr<ast::Expression> {
return dynamic_cast<const ast::LinEquation&>(node).get_left_linxpression();
return dynamic_cast<const ast::LinEquation&>(node).get_lhs();
};

auto get_rhs = [](const ast::Node& node) -> std::shared_ptr<ast::Expression> {
return dynamic_cast<const ast::LinEquation&>(node).get_left_linxpression();
return dynamic_cast<const ast::LinEquation&>(node).get_rhs();
};

try_replace_tagged_statement(node, get_lhs, get_rhs);
Expand Down
4 changes: 2 additions & 2 deletions src/visitors/sympy_solver_visitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -577,9 +577,9 @@ void SympySolverVisitor::visit_derivative_block(ast::DerivativeBlock& node) {

void SympySolverVisitor::visit_lin_equation(ast::LinEquation& node) {
check_expr_statements_in_same_block();
std::string lin_eq = to_nmodl_for_sympy(*node.get_left_linxpression());
std::string lin_eq = to_nmodl_for_sympy(*node.get_lhs());
lin_eq += " = ";
lin_eq += to_nmodl_for_sympy(*node.get_linxpression());
lin_eq += to_nmodl_for_sympy(*node.get_rhs());
eq_system.push_back(lin_eq);
expression_statements.insert(current_expression_statement);
last_expression_statement = current_expression_statement;
Expand Down

0 comments on commit d88ad52

Please sign in to comment.