Skip to content
Snippets Groups Projects
Commit 1f35cc6d authored by Tom Fischer's avatar Tom Fischer
Browse files

[GL] Namespace std before sqrt.

parent 19757898
No related branches found
No related tags found
No related merge requests found
...@@ -249,8 +249,9 @@ bool lineSegmentIntersect(GeoLib::LineSegment const& s0, ...@@ -249,8 +249,9 @@ bool lineSegmentIntersect(GeoLib::LineSegment const& s0,
GeoLib::Point const p0(a[0]+rhs[0]*v[0], a[1]+rhs[0]*v[1], a[2]+rhs[0]*v[2]); GeoLib::Point const p0(a[0]+rhs[0]*v[0], a[1]+rhs[0]*v[1], a[2]+rhs[0]*v[2]);
GeoLib::Point const p1(c[0]+rhs[1]*w[0], c[1]+rhs[1]*w[1], c[2]+rhs[1]*w[2]); GeoLib::Point const p1(c[0]+rhs[1]*w[0], c[1]+rhs[1]*w[1], c[2]+rhs[1]*w[2]);
double const min_dist(sqrt(MathLib::sqrDist(p0, p1))); double const min_dist(std::sqrt(MathLib::sqrDist(p0, p1)));
double const min_seg_len(std::min(sqrt(sqr_len_v), sqrt(sqr_len_w))); double const min_seg_len(
std::min(std::sqrt(sqr_len_v), std::sqrt(sqr_len_w)));
if (min_dist < min_seg_len * 1e-6) { if (min_dist < min_seg_len * 1e-6) {
s[0] = 0.5 * (p0[0] + p1[0]); s[0] = 0.5 * (p0[0] + p1[0]);
s[1] = 0.5 * (p0[1] + p1[1]); s[1] = 0.5 * (p0[1] + p1[1]);
......
...@@ -90,11 +90,12 @@ public: ...@@ -90,11 +90,12 @@ public:
* @param pnt_id_name_map names corresponding to the points * @param pnt_id_name_map names corresponding to the points
* @param eps relative tolerance value for testing of point uniqueness * @param eps relative tolerance value for testing of point uniqueness
*/ */
void addPointVec(std::unique_ptr<std::vector<Point*>> points, void addPointVec(
std::string& name, std::unique_ptr<std::vector<Point*>> points,
std::unique_ptr<std::map<std::string, std::size_t>> std::string& name,
pnt_id_name_map = nullptr, std::unique_ptr<std::map<std::string, std::size_t>> pnt_id_name_map =
double eps = sqrt(std::numeric_limits<double>::epsilon())); nullptr,
double eps = std::sqrt(std::numeric_limits<double>::epsilon()));
/** /**
* Returns the point vector with the given name. * Returns the point vector with the given name.
......
...@@ -431,7 +431,7 @@ POINT* Grid<POINT>::getNearestPoint(P const& pnt) const ...@@ -431,7 +431,7 @@ POINT* Grid<POINT>::getNearestPoint(P const& pnt) const
std::array<double,6> dists(getPointCellBorderDistances(pnt, coords)); std::array<double,6> dists(getPointCellBorderDistances(pnt, coords));
if (calcNearestPointInGridCell(pnt, coords, sqr_min_dist, nearest_pnt)) { if (calcNearestPointInGridCell(pnt, coords, sqr_min_dist, nearest_pnt)) {
double min_dist(sqrt(sqr_min_dist)); double min_dist(std::sqrt(sqr_min_dist));
if (dists[0] >= min_dist && dists[1] >= min_dist if (dists[0] >= min_dist && dists[1] >= min_dist
&& dists[2] >= min_dist && dists[3] >= min_dist && dists[2] >= min_dist && dists[3] >= min_dist
&& dists[4] >= min_dist && dists[5] >= min_dist) { && dists[4] >= min_dist && dists[5] >= min_dist) {
...@@ -478,7 +478,7 @@ POINT* Grid<POINT>::getNearestPoint(P const& pnt) const ...@@ -478,7 +478,7 @@ POINT* Grid<POINT>::getNearestPoint(P const& pnt) const
} // end while } // end while
} // end else } // end else
double len(sqrt(MathLib::sqrDist(pnt, *nearest_pnt))); double len(std::sqrt(MathLib::sqrDist(pnt, *nearest_pnt)));
// search all other grid cells within the cube with the edge nodes // search all other grid cells within the cube with the edge nodes
std::vector<std::vector<POINT*> const*> vecs_of_pnts( std::vector<std::vector<POINT*> const*> vecs_of_pnts(
getPntVecsOfGridCellsIntersectingCube(pnt, len)); getPntVecsOfGridCellsIntersectingCube(pnt, len));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment