![Logo](logo.png) |
User Guide
|
Go to the documentation of this file.
17 #include <unordered_map>
18 #include <unordered_set>
70 std::vector<std::vector<int>>
nu_L;
71 std::vector<std::vector<int>>
nu_R;
72 std::vector<std::string>
k_f;
73 std::vector<std::string>
k_b;
92 std::vector<std::string>
odes;
void visit_wrapped_expression(ast::WrappedExpression &node) override
visit node of type ast::WrappedExpression
void compute_compartment_factor(ast::Compartment &node, const ast::Name &name)
std::unordered_map< std::string, int > array_state_var_size
unordered_map from array state variable to its size (for summing over each element of any array state...
stochiometric matrices nu_L, nu_R forwards/backwards fluxes k_f, k_b (see kinetic_schemes....
void visit_statement_block(ast::StatementBlock &node) override
visit node of type ast::StatementBlock
void process_conserve_reac_var(const std::string &varname, int count=1)
update CONSERVE statement with reaction var term
Represent CONSERVE statement in NMODL.
int get_conserve_statement_count() const
std::vector< std::string > non_state_var_fflux
multiplicate constant terms for fluxes from non-state vars as reactants e.g.
int conserve_statement_count
counts the number of CONSERVE statements in Kinetic blocks
encapsulates code generation backend implementations
std::vector< std::string > compartment_factors
multiplicative factors for ODEs from COMPARTMENT statements
void visit_program(ast::Program &node) override
visit node of type ast::Program
int state_var_count
number of state variables
void visit_compartment(ast::Compartment &node) override
visit node of type ast::Compartment
std::vector< std::string > fflux
generated set of fluxes and ODEs
std::string conserve_equation_statevar
conserve statement: current state variable being processed
void visit_reaction_operator(ast::ReactionOperator &node) override
visit node of type ast::ReactionOperator
struct nmodl::visitor::KineticBlockVisitor::RateEqs rate_eqs
Visitor for kinetic block statements
void visit_conserve(ast::Conserve &node) override
visit node of type ast::Conserve
KineticBlockVisitor()=default
bool in_reaction_statement_lhs
true if we are visiting the left hand side of reaction statement
int i_statement
current statement index
bool in_conserve_statement
true if we are visiting a CONSERVE statement
void set_compartment_factor(int var_index, const std::string &factor)
std::unordered_set< ast::Statement * > statements_to_remove
statements to remove from block
Concrete visitor for all AST classes.
std::string modfile_fflux
current expressions for the fflux, bflux variables that can be used in the mod file and that are dete...
void visit_reaction_statement(ast::ReactionStatement &node) override
visit node of type ast::ReactionStatement
std::vector< std::string > state_var
state variables vector
std::string conserve_equation_str
conserve statement equation as string
void compute_indexed_compartment_factor(ast::Compartment &node, const ast::Name &name)
std::vector< std::string > bflux
Represent COMPARTMENT statement in NMODL.
void visit_react_var_name(ast::ReactVarName &node) override
visit node of type ast::ReactVarName
Represents block encapsulating list of statements.
std::string modfile_bflux
std::vector< std::string > k_b
std::vector< std::string > additive_terms
additive constant terms for ODEs from reaction statements like ~ x << (a)
void visit_kinetic_block(ast::KineticBlock &node) override
visit node of type ast::KineticBlock
std::unordered_map< std::string, int > state_var_index
unordered_map from state variable to corresponding index
std::vector< ast::KineticBlock * > kinetic_blocks
vector of kinetic block nodes
ast::StatementBlock * current_statement_block
current statement block being visited
void unroll_kinetic_blocks(ast::Program &node)
Unroll loops in KINETIC blocks.
std::vector< std::string > k_f
std::vector< std::string > odes
void process_reac_var(const std::string &varname, int count=1)
update stoichiometric matrices with reaction var term
Represents top level AST node for whole NMODL input.
bool in_reaction_statement
true if we are visiting a reaction statement
std::vector< std::vector< int > > nu_R
std::vector< std::vector< int > > nu_L
Wrap any other expression type.
std::vector< std::string > non_state_var_bflux
std::string conserve_equation_factor
conserve statement: current state var multiplicative factor being processed
Concrete visitor for all AST classes.