MCPcopy Create free account
hub / github.com/BoevaLab/FREEC / get_min_index

Function get_min_index

src/myFunc.cpp:557–567  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

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.
557inline 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
569inline int get_min_index(const float* data, int size) {
570 int ind = 0;

Callers 4

findnextbreakpointFunction · 0.85
runEM_linearFunction · 0.85
runEMFunction · 0.85
runEMlogFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected