@@ -134,10 +134,10 @@ void GCell::updateLocations()
134134 const double aspect_ratio = core_area.dx () / (double ) core_area.dy ();
135135 const double height = std::sqrt (inst_area / aspect_ratio);
136136 const double width = height * aspect_ratio;
137- bbox.init (center_x - width / 2 ,
138- center_y - height / 2 ,
139- center_x + width / 2 ,
140- center_y + height / 2 );
137+ bbox.init (center_x - ( width / 2 ) ,
138+ center_y - ( height / 2 ) ,
139+ center_x + ( width / 2 ) ,
140+ center_y + ( height / 2 ) );
141141 }
142142 // density coordi has the same center points.
143143 dLx_ = lx_ = bbox.xMin ();
@@ -727,9 +727,7 @@ void BinGrid::initBins()
727727 if (idealBinArea != 0 ) {
728728 idealBinCnt = totalBinArea / idealBinArea;
729729 }
730- if (idealBinCnt < 4 ) { // the smallest we allow is 2x2 bins
731- idealBinCnt = 4 ;
732- }
730+ idealBinCnt = std::max (idealBinCnt, 4 );
733731
734732 dbBlock* block = pb_->db ()->getChip ()->getBlock ();
735733 log_->info (
@@ -801,7 +799,7 @@ void BinGrid::initBins()
801799 const int bin_ly = ly_ + std::lround (idxY * binSizeY_);
802800 const int bin_ux = lx_ + std::lround ((idxX + 1 ) * binSizeX_);
803801 const int bin_uy = ly_ + std::lround ((idxY + 1 ) * binSizeY_);
804- const int bin_index = idxY * binCntX_ + idxX;
802+ const int bin_index = ( idxY * binCntX_) + idxX;
805803 bins_[bin_index]
806804 = Bin (idxX, idxY, bin_lx, bin_ly, bin_ux, bin_uy, targetDensity_);
807805 auto & bin = bins_[bin_index];
0 commit comments