New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enum class operation #2883
base: develop
Are you sure you want to change the base?
Enum class operation #2883
Conversation
bbad62f
to
3ac95df
Compare
@jaeandersson and @jgillis could someone review this PR, please? |
@@ -33,7 +33,7 @@ | |||
namespace casadi { | |||
/** \brief An atomic operation for the SXElem virtual machine */ | |||
struct ScalarAtomic { | |||
int op; /// Operator index | |||
Operation op; /// Operator index |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jaeandersson your thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please note, that the type of Operation
is controlled by the enum
, see: casadi/core/calculus.hpp:60
enum class Operation : unsigned char {
So, in this PR it is set to unsigned char
. This can be changed.
3ac95df
to
e144948
Compare
The original behavior was that an operation was defined in different integer values (mostly unsigned char and casadi_int). This is a more strict definition. Moreover, in a debugging session reading the words is much easier than numbers.
e144948
to
6f796c1
Compare
Hi @jaeandersson and @jgillis, sorry to bother you again. |
Sorry for the late answer. If I recall correctly, the
I definitely think an unsigned data type or |
The original behavior was that an operation was defined in different
integer values (mostly unsigned char and casadi_int). This is a more
strict definition.
Moreover, in a debugging session reading the words is much easier than
numbers.