![]() Registered Member ![]()
|
I see that the Index type of Eigen::MatrixBase is a ptrdiff_t (signed) . If I want to write a template function that can operate on either a std::vector or an Eigen::VectorXf, I get warnings about comparing signed/unsigned types because a loop counter for std::vector needs to be size_t (unsigned) and a loop counter for Eigen::VectorXf needs to be ptrdiff_t . Is there anything that can be done to make it work (warning free) with both?
Thanks, David |
![]() Moderator ![]()
|
well you can do something like:
for(ptrdiff_t i=0; i<ptrdiff_t(vec.size()); ++i) .... |
Registered users: Baidu [Spider], Bing [Bot], Google [Bot], rblackwell