I have the vector
Eigen::VectorXf test(4);
test << 1.231, 1.23, 0.41, 1.233;
I'm trying to get the indexes of where test.array() > 1
. I would expect the result to be in array form (std::vector is fine) and I want to take advantage of eigens optimisations (i.e. no unnecessary for loops). The result should be {0, 1, 3}. How would I go about doing this?
edit
There is a question that I was sent that is similar Eigen Indices of Dense Matrix meeting Condition
But the key difference is that I'm using vectors, therefore everything is based in one dimension
edit 2
for reference here is how I would do the same in xtensor
auto indexes = xt::flatten_indices(xt::argwhere(xt::greater(xt::flatten(data), 1)));