Skip to content

Commit

Permalink
fixed clang-tidy issues
Browse files Browse the repository at this point in the history
Signed-off-by: Cho Moon <[email protected]>
  • Loading branch information
precisionmoon committed Oct 6, 2023
1 parent 0d556c2 commit 2ad4861
Show file tree
Hide file tree
Showing 4 changed files with 109 additions and 111 deletions.
44 changes: 21 additions & 23 deletions src/cts/src/HTreeBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,8 @@ void adjustToplevelTopology(Point<double>& a,
}
}

void HTreeBuilder::findLegalLocations(const Point<double> parentPoint,
const Point<double> branchPoint,
void HTreeBuilder::findLegalLocations(Point<double> parentPoint,
Point<double> branchPoint,
double x1,
double y1,
double x2,
Expand Down Expand Up @@ -390,10 +390,10 @@ void HTreeBuilder::findLegalLocations(const Point<double> parentPoint,
}

Point<double> HTreeBuilder::findBestLegalLocation(
const double targetDist,
const Point<double> branchPoint,
const Point<double> parentPoint,
const std::vector<Point<double>>& legalLocations,
double targetDist,
Point<double> branchPoint,
Point<double> parentPoint,
std::vector<Point<double>>& legalLocations,
const std::vector<Point<double>>& sinks,
double x1,
double y1,
Expand Down Expand Up @@ -429,9 +429,9 @@ Point<double> HTreeBuilder::findBestLegalLocation(
// point to parent point The second priority is to lower the weighted sink
// distance
Point<double> HTreeBuilder::adjustBestLegalLocation(
const double targetDist,
const Point<double> currLoc,
const Point<double> parentPoint,
double targetDist,
Point<double> currLoc,
Point<double> parentPoint,
const std::vector<Point<double>>& sinks,
double x1,
double y1,
Expand Down Expand Up @@ -508,10 +508,10 @@ Point<double> HTreeBuilder::adjustBestLegalLocation(
}

void HTreeBuilder::checkLegalityAndCostSpecial(
const Point<double> oldLoc,
const Point<double> newLoc,
const Point<double> parentPoint,
const double targetDist,
Point<double> oldLoc,
Point<double> newLoc,
Point<double> parentPoint,
double targetDist,
const std::vector<Point<double>>& sinks,
int scalingFactor,
double x1,
Expand Down Expand Up @@ -544,9 +544,9 @@ void HTreeBuilder::checkLegalityAndCostSpecial(
// legal branch point. In either scenario, move branch point to match target
// distance and to minimize weighted sink distance
Point<double> HTreeBuilder::adjustBranchLength(
const Point<double> branchPoint,
const Point<double> parentPoint,
const double targetDist,
Point<double> branchPoint,
Point<double> parentPoint,
double targetDist,
const std::vector<Point<double>>& sinks,
int scalingFactor)
{
Expand Down Expand Up @@ -621,17 +621,16 @@ Point<double> HTreeBuilder::adjustBranchLength(
return branchPoint;
}

void HTreeBuilder::checkLegalityAndCost(const Point<double> oldLoc,
const Point<double> newLoc,
const Point<double> parentPoint,
const double targetDist,
void HTreeBuilder::checkLegalityAndCost(Point<double> oldLoc,
Point<double> newLoc,
Point<double> parentPoint,
double targetDist,
const std::vector<Point<double>>& sinks,
int scalingFactor,
Point<double>& bestLoc,
double& sinkDist,
double& bestSinkDist)
{
double x1, y1, x2, y2;
if (floatEqual(newLoc.computeDist(parentPoint), targetDist)
&& checkLegalityLoc(newLoc, scalingFactor)) {
sinkDist = weightedDistance(newLoc, oldLoc, sinks);
Expand All @@ -644,8 +643,7 @@ void HTreeBuilder::checkLegalityAndCost(const Point<double> oldLoc,
"dist={:0.3f}, sinkDist={:0.3f}", oldLoc, newLoc, targetDist, sinkDist);
} else {
debugPrint(logger_, CTS, "legalizer", 3, "adjustBranchLength: branchPt move:{}=>{} is illegal or dist {:0.3f} "
"!= {:0.3f} blockage ({:0.3f} {:0.3f}) ({:0.3f} {:0.3f})",
oldLoc, newLoc, newLoc.computeDist(parentPoint), targetDist, x1, y1, x2, y2);
"!= {:0.3f}", oldLoc, newLoc, newLoc.computeDist(parentPoint), targetDist);
// clang-format on
}
}
Expand Down
54 changes: 27 additions & 27 deletions src/cts/src/HTreeBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,20 +180,20 @@ class HTreeBuilder : public TreeBuilder
}

void run() override;
void findLegalLocations(const Point<double> parentPoint,
const Point<double> branchPoint,
void findLegalLocations(Point<double> parentPoint,
Point<double> branchPoint,
double x1,
double y1,
double x2,
double y2,
std::vector<Point<double>>& points);
void addCandidateLoc(const double x,
const double y,
const Point<double> parentPoint,
const double x1,
const double y1,
const double x2,
const double y2,
void addCandidateLoc(double x,
double y,
Point<double> parentPoint,
double x1,
double y1,
double x2,
double y2,
std::vector<Point<double>>& points)
{
Point<double> candidate(x, y);
Expand All @@ -202,29 +202,29 @@ class HTreeBuilder : public TreeBuilder
}
}
Point<double> findBestLegalLocation(
const double origDist,
const Point<double> branchPoint,
const Point<double> parentPoint,
const std::vector<Point<double>>& legalLocations,
double targetDist,
Point<double> branchPoint,
Point<double> parentPoint,
std::vector<Point<double>>& legalLocations,
const std::vector<Point<double>>& sinks,
double x1,
double y1,
double x2,
double y2,
int scalingFactor);
Point<double> adjustBestLegalLocation(const double origDist,
const Point<double> currLoc,
const Point<double> parentPoint,
Point<double> adjustBestLegalLocation(double targetDist,
Point<double> currLoc,
Point<double> parentPoint,
const std::vector<Point<double>>& sinks,
double x1,
double y1,
double x2,
double y2,
int scalingFactor);
void checkLegalityAndCostSpecial(const Point<double> oldLoc,
const Point<double> newLoc,
const Point<double> parentPoint,
const double targetDist,
void checkLegalityAndCostSpecial(Point<double> oldLoc,
Point<double> newLoc,
Point<double> parentPoint,
double targetDist,
const std::vector<Point<double>>& sinks,
int scalingFactor,
double x1,
Expand All @@ -234,15 +234,15 @@ class HTreeBuilder : public TreeBuilder
Point<double>& bestLoc,
double& sinkDist,
double& bestSinkDist);
Point<double> adjustBranchLength(const Point<double> branchPoint,
const Point<double> parentPoint,
const double targetDist,
Point<double> adjustBranchLength(Point<double> branchPoint,
Point<double> parentPoint,
double targetDist,
const std::vector<Point<double>>& sinks,
int scalingFactor);
void checkLegalityAndCost(const Point<double> oldLoc,
const Point<double> newLoc,
const Point<double> parentPoint,
const double targetDist,
void checkLegalityAndCost(Point<double> oldLoc,
Point<double> newLoc,
Point<double> parentPoint,
double targetDist,
const std::vector<Point<double>>& sinks,
int scalingFactor,
Point<double>& bestLoc,
Expand Down
Loading

0 comments on commit 2ad4861

Please sign in to comment.