MicroModelicaCCompiler  4.5.3
MicroModelica::IR::JacGenerator Class Reference

#include <jacobian.hpp>

Collaboration diagram for MicroModelica::IR::JacGenerator:

Public Member Functions

 JacGenerator ()
 
 ~JacGenerator ()=default
 
void init (SB::Deps::SetVertex vertex)
 
void end ()
 
void postProcess (SB::Deps::SetVertex vertex)
 
void visitF (SB::Deps::SetVertex vertex, SB::Deps::VariableDep var_dep)
 
void visitF (SB::Deps::SetVertex vertex, SB::Deps::VariableDep var_dep, SB::Deps::SetVertex gen_vertex)
 
void visitG (SB::Deps::SetVertex v_vertex, SB::Deps::SetVertex g_vertex, SB::Deps::VariableDep var_dep, int index_shift)
 
void visitG (SB::Deps::SetVertex v_vertex, SB::Deps::SetVertex g_vertex, SB::PWLMap use_map, SB::Deps::LMapExp use_map_exp, Expression use_exp, SB::PWLMap def_map, SB::Deps::LMapExp def_map_exp, SB::Set intersection)
 
void initG (SB::Deps::SetVertex vertex, SB::Deps::SetEdge edge)
 
JacDef def ()
 
void setup (EquationTable algebraics)
 
EquationTable config ()
 

Protected Member Functions

IR::Expression generateExp (string var_name, vector< string > indices)
 
void dependencyPrologue (Equation eq, SB::Deps::VariableDep var_dep, std::string guard="")
 
void dependencyEpilogue (Equation eq, SB::Deps::VariableDep var_dep)
 
void updateMatrix (std::map< std::string, std::set< std::string >> &matrix)
 
void generatePos (int id, EQUATION::Type type, std::string row="c_row", std::string col="col")
 
void generateEquation (int id, EQUATION::Type type)
 
void generateEquation (int v_id, int g_id, EQUATION::Type type)
 
std::string getVariableIndexes (Equation eq)
 
std::string guard (SB::Set dom, int offset, std::string var_name, SB::Deps::LMapExp map, Equation v_eq)
 
void Fvisitor (SB::Deps::SetVertex vertex, SB::Deps::VariableDep var_dep, int eq_id)
 

Protected Attributes

JacDef _jac_def
 
int _tabs
 
EquationTable _algebraics
 

Detailed Description

Definition at line 71 of file jacobian.hpp.

Constructor & Destructor Documentation

◆ JacGenerator()

MicroModelica::IR::JacGenerator::JacGenerator ( )

Definition at line 58 of file jacobian.cpp.

◆ ~JacGenerator()

MicroModelica::IR::JacGenerator::~JacGenerator ( )
default

Member Function Documentation

◆ config()

EquationTable MicroModelica::IR::JacGenerator::config ( )
inline

Definition at line 87 of file jacobian.hpp.

◆ def()

JacDef MicroModelica::IR::JacGenerator::def ( )

◆ dependencyEpilogue()

void MicroModelica::IR::JacGenerator::dependencyEpilogue ( Equation  eq,
SB::Deps::VariableDep  var_dep 
)
protected

Definition at line 146 of file jacobian.cpp.

◆ dependencyPrologue()

void MicroModelica::IR::JacGenerator::dependencyPrologue ( Equation  eq,
SB::Deps::VariableDep  var_dep,
std::string  guard = "" 
)
protected

Definition at line 110 of file jacobian.cpp.

References guard(), and MicroModelica::IR::Range::in().

Here is the call graph for this function:

◆ end()

void MicroModelica::IR::JacGenerator::end ( )

Definition at line 88 of file jacobian.cpp.

◆ Fvisitor()

void MicroModelica::IR::JacGenerator::Fvisitor ( SB::Deps::SetVertex  vertex,
SB::Deps::VariableDep  var_dep,
int  eq_id 
)
protected

Definition at line 216 of file jacobian.cpp.

Referenced by getVariableIndexes().

◆ generateEquation() [1/2]

void MicroModelica::IR::JacGenerator::generateEquation ( int  id,
EQUATION::Type  type 
)
protected

