I have a bunch of data in Eigen::Vector2f variables. I want to print it in columns, but I end up with uneven results like so:
Vec1 |Vec2 |Vec3
1.94609 -0.0863508 | 1.71155 -0.137481 |3.00915
1.94609 -0.0863508 |1.57448 1.8755 |387.864
1.94609 -0.0863508 |-0.415677 1.66801 |583.542
2.01589 1.94324 | 1.71155 -0.137481 |433.156
2.01589 1.94324 |1.57448 1.8755 |10.1969
2.01589 1.94324 |-0.415677 1.66801 |303.132
0.00212092 1.966 | 1.71155 -0.137481 |584.061
0.00212092 1.966 |1.57448 1.8755 |124.429
0.00212092 1.966 |-0.415677 1.66801 |17.5172
The print statement I'm using is this:
Eigen::IOFormat fmt(4, 0, ", ", "\n", "", "");
std::cerr << vec1.transpose().format(fmt) << "\t|" << vec2.transpose().format(fmt) << "\t|" << vec3.transpose().format(fmt) << std::endl;
The format statement's precision seems to mean the number of non-zero digits, not decimal places. For instance, if I set the precision to 2, I get numbers like 2, -0.044, and 2.8. And regardless of this, the columns are not aligned.
Any ideas on how to get my columns aligned? Where are all these extra spaces coming from?