public int countRankOnes ( int location ) { int count = 0 ; for ( int i = 0 ; i < populationSize ; i ++ ) { if ( rankIdx [ location ] [ i ] == 1 ) { count ++ ; } } return count ; }
count the number of 1s in a row of rank matrix