Reply to topic

Elementwise operation on SparseVectors

pratikc
Registered Member
Posts
1
Karma
0
Can anyone please suggest a way to perform element-wise multiplication of two sparsevectors?
User avatar ggael
Moderator
Posts
2193
Karma
15
OS
You can use cwiseProduct from the Matrix-coefficient-wise-API (http://eigen.tuxfamily.org/dox-devel/gr ... tml#title6):

c = a.cwiseProduct(b);

 
Reply to topic

Bookmarks



Who is online

Registered users: alake, Baidu [Spider], Bing [Bot], boudewijn, brandy_000, bshah, cristian.onet, Exabot [Bot], garthecho, Google [Bot], GreatEmerald, Horus, ken300, koriun, Majestic-12 [Bot], mgraesslin, parzt, peje, Tuukka, vomus, Yahoo [Bot]