MCPcopy Index your code
hub / github.com/processing/processing / minIndex

Method minIndex

core/src/processing/data/FloatList.java:570–592  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

568
569
570 public int minIndex() {
571 checkMinMax("minIndex");
572 float m = Float.NaN;
573 int mi = -1;
574 for (int i = 0; i < count; i++) {
575 // find one good value to start
576 if (data[i] == data[i]) {
577 m = data[i];
578 mi = i;
579
580 // calculate the rest
581 for (int j = i+1; j < count; j++) {
582 float d = data[j];
583 if (!Float.isNaN(d) && (d < m)) {
584 m = data[j];
585 mi = j;
586 }
587 }
588 break;
589 }
590 }
591 return mi;
592 }
593
594
595 /**

Callers 1

minMethod · 0.95

Calls 1

checkMinMaxMethod · 0.95

Tested by

no test coverage detected