public int findMax ( PairDblInt [ ] cols ) { int maxIdx = 0 ; double maxVal = - 1.0 ; for ( int i = 0 ; i < numLabels ; i ++ ) { if ( cols [ i ] . first > maxVal ) { maxVal = cols [ i ] . first ; maxIdx = i ; } } return maxIdx ; }
Find max .