I am currently working on a algorithm that needs to find all equal occurrences a an item in a matrix. I decided to use uBLAS matrices from boost. So my problem is:
I have a ublas::matrix looking like:
1 2 3 4 5
2 4 6 8 1
1 5 4 6 8
9 4 6 7 0
and I want to find all positions (x,y) of i.e. the value 6.
Is there a function for?
There is no ublas-specific function (as far as I can tell), you will have to scan the matrix the usual way — through iterators or through indexed access:
test: https://ideone.com/qhW9b