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
2772
Karma
18
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: Algar, andreas_k, Baidu [Spider], Bing [Bot], bkchr, david_edmundson, davidemme, djotaku, einar, Exabot [Bot], Google [Bot], google01103, Kver, n-i-c-l-a-s, Pyteo, ramskulls, rbruce, Skippythekangoo, slangkamp, Steve T, Tal, TheraHedwig, veqz, YaCy [Bot], Yahoo [Bot]