code: public double sum(PairDblInt[] cols) {
  	double res = 0.0;
  	
  	for (int i = 0; i < numLabels; i++) {
  	    res += cols[i].first;
  	}
  	
  	if (res < 1 && res > -1) {
  	    res = 1;
  	}
  	
  	return res;
      }
docs: Sum.
  
  @param cols the cols
  @return the double