Fork me on GitHub
#uncomplicate
<
2017-04-06
>
Björn Ebbinghaus22:04:26

Hey, I need to apply a function to every element in a large matrix, but this function needs also the position inside the matrix (col, row). Whats the best way to do this? Two "helper"-matrices and fmap? (fmap (fn [v col row]) my-matrix cols rows) Where rows is like

1 1 1 
2 2 2
3 3 3
and cols like rows just transposed? This sounds bad to me. 😕 Is there a better solution? hiphip for example has its own amap implementation where you can get the indices through bindings. Is this the way to go?