MicroModelicaCCompiler
4.5.3
|
#include <equation.hpp>
Public Member Functions | |
Equation () | |
Equation (AST_Expression lhs, AST_Expression rhs, Option< Range > range, EQUATION::Type type, int id) | |
Equation (AST_Expression eq, Option< Range > range, EQUATION::Type type, int id, int offset) | |
Equation (AST_Equation eq, EQUATION::Type type, int id) | |
Equation (AST_Equation eq, Range r, EQUATION::Type type, int id) | |
Equation (AST_Equation eq, Option< Range > r, EQUATION::Type type, int id) | |
~Equation ()=default | |
bool | hasRange () const |
Expression | lhs () const |
Index | index () const |
Expression | rhs () const |
AST_Expression | equation () |
bool | autonomous () |
Util::SymbolTable | calledFunctions () |
std::string | print () const |
std::string | macro () const |
Option< Range > | range () const |
void | setRange (Option< Range > range) |
int | id () const |
EQUATION::Type | type () const |
bool | isDerivative () const |
bool | isZeroCrossing () const |
bool | isOutput () const |
bool | isAlgebraic () const |
Option< Util::Variable > | LHSVariable () const |
bool | isValid () const |
bool | hasAlgebraics () |
std::string | identifier () const |
bool | isRHSReference () const |
void | setUsage (Index usage) |
Index | usage () const |
void | setType (EQUATION::Type type) |
bool | isRecursive () const |
void | applyUsage (Index usage) |
bool | isEmpty () const |
std::string | applyId () const |
Equation | genAlgEquation (Equation der_eq, Index rhs_usage, Index lhs_usage) |
int | arrayId () const |
void | setAlgCode (std::string alg_code) |
std::string | algCode () const |
std::multimap< std::string, int > | usedVariables () const |
Protected Member Functions | |
void | initialize (AST_Equation eq) |
void | initialize (AST_Expression exp) |
void | initialize (AST_Expression lhs, AST_Expression rhs) |
void | setup () |
Private Attributes | |
AST_Equation | _eq |
Expression | _lhs |
Expression | _rhs |
Option< Range > | _range |
bool | _autonomous |
Util::SymbolTable | _calledFunctions |
EQUATION::Type | _type |
int | _id |
int | _offset |
std::string | _lhs_exp |
Index | _usage |
std::string | _alg_code |
Friends | |
std::ostream & | operator<< (std::ostream &out, const Equation &e) |
Definition at line 67 of file equation.hpp.
MicroModelica::IR::Equation::Equation | ( | ) |
Definition at line 65 of file equation.cpp.
MicroModelica::IR::Equation::Equation | ( | AST_Expression | lhs, |
AST_Expression | rhs, | ||
Option< Range > | range, | ||
EQUATION::Type | type, | ||
int | id | ||
) |
Definition at line 80 of file equation.cpp.
References initialize().
MicroModelica::IR::Equation::Equation | ( | AST_Expression | eq, |
Option< Range > | range, | ||
EQUATION::Type | type, | ||
int | id, | ||
int | offset | ||
) |
Definition at line 86 of file equation.cpp.
References initialize().
MicroModelica::IR::Equation::Equation | ( | AST_Equation | eq, |
EQUATION::Type | type, | ||
int | id | ||
) |
MicroModelica::IR::Equation::Equation | ( | AST_Equation | eq, |
Range | r, | ||
EQUATION::Type | type, | ||
int | id | ||
) |
Definition at line 98 of file equation.cpp.
MicroModelica::IR::Equation::Equation | ( | AST_Equation | eq, |
Option< Range > | r, | ||
EQUATION::Type | type, | ||
int | id | ||
) |
Definition at line 104 of file equation.cpp.
|
default |
std::string MicroModelica::IR::Equation::algCode | ( | ) | const |
Definition at line 248 of file equation.cpp.
string MicroModelica::IR::Equation::applyId | ( | ) | const |
Definition at line 163 of file equation.cpp.
void MicroModelica::IR::Equation::applyUsage | ( | Index | usage | ) |
Definition at line 215 of file equation.cpp.
Referenced by MicroModelica::Deps::EQSelector::getNode(), and MicroModelica::IR::QSSModelDepsGenerator::postProcess().
int MicroModelica::IR::Equation::arrayId | ( | ) | const |
Definition at line 244 of file equation.cpp.
Referenced by MicroModelica::IR::JacGenerator::getVariableIndexes().
|
inline |
Definition at line 82 of file equation.hpp.
Referenced by MicroModelica::IR::Model::setOutputs().
|
inline |
Definition at line 83 of file equation.hpp.
|
inline |
Definition at line 81 of file equation.hpp.
Equation MicroModelica::IR::Equation::genAlgEquation | ( | Equation | der_eq, |
Index | rhs_usage, | ||
Index | lhs_usage | ||
) |
Definition at line 226 of file equation.cpp.
References _id.
bool MicroModelica::IR::Equation::hasAlgebraics | ( | ) |
Definition at line 202 of file equation.cpp.
References _range.
|
inline |
Definition at line 77 of file equation.hpp.
References _type, and MicroModelica::IR::EQUATION::ZeroCrossing.
Referenced by MicroModelica::Deps::EQSelector::getNode(), MicroModelica::IR::JacGenerator::guard(), MicroModelica::IR::JacGenerator::init(), MicroModelica::IR::QSSModelDepsGenerator::postProcess(), and MicroModelica::IR::Model::setOutputs().
|
inline |
Definition at line 88 of file equation.hpp.
Referenced by MicroModelica::IR::Model::reduceEquation(), and MicroModelica::IR::QSSModelDepsGenerator::visitF().
string MicroModelica::IR::Equation::identifier | ( | ) | const |
Definition at line 161 of file equation.cpp.
Index MicroModelica::IR::Equation::index | ( | ) | const |
Definition at line 191 of file equation.cpp.
References MicroModelica::IR::getPrinter(), and MicroModelica::IR::EquationPrinter::macro().
|
protected |
Definition at line 130 of file equation.cpp.
References _autonomous, _calledFunctions, _lhs, _lhs_exp, _range, _rhs, MicroModelica::IR::Expression::autonomous(), MicroModelica::IR::Expression::expression(), and LHSVariable().
Referenced by Equation().
|
protected |
Definition at line 117 of file equation.cpp.
|
protected |
Definition at line 110 of file equation.cpp.
|
inline |
Definition at line 96 of file equation.hpp.
Referenced by setup().
|
inline |
Definition at line 90 of file equation.hpp.
Referenced by setup().
bool MicroModelica::IR::Equation::isEmpty | ( | ) | const |
Definition at line 198 of file equation.cpp.
|
inline |
Definition at line 95 of file equation.hpp.
Referenced by setup().
bool MicroModelica::IR::Equation::isRecursive | ( | ) | const |
Definition at line 173 of file equation.cpp.
References _lhs, and isValid().
bool MicroModelica::IR::Equation::isRHSReference | ( | ) | const |
Definition at line 200 of file equation.cpp.
bool MicroModelica::IR::Equation::isValid | ( | ) | const |
Definition at line 183 of file equation.cpp.
References _rhs, and MicroModelica::IR::Expression::isReference().
Referenced by isRecursive(), and MicroModelica::IR::operator<<().
|
inline |
Definition at line 94 of file equation.hpp.
Referenced by setup().
|
inline |
Definition at line 78 of file equation.hpp.
References _type, and MicroModelica::IR::EQUATION::Output.
Referenced by Equation(), MicroModelica::Deps::EQSelector::getScalarUsage(), and MicroModelica::IR::Model::setOutputs().
Definition at line 165 of file equation.cpp.
References _lhs, _rhs, and MicroModelica::IR::Expression::isValid().
Referenced by MicroModelica::IR::JacGenerator::guard(), initialize(), and MicroModelica::Deps::EVSelector::isAlgebraic().
string MicroModelica::IR::Equation::macro | ( | ) | const |
Definition at line 209 of file equation.cpp.
string MicroModelica::IR::Equation::print | ( | ) | const |
Definition at line 211 of file equation.cpp.
Referenced by MicroModelica::IR::QSSModelDepsGenerator::postProcess().
Definition at line 86 of file equation.hpp.
References _usage, and usage().
Referenced by MicroModelica::IR::JacGenerator::guard(), and MicroModelica::IR::Model::setOutputs().
|
inline |
Definition at line 80 of file equation.hpp.
Referenced by Equation().
void MicroModelica::IR::Equation::setAlgCode | ( | std::string | alg_code | ) |
Definition at line 246 of file equation.cpp.
Definition at line 87 of file equation.hpp.
References _usage.
Referenced by MicroModelica::IR::QSSModelDepsGenerator::postProcess().
void MicroModelica::IR::Equation::setType | ( | EQUATION::Type | type | ) |
Definition at line 213 of file equation.cpp.
References MicroModelica::IR::Index::isConstant().
Referenced by MicroModelica::IR::QSSModelDepsGenerator::postProcess(), and MicroModelica::IR::Model::reduceEquation().
|
protected |
Definition at line 147 of file equation.cpp.
References _lhs, isAlgebraic(), isDerivative(), isOutput(), isZeroCrossing(), and MicroModelica::IR::Expression::reference().
Referenced by Equation().
|
inline |
Definition at line 103 of file equation.hpp.
Referenced by MicroModelica::IR::QSSModelDepsGenerator::postProcess().
|
inline |
Definition at line 89 of file equation.hpp.
Referenced by MicroModelica::IR::QSSModelDepsGenerator::visitF().
|
inline |
Definition at line 104 of file equation.hpp.
Referenced by range().
std::multimap< std::string, int > MicroModelica::IR::Equation::usedVariables | ( | ) | const |
Definition at line 250 of file equation.cpp.
|
friend |
Definition at line 185 of file equation.cpp.
|
private |
Definition at line 134 of file equation.hpp.
|
private |
Definition at line 127 of file equation.hpp.
Referenced by initialize().
|
private |
Definition at line 128 of file equation.hpp.
Referenced by initialize().
|
private |
Definition at line 123 of file equation.hpp.
|
private |
Definition at line 130 of file equation.hpp.
Referenced by genAlgEquation().
|
private |
Definition at line 124 of file equation.hpp.
Referenced by Equation(), initialize(), isRecursive(), LHSVariable(), and setup().
|
private |
Definition at line 132 of file equation.hpp.
Referenced by initialize().
|
private |
Definition at line 131 of file equation.hpp.
Definition at line 126 of file equation.hpp.
Referenced by hasAlgebraics(), and initialize().
|
private |
Definition at line 125 of file equation.hpp.
Referenced by Equation(), initialize(), isValid(), LHSVariable(), and MicroModelica::IR::operator<<().
|
private |
Definition at line 129 of file equation.hpp.
Referenced by hasRange(), and lhs().
|
private |
Definition at line 133 of file equation.hpp.
Referenced by range(), and setRange().