Registered Member
|
for instance if there is a vector or a matrix include an element 26, how can I find the position (i,j) of 26 in the vector?
I'm new for Eigen, pls give me some help, thanks |
Moderator
|
There is no equivalent. If you know there is only one, you can do:
|
Registered Member
|
dear ggael, I tried as you told me, but there is a mistake at A==26, it says: no operator "==" matches this operands.
|
Moderator
|
Works for me. Maybe you're using an old version.
|
Registered Member
|
I changed my Eigen version to 3.1.3 but it still not work, could you give me some details about yours which works well.
just like: #include <Eigen/eigen> #include <iostream> using namespace std; using namespace Eigen; int main() { ArrayXXi A(4,4); A<<1,56,4,6, 45,76,43,22, 3,42,4,2, 4,6,7,9; int i,j; if ((A==36).maxCoeff(&i,&j)) { cout<<"Yes"; } else { cout<<"No"; } return 0; } |
Registered Member
|
I've got it. thanks very much
|
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]