Computes the index of the maximum valued element of a vector. Note: the return value is zero-indexed.