Registered Member
|
Hi All,
I want to find maximum value column for each row in matrix. I am doing it using for loop over the rows as shows below in code. I am wondering if there is better way of doing it, more precisely without using for loop. Also is maxcoeff vectorized?
Thanks for your answers, Parmeet |
Moderator
|
There is no shorter way yet. Regarding vectorization, vec.maxCoeff() is vectorized (standard reduction), but not the version returning the index: vec.maxCoeff(int&). It's not impossible but I'd not expect significant gain if any.
|
Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell, Yahoo [Bot]