Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
mcychan authored Sep 28, 2024
1 parent fea181d commit 72eddec
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 @@ -207,15 +207,15 @@ namespace PnnLABQuant
static double rotateLeft(double u, double v, double delta) {
auto theta = M_PI * randrange(minRatio, maxRatio) / exp(delta);
auto result = u * sin(theta) + v * cos(theta);
if (result <= minRatio || result >= maxRatio)
if (delta < 50 && (result <= minRatio || result >= maxRatio))
result = rotateLeft(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)
if (delta < 50 && (result <= minRatio || result >= maxRatio))
result = rotateRight(u, v, delta + .5);
return result;
}
Expand Down

0 comments on commit 72eddec

Please sign in to comment.