This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Appending a matrix in Eigen

Tags: None
(comma "," separated)
marvisiyer
Registered Member
Posts
21
Karma
0

Appending a matrix in Eigen

Mon Apr 01, 2013 6:19 pm
Is there an easy way (other than writing a loop) to append two matrices (either rowwise or columnwise) in Eigen?
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: Appending a matrix in Eigen  Topic is solved

Mon Apr 01, 2013 9:44 pm
You can use the comma initializer, e.g.:

Code: Select all
// rowwise
res.resize(A.rows(), A.cols()+B.cols());
res << A, B;

//column-wise
res.resize(A.rows()+B.rows(), A.cols());
res << A,
       B;


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]