Say I have two matrices, A and B. If B is a matrix of boolean values, then in numpy/Python, I can write 

```
A[:, B[:, i]] += 1

```

which, to my knowledge, would update all the elements in A with columns selected by a row in B being "true".

What would be the most efficient equivalent in OpenCV & C++?

**Edit #1**

I know how to access elements using `.at()`, but I'm looking for alternatives, that are hopefully more succinct too!