Registered Member
|
This code, which creates a matrix of unsigned bytes, prints it as ASCII:
I thought the `dec` would instruct Eigen/C++ to give me a decimal interpretation of the values but no luck. I don't see anything in IOFormat that'll control this aspect of the printout. How can I get this to print out numbers the way MatrixXi would? |
Moderator
|
std::dec does not change how char are printed, regardless of Eigen. So as a workaround you have to cast it like: cout << tmp.cast<short>()
|
Registered users: Baidu [Spider], Bing [Bot], Google [Bot], Yahoo [Bot]