Skip to content

Commit

Permalink
Issue #3682 Updated event function signature in Integrator
Browse files Browse the repository at this point in the history
New signature can be generated using a Switch instance
  • Loading branch information
jaeandersson committed May 7, 2024
1 parent 1f743d0 commit ab1f2f3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions casadi/core/integrator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,21 @@ std::string to_string(DynOut v) {

std::string to_string(EventIn v) {
switch (v) {
case EVENT_INDEX: return "index";
case EVENT_T: return "t";
case EVENT_X0: return "x0";
case EVENT_Z0: return "z0";
case EVENT_X: return "x";
case EVENT_Z: return "z";
case EVENT_P: return "p";
case EVENT_U: return "u";
case EVENT_INDEX: return "index";
default: break;
}
return "";
}

std::string to_string(EventOut v) {
switch (v) {
case EVENT_X: return "x";
case EVENT_Z: return "z";
case EVENT_POST_X: return "post_x";
case EVENT_POST_Z: return "post_z";
default: break;
}
return "";
Expand Down
10 changes: 5 additions & 5 deletions casadi/core/integrator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,18 +196,18 @@ enum DynOut {

/// Inputs of an event transition function
enum EventIn {
EVENT_INDEX,
EVENT_T,
EVENT_X0,
EVENT_Z0,
EVENT_X,
EVENT_Z,
EVENT_P,
EVENT_U,
EVENT_INDEX,
EVENT_NUM_IN};

/// Outputs of an event transition function
enum EventOut {
EVENT_X,
EVENT_Z,
EVENT_POST_X,
EVENT_POST_Z,
EVENT_NUM_OUT};

/// Input arguments of an integrator
Expand Down

0 comments on commit ab1f2f3

Please sign in to comment.