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

[GL/MaL/MGTL] Using new quicksort version.

parent 042bbc2b
No related branches found
No related tags found
No related merge requests found
......@@ -411,7 +411,8 @@ void Polygon::splitPolygonAtIntersection (std::list<Polygon*>::iterator polygon_
void Polygon::splitPolygonAtPoint (std::list<GeoLib::Polygon*>::iterator polygon_it)
{
std::size_t n ((*polygon_it)->getNumberOfPoints() - 1), idx0 (0), idx1(0);
std::size_t* id_vec (new std::size_t[n]), *perm (new std::size_t[n]);
std::vector<std::size_t> id_vec(n);
std::vector<std::size_t> perm(n);
for (std::size_t k(0); k < n; k++)
{
id_vec[k] = (*polygon_it)->getPointID (k);
......@@ -425,8 +426,6 @@ void Polygon::splitPolygonAtPoint (std::list<GeoLib::Polygon*>::iterator polygon
{
idx0 = perm[k];
idx1 = perm[k + 1];
delete [] perm;
delete [] id_vec;
if (idx0 > idx1)
std::swap (idx0, idx1);
......@@ -456,8 +455,6 @@ void Polygon::splitPolygonAtPoint (std::list<GeoLib::Polygon*>::iterator polygon
return;
}
delete [] perm;
delete [] id_vec;
}
GeoLib::Polygon* createPolygonFromCircle (GeoLib::Point const& middle_pnt, double radius,
......
......@@ -26,7 +26,7 @@ PiecewiseLinearInterpolation::PiecewiseLinearInterpolation(const std::vector<dou
_supp_pnts(supporting_points), _values_at_supp_pnts(values_at_supp_pnts)
{
if (!supp_pnts_sorted) {
BaseLib::Quicksort<double, double>(_supp_pnts, static_cast<std::size_t> (0),
BaseLib::quicksort<double, double>(_supp_pnts, static_cast<std::size_t> (0),
_supp_pnts.size(), _values_at_supp_pnts);
}
}
......@@ -39,7 +39,7 @@ PiecewiseLinearInterpolation::PiecewiseLinearInterpolation(const std::vector<dou
_supp_pnts(supporting_points), _values_at_supp_pnts(values_at_supp_pnts)
{
if (!supp_pnts_sorted) {
BaseLib::Quicksort<double, double>(_supp_pnts, static_cast<std::size_t> (0),
BaseLib::quicksort<double, double>(_supp_pnts, static_cast<std::size_t> (0),
_supp_pnts.size(),
_values_at_supp_pnts);
}
......
......@@ -42,7 +42,7 @@ MeshNodesAlongPolyline::MeshNodesAlongPolyline(
}
// sort the nodes along the polyline according to their distances
BaseLib::Quicksort<double> (_dist_of_proj_node_from_ply_start, 0,
BaseLib::quicksort<double> (_dist_of_proj_node_from_ply_start, 0,
_dist_of_proj_node_from_ply_start.size(), _msh_node_ids);
}
......
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