-
Notifications
You must be signed in to change notification settings - Fork 67
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
Cleanup size and indices attributes, return values and arguments #767
Conversation
In 4e23a1e I restored the template parameter of
While this is probably an indication of some underlying issue in all the default define constructors (probably on how they handle const-correctness), handling this is way out of the scope of the issue, and so I will track this in a separate issue. |
3f03336
to
e31930b
Compare
e31930b
to
80b31d0
Compare
std::stringstream ss; | ||
ss << inInt; | ||
return ss.str(); |
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.
There should be std::to_string
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.
I prefer to always avoid the use of std::to_string
, as on integers it works fine, but for floating points create critical problems. However this is just adding a function that already existed for a different type, we can cleanup the function all together.
Since they are related to Eigen, isn't it because of the maps? |
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.
None of my comments is blocking
It could be related, but rows and columns in iDynTree were unsigned before, and now they are std::size_t (so always unsigned). Similarly, the template parameters were updated from unsigned to std::size_t, so always unsigned. I do not know why changing the template parameter from unsigned to std::size_t triggers that problems, and probably it is indeed related to Eigen::Map, but I don't know immediately if it is related to the fact that rows and columns use signed return values. |
robotology#767 changed the index type but did not update the bindings code accordingly.
robotology#767 changed the index type but did not update the bindings code accordingly.
Fix pybind11 bindings compilation after #767.
It just started for solving some warnings:
And as usual it escalated to a large scale change. However, it is better to do this before the iDynTree 2 releases as it changes (slightly) the API and the ABI.
For consistency with std and Eigen, all sizes and indices have been changed to use
std::size_t
for unsigned quantities andstd::ptrdiff_t
for signed quantities. The only exception is the index stored in the triplets of the iDynTree::SparseMatrix data structure, that have been left defined toint
for compatibility with Eigen.