diff --git a/GeoLib/Polygon.cpp b/GeoLib/Polygon.cpp index 7c838dc8460e56fd57ae7fdf253695594c045b3d..346b4359674ed35b935c078dc2b30baf9ff707bd 100644 --- a/GeoLib/Polygon.cpp +++ b/GeoLib/Polygon.cpp @@ -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, diff --git a/MathLib/InterpolationAlgorithms/PiecewiseLinearInterpolation.cpp b/MathLib/InterpolationAlgorithms/PiecewiseLinearInterpolation.cpp index fb4d88b3fb52fa805a519583e5fa345b65444b08..dc5c7802b20cbdd1722ce614f299d1fc3a157240 100644 --- a/MathLib/InterpolationAlgorithms/PiecewiseLinearInterpolation.cpp +++ b/MathLib/InterpolationAlgorithms/PiecewiseLinearInterpolation.cpp @@ -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); } diff --git a/MeshGeoToolsLib/MeshNodesAlongPolyline.cpp b/MeshGeoToolsLib/MeshNodesAlongPolyline.cpp index b425eb202a1ba779b22c60f1c321d96a836bc97c..8e9500fd53b6191cd28dd188b1eb5d0814ae02da 100644 --- a/MeshGeoToolsLib/MeshNodesAlongPolyline.cpp +++ b/MeshGeoToolsLib/MeshNodesAlongPolyline.cpp @@ -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); }