How to find the index of the global max of a matrix efficiently?

How to find the index of the global max of a matrix efficiently?

Look at it in 1d and compute the index:

Best regards

Thomas