Registered Member
|
Hi ,
In the Eigen doc , only initialization of real number matrix is mentioned, but how do I initialize complex number matrix with "<<"? The real matrix case : Matrix3f m; m << 1, 2, 3, 4, 5, 6, 7, 8, 9; std::cout << m |
Moderator
|
That's not related to Eigen, but to general C++. Use std::complex constructor, e.g.:
typedef std::complex<double> cd; m << cd(2,3), cd(1.2,-45), ....; |
Registered users: bartoloni, Bing [Bot], Google [Bot], Yahoo [Bot]