Eigen column vector to row vector(auto converte)

No need to do transpose of column vector to pass it to a row vector.

Eigen::Vector3d v1;

Eigen::RowVector3d v2;

v1 << 1, 2, 3;

v2 << 4, 5, 6;

std::cout << “v1:\n” << v1 << std::endl;

std::cout << “v2:\n” << v2 << std::endl;

v2 = v1;

std::cout << “v2:\n” << v2 << std::endl;


results:

v1:

1

2

3

v2:

4 5 6

v2:

1

2

3


 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s