This function returns the index of the minimum value in the vector v. When there are several equal minimum elements then the lowest index is returned.
| 555 | //This function returns the index of the minimum value in the vector v. When there |
| 556 | //are several equal minimum elements then the lowest index is returned. |
| 557 | inline int get_min_index(const std::vector<float>& data, int size) { |
| 558 | int ind = 0; |
| 559 | float min = data[ind]; |
| 560 | for (int ii = 1; ii < size; ii++) { |
| 561 | if (min > data[ii]) { |
| 562 | min = data[ii]; |
| 563 | ind = ii; |
| 564 | } |
| 565 | } |
| 566 | return ind; |
| 567 | } |
| 568 | |
| 569 | inline int get_min_index(const float* data, int size) { |
| 570 | int ind = 0; |
no outgoing calls
no test coverage detected