diff options
author | tatiana-yan <tatiana.kondakova@gmail.com> | 2019-04-09 15:11:54 +0300 |
---|---|---|
committer | mpimenov <mpimenov@users.noreply.github.com> | 2019-04-09 18:02:17 +0300 |
commit | c246c21ac21225165cf2a1018a30e272d1273b8e (patch) | |
tree | 3ea4ced943e2a9e35a16feb3d64902f8bf734f85 /geometry | |
parent | d3c01acd1948d59924b3735add4c593b5cb55b59 (diff) |
[std] Remove std/array.hpp
Diffstat (limited to 'geometry')
-rw-r--r-- | geometry/covering.hpp | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/geometry/covering.hpp b/geometry/covering.hpp index 110b51432c..8e08d66425 100644 --- a/geometry/covering.hpp +++ b/geometry/covering.hpp @@ -9,14 +9,12 @@ #include "base/set_operations.hpp" #include "base/stl_helpers.hpp" -#include "std/algorithm.hpp" -#include "std/array.hpp" -#include "std/functional.hpp" -#include "std/iterator.hpp" -#include "std/map.hpp" -#include "std/queue.hpp" -#include "std/utility.hpp" -#include "std/vector.hpp" +#include <algorithm> +#include <array> +#include <cstdint> +#include <iterator> +#include <map> +#include <vector> namespace covering { @@ -31,7 +29,7 @@ public: explicit Covering(CellId cell) : m_Size(1) { m_Covering[cell.Level()].push_back(cell); } - explicit Covering(vector<CellId> const & v) + explicit Covering(std::vector<CellId> const & v) { for (size_t i = 0; i < v.size(); ++i) m_Covering[v[i].Level()].push_back(v[i]); @@ -74,13 +72,13 @@ public: m_Size = CalculateSize(); } - void OutputToVector(vector<CellId> & result) const + void OutputToVector(std::vector<CellId> & result) const { for (int level = 0; level < CellId::DEPTH_LEVELS; ++level) result.insert(result.end(), m_Covering[level].begin(), m_Covering[level].end()); } - void OutputToVector(vector<int64_t> & result, int cellDepth) const + void OutputToVector(std::vector<int64_t> & result, int cellDepth) const { for (int level = 0; level < CellId::DEPTH_LEVELS; ++level) for (size_t i = 0; i < m_Covering[level].size(); ++i) @@ -112,12 +110,12 @@ private: void SimplifyLevel(int level) { std::map<CellId, uint32_t, LessLevelOrder> parentCellCounts; - using ConstIterator = typename vector<CellId>::const_iterator; + using ConstIterator = typename std::vector<CellId>::const_iterator; for (ConstIterator it = m_Covering[level].begin(); it != m_Covering[level].end(); ++it) ++parentCellCounts[it->Parent()]; - vector<CellId> parentCells; - vector<CellId> childCells; + std::vector<CellId> parentCells; + std::vector<CellId> childCells; for (ConstIterator it = m_Covering[level].begin(); it != m_Covering[level].end(); ++it) { if (parentCellCounts[it->Parent()] > 1) @@ -132,7 +130,7 @@ private: AppendToVector(m_Covering[level - 1], parentCells); } - static void AppendToVector(vector<CellId> & a, vector<CellId> const & b) + static void AppendToVector(std::vector<CellId> & a, std::vector<CellId> const & b) { ASSERT(base::IsSortedAndUnique(a.begin(), a.end(), LessLevelOrder()), (a)); ASSERT(base::IsSortedAndUnique(b.begin(), b.end(), LessLevelOrder()), (b)); @@ -165,14 +163,14 @@ private: void Sort() { for (int level = 0; level < CellId::DEPTH_LEVELS; ++level) - sort(m_Covering[level].begin(), m_Covering[level].end(), LessLevelOrder()); + std::sort(m_Covering[level].begin(), m_Covering[level].end(), LessLevelOrder()); } void Unique() { for (int level = 0; level < CellId::DEPTH_LEVELS; ++level) { - vector<CellId> & covering = m_Covering[level]; + std::vector<CellId> & covering = m_Covering[level]; ASSERT(std::is_sorted(covering.begin(), covering.end(), LessLevelOrder()), (covering)); covering.erase(std::unique(covering.begin(), covering.end()), covering.end()); } @@ -183,7 +181,7 @@ private: RemoveDuplicateChildrenImpl(); #ifdef DEBUG // Assert that all duplicate children were removed. - vector<CellId> v1, v2; + std::vector<CellId> v1, v2; OutputToVector(v1); RemoveDuplicateChildrenImpl(); OutputToVector(v2); @@ -218,13 +216,13 @@ private: void RemoveFullSquares() { - vector<CellId> cellsToAppend; + std::vector<CellId> cellsToAppend; for (int level = static_cast<int>(m_Covering.size()) - 1; level >= 0; --level) { // a -> b + parents - vector<CellId> const & a = m_Covering[level]; - vector<CellId> b; - vector<CellId> parents; + std::vector<CellId> const & a = m_Covering[level]; + std::vector<CellId> b; + std::vector<CellId> parents; b.reserve(a.size()); for (size_t i = 0; i < a.size(); ++i) { @@ -281,7 +279,7 @@ private: CoverTriangleImpl(info, cell.Child(child)); } - array<vector<CellId>, CellId::DEPTH_LEVELS> m_Covering; // Covering by level. + std::array<std::vector<CellId>, CellId::DEPTH_LEVELS> m_Covering; // Covering by level. size_t m_Size; }; } // namespace covering |