Typedefs | |
typedef struct VariableStruct | Variable |
typedef struct EquationStruct | Equation |
typedef struct GraphStruct | Graph |
Functions | |
void | graph_add_der (Graph &G, Variable *v) |
void | add_variable (Equation *e, Variable *v) |
void | graph_add_der (Graph &G, Equation *e, bool add_old=false) |
bool | dfs_match_pantelides (Equation *i) |
bool | dae_struct_detect_pantelides (Graph &G, std::vector< casadi_int > &var_map, std::vector< casadi_int > &eq_map, casadi_int max_iter) |
Perform Pantelides algorithm for DAE index reduction. More... | |
void | dae_struct_detect (const std::string &algorithm, const Sparsity &graph, std::vector< casadi_int > &var_map, std::vector< casadi_int > &eq_map, casadi_int max_iter) |
typedef struct EquationStruct casadi::IndexReduction::Equation |
Definition at line 1226 of file integration_tools.cpp.
typedef struct GraphStruct casadi::IndexReduction::Graph |
Definition at line 1226 of file integration_tools.cpp.
typedef struct VariableStruct casadi::IndexReduction::Variable |
Definition at line 1226 of file integration_tools.cpp.
void casadi::IndexReduction::dae_struct_detect | ( | const std::string & | algorithm, |
const Sparsity & | graph, | ||
std::vector< casadi_int > & | var_map, | ||
std::vector< casadi_int > & | eq_map, | ||
casadi_int | max_iter | ||
) |
Definition at line 655 of file integration_tools.cpp.
References casadi::Sparsity::colind(), dae_struct_detect_pantelides(), casadi::Sparsity::row(), casadi::Sparsity::size1(), and casadi::Sparsity::size2().
Referenced by casadi::reduce_index_gen().
bool casadi::IndexReduction::dae_struct_detect_pantelides | ( | Graph & | G, |
std::vector< casadi_int > & | var_map, | ||
std::vector< casadi_int > & | eq_map, | ||
casadi_int | max_iter | ||
) |
The algorithm works purely on structure: no symbolics equations are used.
graph | Structural relation between equations (columns) and variables (rows) |
var_map | Indicate for each variable where its derivative can be found in the variable list if var_map[i]>=0: var[var_map[i]] == dot(var[i]) Size will increase to accommodate new variables introduced by index reduction |
eq_map | Indicate for each equation if it should be differentiated if eq_map[i]>=0: eq[eq_map[i]] == dot(eq[i]) Size will increase over the original number of equations to accommodate extra equations introduced by index reduction |
Definition at line 575 of file integration_tools.cpp.
References dfs_match_pantelides(), and graph_add_der().
Referenced by dae_struct_detect().
bool casadi::IndexReduction::dfs_match_pantelides | ( | Equation * | i | ) |
Definition at line 489 of file integration_tools.cpp.
References add_variable(), and graph_add_der().
Definition at line 465 of file integration_tools.cpp.
Referenced by dae_struct_detect_pantelides(), and graph_add_der().