Registered Member
|
Hello,
Is there a way to add vectors to matrices ? for example :
and v + m1 could give 8,6, 10,13 I did not find, Thank you in advance. |
Moderator
|
We don't allow that by default as it does not make sense. However you can still achieve this using this explicit expression:
m1.colwise() + v |
Registered Member
|
Thank you for your response
but it does not compile, the error is /home/rtrepos/usr/src/vle_dev/eigen_utils/src/test_eigen_utils.cpp: In function ‘int main(int, const char**)’: /home/rtrepos/usr/src/vle_dev/eigen_utils/src/test_eigen_utils.cpp:159: error: no match for ‘operator+’ in ‘((Eigen::MatrixBase<Eigen::Matrix<double, 10000, 10000, 2, 10000, 10000> >*)(& m1))->Eigen::MatrixBase<Derived>::colwise [with Derived = Eigen::Matrix<double, 10000, 10000, 2, 10000, 10000>]() + v’ |
Moderator
|
ah sorry, this is only in the devel branch. so you can either switch to it (basic features are very stable) or wait until the 3.0 version is out (in a couple of months).
|
Registered Member
|
Ok thank you,
I will wait for the next version. |
Registered users: Bing [Bot], daret, Google [Bot], sandyvee, Sogou [Bot]