Holds expressions and meta-data corresponding to a physical quantity evolving in time. More...
#include <dae_builder_internal.hpp>
Extra doc: https://github.com/casadi/casadi/wiki/L_t
Definition at line 83 of file dae_builder_internal.hpp.
Public Member Functions | |
casadi_int | size (Attribute a) const |
Total number of elements for a particular attribute. More... | |
XmlNode | export_xml (const DaeBuilderInternal &self) const |
bool | is_real () const |
bool | has_start () const |
bool | is_set () const |
bool | has_beq () const |
bool | needs_der () const |
MX | get_der (DaeBuilderInternal &self, bool may_allocate=true) |
MX | get_der (const DaeBuilderInternal &self) const |
void | get_attribute (Attribute a, double *val) const |
void | get_attribute (Attribute a, std::vector< double > *val) const |
void | get_attribute (Attribute a, std::string *val) const |
void | set_attribute (Attribute a, double val) |
void | set_attribute (Attribute a, const std::vector< double > &val) |
void | set_attribute (Attribute a, const std::string &val) |
Public Attributes | |
casadi_int | index |
Location in variable vector. More... | |
std::string | name |
Name of the variable. More... | |
std::vector< casadi_int > | dimension |
Dimensions. More... | |
casadi_int | numel |
Number of elements - product of all dimensions. More... | |
Category | category |
CasADi's classification of the variable. More... | |
casadi_int | der |
casadi_int | bind |
bool | in_rhs |
std::vector< double > | value |
Numerical value (also for booleans, integers, enums) More... | |
std::string | stringvalue |
String value (if string-valued) More... | |
bool | dependency |
Do other expressions depend on this variable. More... | |
std::vector< casadi_int > | dependencies |
Dependencies. More... | |
std::vector< DependenciesKind > | dependenciesKind |
Dependencies. More... | |
MX | v |
Variable expression (always a vector) More... | |
MX | ieq |
Initial equation (to be removed and moved to a separate dependent variable) More... | |
unsigned int | value_reference |
std::string | description |
Type | type |
Causality | causality |
Variability | variability |
std::string | unit |
std::string | display_unit |
Initial | initial |
double | min |
double | max |
double | nominal |
std::vector< double > | start |
casadi_int | der_of |
casadi_int | parent |
Friends | |
class | DaeBuilderInternal |
XmlNode casadi::Variable::export_xml | ( | const DaeBuilderInternal & | self | ) | const |
Definition at line 439 of file dae_builder_internal.cpp.
References casadi::BINARY, causality, casadi::CONTINUOUS, der_of, description, display_unit, has_start(), casadi::inf, initial, is_real(), casadi::LOCAL, max, min, casadi::NA, name, casadi::XmlNode::name, nominal, casadi::NUMEL, casadi::XmlNode::set_attribute(), start, casadi::STRING, casadi::to_string(), type, unit, value_reference, and variability.
void casadi::Variable::get_attribute | ( | Attribute | a, |
double * | val | ||
) | const |
Get by attribute name
Definition at line 297 of file dae_builder_internal.cpp.
References casadi::MAX, max, casadi::MIN, min, name, casadi::NOMINAL, nominal, numel, casadi::START, start, casadi::to_string(), casadi::VALUE, and value.
Referenced by casadi::DaeBuilderInternal::attribute(), get_attribute(), and casadi::DaeBuilderInternal::string_attribute().
void casadi::Variable::get_attribute | ( | Attribute | a, |
std::string * | val | ||
) | const |
Get by attribute name
Definition at line 342 of file dae_builder_internal.cpp.
References casadi::STRINGVALUE, stringvalue, and casadi::to_string().
void casadi::Variable::get_attribute | ( | Attribute | a, |
std::vector< double > * | val | ||
) | const |
Get by attribute name
Definition at line 323 of file dae_builder_internal.cpp.
References get_attribute(), size(), casadi::START, start, casadi::to_string(), and casadi::VALUE.
MX casadi::Variable::get_der | ( | const DaeBuilderInternal & | self | ) | const |
Definition at line 530 of file dae_builder_internal.cpp.
References causality, der, casadi::INDEPENDENT, name, needs_der(), casadi::MX::sparsity(), v, and casadi::GenericMatrix< MX >::zeros().
MX casadi::Variable::get_der | ( | DaeBuilderInternal & | self, |
bool | may_allocate = true |
||
) |
Definition at line 544 of file dae_builder_internal.cpp.
References der, der_of, dimension, index, name, needs_der(), parent, and casadi::Z.
|
inline |
Definition at line 195 of file dae_builder_internal.hpp.
bool casadi::Variable::has_start | ( | ) | const |
Definition at line 509 of file dae_builder_internal.cpp.
References casadi::APPROX, casadi::CALCULATED, causality, casadi::CONSTANT, casadi::EXACT, casadi::INDEPENDENT, initial, casadi::INPUT, casadi::PARAMETER, and variability.
Referenced by export_xml().
|
inline |
Definition at line 184 of file dae_builder_internal.hpp.
References casadi::FLOAT32, and casadi::FLOAT64.
Referenced by export_xml().
|
inline |
Definition at line 190 of file dae_builder_internal.hpp.
References casadi::STRING.
Referenced by casadi::Fmu2::init(), and casadi::Fmu3::init().
bool casadi::Variable::needs_der | ( | ) | const |
Definition at line 519 of file dae_builder_internal.cpp.
References causality, casadi::CONTINUOUS, casadi::INDEPENDENT, casadi::INPUT, and variability.
Referenced by get_der().
void casadi::Variable::set_attribute | ( | Attribute | a, |
const std::string & | val | ||
) |
Set by attribute name
Definition at line 398 of file dae_builder_internal.cpp.
References casadi::STRINGVALUE, and stringvalue.
void casadi::Variable::set_attribute | ( | Attribute | a, |
const std::vector< double > & | val | ||
) |
Set by attribute name
Definition at line 377 of file dae_builder_internal.cpp.
References numel, set_attribute(), casadi::START, start, casadi::to_string(), casadi::VALUE, and value.
void casadi::Variable::set_attribute | ( | Attribute | a, |
double | val | ||
) |
Set by attribute name
Definition at line 353 of file dae_builder_internal.cpp.
References casadi::MAX, max, casadi::MIN, min, casadi::NOMINAL, nominal, casadi::START, start, casadi::to_string(), casadi::VALUE, and value.
Referenced by casadi::DaeBuilderInternal::set_attribute(), set_attribute(), and casadi::DaeBuilderInternal::set_string_attribute().
casadi_int casadi::Variable::size | ( | Attribute | a | ) | const |
Definition at line 285 of file dae_builder_internal.cpp.
References numel, casadi::START, and casadi::VALUE.
Referenced by get_attribute(), casadi::DaeBuilderInternal::set_attribute(), and casadi::DaeBuilderInternal::size().
|
friend |
Definition at line 84 of file dae_builder_internal.hpp.
casadi_int casadi::Variable::bind |
Definition at line 137 of file dae_builder_internal.hpp.
Referenced by casadi::DaeBuilder::beq(), casadi::DaeBuilderInternal::disp(), casadi::DaeBuilderInternal::lift(), casadi::DaeBuilderInternal::output(), and casadi::DaeBuilderInternal::read_expr().
Category casadi::Variable::category |
Definition at line 114 of file dae_builder_internal.hpp.
Referenced by casadi::DaeBuilderInternal::categorize(), casadi::DaeBuilderInternal::category(), casadi::DaeBuilderInternal::eq(), casadi::DaeBuilderInternal::import_model_structure(), casadi::DaeBuilderInternal::set_category(), casadi::DaeBuilderInternal::set_causality(), casadi::DaeBuilderInternal::set_variability(), and casadi::DaeBuilderInternal::when().
Causality casadi::Variable::causality |
Attributes common to all types of variables, cf. Table 17 in FMI specification
Definition at line 109 of file dae_builder_internal.hpp.
Referenced by casadi::DaeBuilderInternal::add(), casadi::DaeBuilderInternal::causality(), export_xml(), get_der(), has_start(), casadi::FmuInternal::init(), casadi::Fmu2::init(), casadi::Fmu3::init(), needs_der(), casadi::DaeBuilderInternal::set_causality(), and casadi::DaeBuilderInternal::set_variability().
|
mutable |
|
mutable |
Definition at line 155 of file dae_builder_internal.hpp.
Referenced by casadi::DaeBuilderInternal::hess_sparsity(), and casadi::DaeBuilderInternal::import_model_structure().
bool casadi::Variable::dependency |
Definition at line 149 of file dae_builder_internal.hpp.
Referenced by casadi::DaeBuilderInternal::import_model_structure().
casadi_int casadi::Variable::der |
Definition at line 134 of file dae_builder_internal.hpp.
Referenced by casadi::DaeBuilderInternal::eq(), casadi::DaeBuilderInternal::fmu_fun(), get_der(), casadi::DaeBuilderInternal::import_model_structure(), casadi::DaeBuilderInternal::import_model_variables(), and casadi::DaeBuilderInternal::output().
casadi_int casadi::Variable::der_of |
Type specific attributes common to all types, cf. Table FMI 3.0 specification
Definition at line 129 of file dae_builder_internal.hpp.
Referenced by export_xml(), get_der(), and casadi::DaeBuilderInternal::import_model_variables().
std::string casadi::Variable::description |
Attributes common to all types of variables, cf. Table 17 in FMI specification
Definition at line 107 of file dae_builder_internal.hpp.
Referenced by casadi::DaeBuilderInternal::add(), and export_xml().
std::vector<casadi_int> casadi::Variable::dimension |
Definition at line 99 of file dae_builder_internal.hpp.
Referenced by get_der().
std::string casadi::Variable::display_unit |
Type specific attributes common to all types, cf. Table FMI 3.0 specification
Definition at line 120 of file dae_builder_internal.hpp.
Referenced by casadi::DaeBuilderInternal::add(), and export_xml().
MX casadi::Variable::ieq |
Definition at line 161 of file dae_builder_internal.hpp.
Referenced by casadi::DaeBuilderInternal::disp(), and casadi::DaeBuilderInternal::set_init().
bool casadi::Variable::in_rhs |
Definition at line 140 of file dae_builder_internal.hpp.
Referenced by casadi::DaeBuilderInternal::set_category().
casadi_int casadi::Variable::index |
Definition at line 93 of file dae_builder_internal.hpp.
Referenced by casadi::DaeBuilderInternal::add(), casadi::DaeBuilder::add_variable_new(), casadi::DaeBuilderInternal::assign(), casadi::DaeBuilderInternal::eq(), get_der(), casadi::DaeBuilderInternal::import_binding_equations(), casadi::DaeBuilderInternal::import_dynamic_equations(), casadi::DaeBuilderInternal::import_model_structure(), casadi::DaeBuilderInternal::import_model_variables(), casadi::DaeBuilderInternal::lift(), casadi::DaeBuilderInternal::read_expr(), casadi::DaeBuilderInternal::reinit(), casadi::DaeBuilderInternal::set_category(), casadi::DaeBuilderInternal::set_causality(), casadi::DaeBuilderInternal::set_init(), casadi::DaeBuilderInternal::set_variability(), and casadi::DaeBuilderInternal::when().
Initial casadi::Variable::initial |
Type specific attributes common to all types, cf. Table FMI 3.0 specification
Definition at line 121 of file dae_builder_internal.hpp.
Referenced by casadi::DaeBuilderInternal::add(), export_xml(), and has_start().
double casadi::Variable::max |
Type specific attributes common to all types, cf. Table FMI 3.0 specification
Definition at line 126 of file dae_builder_internal.hpp.
Referenced by casadi::DaeBuilderInternal::add(), export_xml(), get_attribute(), casadi::FmuInternal::init(), and set_attribute().
double casadi::Variable::min |
Type specific attributes common to all types, cf. Table FMI 3.0 specification
Definition at line 125 of file dae_builder_internal.hpp.
Referenced by casadi::DaeBuilderInternal::add(), export_xml(), get_attribute(), casadi::FmuInternal::init(), and set_attribute().
std::string casadi::Variable::name |
Definition at line 96 of file dae_builder_internal.hpp.
Referenced by casadi::DaeBuilderInternal::add_fun(), casadi::DaeBuilderInternal::disp(), casadi::DaeBuilderInternal::eq(), export_xml(), get_attribute(), get_der(), casadi::DaeBuilderInternal::import_dynamic_equations(), casadi::DaeBuilderInternal::import_initial_equations(), casadi::DaeBuilderInternal::import_model_structure(), casadi::FmuInternal::init(), casadi::Fmu2::init(), casadi::Fmu3::init(), casadi::DaeBuilderInternal::lift(), casadi::DaeBuilderInternal::name(), casadi::DaeBuilderInternal::output(), casadi::DaeBuilderInternal::read_expr(), casadi::DaeBuilderInternal::set_category(), casadi::DaeBuilderInternal::set_causality(), and casadi::DaeBuilderInternal::set_variability().
double casadi::Variable::nominal |
Type specific attributes common to all types, cf. Table FMI 3.0 specification
Definition at line 127 of file dae_builder_internal.hpp.
Referenced by casadi::DaeBuilderInternal::add(), export_xml(), get_attribute(), casadi::FmuInternal::init(), and set_attribute().
casadi_int casadi::Variable::numel |
Definition at line 102 of file dae_builder_internal.hpp.
Referenced by get_attribute(), casadi::Fmu2::init(), casadi::Fmu3::init(), set_attribute(), and size().
casadi_int casadi::Variable::parent |
Type specific attributes common to all types, cf. Table FMI 3.0 specification
Definition at line 130 of file dae_builder_internal.hpp.
Referenced by casadi::DaeBuilderInternal::assign(), casadi::DaeBuilderInternal::disp(), casadi::DaeBuilderInternal::eq(), get_der(), casadi::DaeBuilderInternal::import_model_structure(), casadi::DaeBuilderInternal::import_model_variables(), casadi::DaeBuilderInternal::reinit(), casadi::DaeBuilderInternal::transition(), and casadi::DaeBuilderInternal::when().
std::vector<double> casadi::Variable::start |
Type specific attributes common to all types, cf. Table FMI 3.0 specification
Definition at line 128 of file dae_builder_internal.hpp.
Referenced by casadi::DaeBuilderInternal::add(), export_xml(), get_attribute(), casadi::DaeBuilderInternal::read_identifier(), and set_attribute().
std::string casadi::Variable::stringvalue |
Definition at line 146 of file dae_builder_internal.hpp.
Referenced by get_attribute(), casadi::Fmu2::init(), casadi::Fmu3::init(), and set_attribute().
Type casadi::Variable::type |
Attributes common to all types of variables, cf. Table 17 in FMI specification
Definition at line 108 of file dae_builder_internal.hpp.
Referenced by casadi::DaeBuilderInternal::add(), export_xml(), casadi::Fmu2::init(), and casadi::Fmu3::init().
std::string casadi::Variable::unit |
Type specific attributes common to all types, cf. Table FMI 3.0 specification
Definition at line 119 of file dae_builder_internal.hpp.
Referenced by casadi::DaeBuilderInternal::add(), and export_xml().
MX casadi::Variable::v |
Definition at line 158 of file dae_builder_internal.hpp.
Referenced by casadi::DaeBuilder::add_variable(), casadi::DaeBuilder::add_variable_new(), casadi::DaeBuilder::beq(), casadi::DaeBuilderInternal::disp(), get_der(), casadi::DaeBuilderInternal::import_dynamic_equations(), casadi::DaeBuilderInternal::import_initial_equations(), casadi::DaeBuilderInternal::lift(), casadi::DaeBuilderInternal::output(), casadi::DaeBuilderInternal::read_expr(), casadi::DaeBuilderInternal::read_identifier(), casadi::DaeBuilderInternal::var(), and casadi::DaeBuilderInternal::when().
std::vector<double> casadi::Variable::value |
Definition at line 143 of file dae_builder_internal.hpp.
Referenced by get_attribute(), casadi::Fmu2::init(), casadi::Fmu3::init(), and set_attribute().
unsigned int casadi::Variable::value_reference |
Attributes common to all types of variables, cf. Table 17 in FMI specification
Definition at line 106 of file dae_builder_internal.hpp.
Referenced by export_xml(), casadi::DaeBuilderInternal::generate_model_structure(), casadi::FmuInternal::init(), casadi::Fmu2::init(), and casadi::Fmu3::init().
Variability casadi::Variable::variability |
Attributes common to all types of variables, cf. Table 17 in FMI specification
Definition at line 110 of file dae_builder_internal.hpp.
Referenced by casadi::DaeBuilderInternal::add(), export_xml(), has_start(), casadi::DaeBuilderInternal::import_initial_equations(), needs_der(), casadi::DaeBuilderInternal::output(), casadi::DaeBuilderInternal::set_variability(), and casadi::DaeBuilderInternal::variability().