Skip to content

Commit

Permalink
Update PnnLABGAQuantizer.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
mcychan authored Jul 10, 2023
1 parent 8a4d4ad commit 05c0814
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nQuantGpp/PnnLABGAQuantizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,15 @@ namespace PnnLABQuant
auto theta = M_PI * randrange(minRatio, maxRatio) / exp(delta);
auto result = u * sin(theta) + v * cos(theta);
if (result <= minRatio || result >= maxRatio)
result = rotateRight(u, v, delta);
result = rotateRight(u, v, delta + .5);
return result;
}

static double rotateRight(double u, double v, double delta) {
auto theta = M_PI * randrange(minRatio, maxRatio) / exp(delta);
auto result = u * cos(theta) - v * sin(theta);
if (result <= minRatio || result >= maxRatio)
result = rotateLeft(u, v, delta);
result = rotateLeft(u, v, delta + .5);
return result;
}

Expand Down

0 comments on commit 05c0814

Please sign in to comment.