Definition at line 173 of file jacobian.cpp.

◆ generateEquation() [2/2]

void MicroModelica::IR::JacGenerator::generateEquation ( int  v_id,
int  g_id,
EQUATION::Type  type 
)
protected

Definition at line 182 of file jacobian.cpp.

◆ generateExp()

IR::Expression MicroModelica::IR::JacGenerator::generateExp ( string  var_name,
vector< string >  indices 
)
protected

◆ generatePos()

void MicroModelica::IR::JacGenerator::generatePos ( int  id,
EQUATION::Type  type,
std::string  row = "c_row",
std::string  col = "col" 
)
protected

Definition at line 159 of file jacobian.cpp.

◆ getVariableIndexes()

string MicroModelica::IR::JacGenerator::getVariableIndexes ( Equation  eq)
protected

Definition at line 192 of file jacobian.cpp.

References MicroModelica::IR::Equation::arrayId(), and Fvisitor().

Here is the call graph for this function:

◆ guard()

std::string MicroModelica::IR::JacGenerator::guard ( SB::Set  dom,
int  offset,
std::string  var_name,
SB::Deps::LMapExp  map,
Equation  v_eq 
)
protected

◆ init()

void MicroModelica::IR::JacGenerator::init ( SB::Deps::SetVertex  vertex)

◆ initG()

void MicroModelica::IR::JacGenerator::initG ( SB::Deps::SetVertex  vertex,
SB::Deps::SetEdge  edge 
)

Definition at line 282 of file jacobian.cpp.

◆ postProcess()

void MicroModelica::IR::JacGenerator::postProcess ( SB::Deps::SetVertex  vertex)

Definition at line 60 of file jacobian.cpp.

References _jac_def, _tabs, MicroModelica::IR::JacDef::code, MicroModelica::IR::FunctionPrinter::jacMacrosAccess(), and TAB.

Here is the call graph for this function:

◆ setup()

void MicroModelica::IR::JacGenerator::setup ( EquationTable  algebraics)
inline

Definition at line 86 of file jacobian.hpp.

◆ updateMatrix()

void MicroModelica::IR::JacGenerator::updateMatrix ( std::map< std::string, std::set< std::string >> &  matrix)
protected

◆ visitF() [1/2]

void MicroModelica::IR::JacGenerator::visitF ( SB::Deps::SetVertex  vertex,
SB::Deps::VariableDep  var_dep 
)

Definition at line 204 of file jacobian.cpp.

◆ visitF() [2/2]

void MicroModelica::IR::JacGenerator::visitF ( SB::Deps::SetVertex  vertex,
SB::Deps::VariableDep  var_dep,
SB::Deps::SetVertex  gen_vertex 
)

Definition at line 210 of file jacobian.cpp.

◆ visitG() [1/2]

void MicroModelica::IR::JacGenerator::visitG ( SB::Deps::SetVertex  v_vertex,
SB::Deps::SetVertex  g_vertex,
SB::Deps::VariableDep  var_dep,
int  index_shift 
)

Definition at line 231 of file jacobian.cpp.

◆ visitG() [2/2]

void MicroModelica::IR::JacGenerator::visitG ( SB::Deps::SetVertex  v_vertex,
SB::Deps::SetVertex  g_vertex,
SB::PWLMap  use_map,
SB::Deps::LMapExp  use_map_exp,
Expression  use_exp,
SB::PWLMap  def_map,
SB::Deps::LMapExp  def_map_exp,
SB::Set  intersection 
)

Definition at line 277 of file jacobian.cpp.

Member Data Documentation

◆ _algebraics

EquationTable MicroModelica::IR::JacGenerator::_algebraics
protected

Definition at line 102 of file jacobian.hpp.

◆ _jac_def

JacDef MicroModelica::IR::JacGenerator::_jac_def
protected

Definition at line 100 of file jacobian.hpp.

Referenced by postProcess().

◆ _tabs

int MicroModelica::IR::JacGenerator::_tabs
protected

Definition at line 101 of file jacobian.hpp.

Referenced by guard(), and postProcess().


The documentation for this class was generated from the following files: