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
2628
Karma
16
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: andreas_k, Baidu [Spider], Bing [Bot], elvisangelaccio, frankragr, Google [Bot], google01103, hugo.pereira@free.fr, jakedarcy, kdeuserk, koriun, Kver, lruffini, Majestic-12 [Bot], mmolch, nuttshell, paviluf, pedrorodriguez, predatux, ramskulls, rv8ter, Saabhero, Steve Guilford, timorei, wojtask, Xiceph, Yahoo [Bot]