Here is part of the Eigen documentation:
Matrix3f m; m << 1, 2, 3, 4, 5, 6, 7, 8, 9; std::cout << m;
Output:
1 2 3 4 5 6 7 8 9
I could not understand how all values โโseparated by commas would be captured by the operator <<above. I did a little experiment:
cout << "Just commas: "; cout << 1, 2, 3, 4, 5; cout << endl; cout << "Commas in parentheses: "; cout << ( 1, 2, 3, 4, 5 ); cout << endl;
Predictably (according to my understanding of C ++ syntax), only one of the values โโwas fixed by the operator <<
Just commas: 1 Commas in parentheses: 5
So the title of the question.
c ++ initialization operator-overloading eigen
Michael
source share