code: func (f *fragment) sum(filter *Row, bitDepth uint) (sum, count uint64, err error) {
  	// Compute count based on the existence row.
  	consider := f.row(uint64(bitDepth))
  	if filter != nil {
  		consider = consider.Intersect(filter)
  	}
  	count = consider.Count()
  
  	// Compute the sum based on the bit count of each row multiplied by the
  	// place value of each row. For example, 10 bits in the 1's place plus
  	// 4 bits in the 2's place plus 3 bits in the 4's place equals a total
  	// sum of 30:
  	//
  	//   10*(2^0) + 4*(2^1) + 3*(2^2) = 30
  	//
  	var cnt uint64
  	for i := uint(0); i < bitDepth; i++ {
  		row := f.row(uint64(i))
  		cnt = row.intersectionCount(consider)
  		sum += (1 << i) * cnt
  	}
  
  	return sum, count, nil
  }
docs: // sum returns the sum of a given bsiGroup as well as the number of columns involved.
  // A bitmap can be passed in to optionally filter the computed columns.