code: void addToHistogram(int cellX, int cellY, int orientationIndex, double magnitude) {
  		// see if it's being applied to a valid cell in the histogram
  		if( cellX < 0 || cellX >= cellsPerBlockX)
  			return;
  		if( cellY < 0 || cellY >= cellsPerBlockY)
  			return;
  
  		int index = (cellY*cellsPerBlockX + cellX)*orientationBins + orientationIndex;
  		histogram[index] += magnitude;
  	}
docs: Adds the magnitude to the histogram at the specified cell and orientation
  @param cellX cell coordinate
  @param cellY cell coordinate
  @param orientationIndex orientation coordinate
  @param magnitude edge magnitude