User Guide
nmodl::visitor::SympyReplaceSolutionsVisitor::InterleavesCounter Struct Reference

Count interleaves of assignment statement inside the system of equations. More...

Detailed Description

Count interleaves of assignment statement inside the system of equations.

Example:

\\ not in the system, n = 0, is_in_system = false
~ x + y = 0 \\ system, in_system switch false -> true, n = 1
~ y = a + 1 \\ system, no switch, nothing to do
a = ... \\ no system, in_system switch true -> false, nothing to do
~ z = x + y + z \\ system, in_system switch false -> true, n = 2

Number of interleaves: n-1 = 1

Definition at line 275 of file sympy_replace_solutions_visitor.hpp.

Public Member Functions

void new_equation (const bool is_in_system)
 Count interleaves defined as a switch false -> true for in_system. More...
 
size_t n () const
 Number of interleaves. More...
 

Private Attributes

size_t n_interleaves = 0
 Number of interleaves of assignment statements in between equations of the system of equations. More...
 
bool in_system = false
 Bool that keeps track if just wrote an equation of the system of equations (true) or not (false) More...
 

Member Function Documentation

◆ n()

size_t nmodl::visitor::SympyReplaceSolutionsVisitor::InterleavesCounter::n ( ) const
inline

Number of interleaves.

We need to remove the first activation of the switch except if there were no switches

Definition at line 281 of file sympy_replace_solutions_visitor.hpp.

◆ new_equation()

void nmodl::visitor::SympyReplaceSolutionsVisitor::InterleavesCounter::new_equation ( const bool  is_in_system)

Count interleaves defined as a switch false -> true for in_system.

SympyReplaceSolutionsVisitor tells us that a new equation appear and, depending where it is located, it can determine if it is part of the main system of equations or is something else. Every time we are out of the system and we print a new equation that is in the system we update the counter. in_system follows, with lag,

Parameters
is_in_systemand every time they are false and true respectively we detect a switch.
is_in_systemis a bool provided from outside that tells us if a new equation is indeed part of the main system of equations

Definition at line 28 of file sympy_replace_solutions_visitor.cpp.

Member Data Documentation

◆ in_system

bool nmodl::visitor::SympyReplaceSolutionsVisitor::InterleavesCounter::in_system = false
private

Bool that keeps track if just wrote an equation of the system of equations (true) or not (false)

Definition at line 297 of file sympy_replace_solutions_visitor.hpp.

◆ n_interleaves

size_t nmodl::visitor::SympyReplaceSolutionsVisitor::InterleavesCounter::n_interleaves = 0
private

Number of interleaves of assignment statements in between equations of the system of equations.

This is equivalent to the number of switches false -> true of in_system minus the very first one (if the system exists).

Definition at line 293 of file sympy_replace_solutions_visitor.hpp.


The documentation for this struct was generated from the following files:
nmodl::visitor::SympyReplaceSolutionsVisitor::InterleavesCounter::in_system
bool in_system
Bool that keeps track if just wrote an equation of the system of equations (true) or not (false)
Definition: sympy_replace_solutions_visitor.hpp:297
nmodl::visitor::SympyReplaceSolutionsVisitor::InterleavesCounter::n
size_t n() const
Number of interleaves.
Definition: sympy_replace_solutions_visitor.hpp:281