Skip to content

Commit

Permalink
Merge pull request BIMCoderLiang#20 from BIMCoderLiang/span
Browse files Browse the repository at this point in the history
optimize find-span
  • Loading branch information
jiayu2019 authored May 15, 2024
2 parents c8dcd14 + 08cd3d7 commit ceca762
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/LNLib/Algorithm/Polynomials.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ int LNLib::Polynomials::GetKnotSpanIndex(int degree, const std::vector<double>&

int low = 0;
int high = n + 1;
int mid = static_cast<int>(floor((low + high) / 2.0));
int mid = (low + high) / 2;

while (paramT < knotVector[mid] ||
paramT >= knotVector[mid + 1])
Expand All @@ -154,7 +154,7 @@ int LNLib::Polynomials::GetKnotSpanIndex(int degree, const std::vector<double>&
{
low = mid;
}
mid = static_cast<int>(floor((low + high) / 2.0));
mid = (low + high) / 2;
}
return mid;
}
Expand Down

0 comments on commit ceca762

Please sign in to comment.