mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-26 15:53:36 +00:00
[core] Switch to ankerl::unordered_dense
Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
This commit is contained in:
@@ -49,11 +49,13 @@ optional<Score> GetFrcScore(Graph::Edge const & e, FunctionalRoadClass functiona
|
||||
switch (functionalRoadClass)
|
||||
{
|
||||
case FunctionalRoadClass::FRC0:
|
||||
return hwClass == HighwayClass::Motorway || hwClass == HighwayClass::Trunk ? optional<Score>(kMaxScoreForFrc) : nullopt;
|
||||
return hwClass == HighwayClass::Motorway || hwClass == HighwayClass::Trunk ? optional<Score>(kMaxScoreForFrc)
|
||||
: nullopt;
|
||||
|
||||
case FunctionalRoadClass::FRC1:
|
||||
return (hwClass == HighwayClass::Motorway || hwClass == HighwayClass::Trunk || hwClass == HighwayClass::Primary) ? optional<Score>(kMaxScoreForFrc)
|
||||
: nullopt;
|
||||
return (hwClass == HighwayClass::Motorway || hwClass == HighwayClass::Trunk || hwClass == HighwayClass::Primary)
|
||||
? optional<Score>(kMaxScoreForFrc)
|
||||
: nullopt;
|
||||
|
||||
case FunctionalRoadClass::FRC2:
|
||||
case FunctionalRoadClass::FRC3:
|
||||
|
||||
@@ -9,9 +9,10 @@
|
||||
#include <cstdint>
|
||||
#include <functional>
|
||||
#include <string>
|
||||
#include <unordered_set>
|
||||
#include <vector>
|
||||
|
||||
#include "3party/ankerl/unordered_dense.h"
|
||||
|
||||
namespace openlr
|
||||
{
|
||||
struct LinearSegment;
|
||||
@@ -35,7 +36,7 @@ public:
|
||||
bool Matches(LinearSegment const & segment) const;
|
||||
|
||||
private:
|
||||
std::unordered_set<uint32_t> m_ids;
|
||||
ankerl::unordered_dense::set<uint32_t> m_ids;
|
||||
bool m_idsSet;
|
||||
bool const m_multipointsOnly;
|
||||
};
|
||||
|
||||
@@ -25,11 +25,12 @@
|
||||
#include <cstring>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include <boost/regex.hpp>
|
||||
|
||||
#include "3party/ankerl/unordered_dense.h"
|
||||
|
||||
#include <gflags/gflags.h>
|
||||
#include <pugixml.hpp>
|
||||
|
||||
@@ -191,7 +192,7 @@ std::vector<LinearSegment> LoadSegments(pugi::xml_document & document)
|
||||
void WriteAssessmentFile(std::string const fileName, pugi::xml_document const & doc,
|
||||
std::vector<DecodedPath> const & paths)
|
||||
{
|
||||
std::unordered_map<uint32_t, pugi::xml_node> xmlSegments;
|
||||
ankerl::unordered_dense::map<uint32_t, pugi::xml_node> xmlSegments;
|
||||
for (auto const & xpathNode : doc.select_nodes("//reportSegments"))
|
||||
{
|
||||
auto const xmlSegment = xpathNode.node();
|
||||
|
||||
@@ -138,7 +138,7 @@ void BordersData::Init(std::string const & bordersDir)
|
||||
|
||||
// key - coordinates
|
||||
// value - {border idx, point idx}
|
||||
std::unordered_map<int64_t, std::vector<std::pair<size_t, size_t>>> index;
|
||||
ankerl::unordered_dense::map<int64_t, std::vector<std::pair<size_t, size_t>>> index;
|
||||
|
||||
std::vector<std::string> files;
|
||||
Platform::GetFilesByExt(bordersDir, kBorderExtension, files);
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <unordered_set>
|
||||
|
||||
#include "3party/ankerl/unordered_dense.h"
|
||||
|
||||
namespace topography_generator
|
||||
{
|
||||
@@ -66,7 +67,7 @@ struct TileCoordHash
|
||||
struct CountryIsolinesParams
|
||||
{
|
||||
std::string m_profileName;
|
||||
std::unordered_set<TileCoord, TileCoordHash> m_tileCoordsSubset;
|
||||
ankerl::unordered_dense::set<TileCoord, TileCoordHash> m_tileCoordsSubset;
|
||||
bool m_tilesAreBanned;
|
||||
|
||||
bool NeedSkipTile(int lat, int lon) const
|
||||
|
||||
@@ -8,9 +8,10 @@
|
||||
#include <algorithm>
|
||||
#include <deque>
|
||||
#include <list>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include "3party/ankerl/unordered_dense.h"
|
||||
|
||||
namespace topography_generator
|
||||
{
|
||||
class ContoursBuilder
|
||||
@@ -24,7 +25,7 @@ public:
|
||||
|
||||
template <typename ValueType>
|
||||
void GetContours(ValueType minValue, ValueType valueStep,
|
||||
std::unordered_map<ValueType, std::vector<Contour>> & contours)
|
||||
ankerl::unordered_dense::map<ValueType, std::vector<Contour>> & contours)
|
||||
{
|
||||
contours.clear();
|
||||
for (size_t i = 0; i < m_finalizedContours.size(); ++i)
|
||||
|
||||
@@ -7,9 +7,10 @@
|
||||
|
||||
#include "indexer/scales.hpp"
|
||||
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include "3party/ankerl/unordered_dense.h"
|
||||
|
||||
namespace topography_generator
|
||||
{
|
||||
using Contour = std::vector<m2::PointD>;
|
||||
@@ -23,7 +24,7 @@ struct Contours
|
||||
Latest = V0
|
||||
};
|
||||
|
||||
std::unordered_map<ValueType, std::vector<Contour>> m_contours;
|
||||
ankerl::unordered_dense::map<ValueType, std::vector<Contour>> m_contours;
|
||||
ValueType m_minValue = 0;
|
||||
ValueType m_maxValue = 0;
|
||||
ValueType m_valueStep = 0;
|
||||
|
||||
@@ -17,7 +17,8 @@
|
||||
#include <cstdint>
|
||||
#include <fstream>
|
||||
#include <regex>
|
||||
#include <unordered_set>
|
||||
|
||||
#include "3party/ankerl/unordered_dense.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace track_analyzing;
|
||||
@@ -84,7 +85,7 @@ private:
|
||||
}
|
||||
|
||||
shared_ptr<m4::Tree<routing::NumMwmId>> m_mwmTree;
|
||||
unordered_map<routing::NumMwmId, vector<m2::RegionD>> m_borders;
|
||||
ankerl::unordered_dense::map<routing::NumMwmId, vector<m2::RegionD>> m_borders;
|
||||
};
|
||||
} // namespace
|
||||
|
||||
@@ -116,7 +117,7 @@ void LogParser::ParseUserTracks(string const & logFile, UserToTrack & userToTrac
|
||||
MYTHROW(MessageException, ("Can't open file", logFile, "to parse tracks"));
|
||||
|
||||
std::regex const base_regex(R"(.*(DataV0|CurrentData)\s+aloha_id\s*:\s*(\S+)\s+.*\|(\w+)\|)");
|
||||
std::unordered_set<string> usersWithOldVersion;
|
||||
ankerl::unordered_dense::set<string> usersWithOldVersion;
|
||||
uint64_t linesCount = 0;
|
||||
size_t pointsCount = 0;
|
||||
|
||||
|
||||
@@ -7,15 +7,16 @@
|
||||
#include "coding/traffic.hpp"
|
||||
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include "3party/ankerl/unordered_dense.h"
|
||||
|
||||
namespace track_analyzing
|
||||
{
|
||||
using DataPoint = coding::TrafficGPSEncoder::DataPoint;
|
||||
using Track = std::vector<DataPoint>;
|
||||
using UserToTrack = std::unordered_map<std::string, Track>;
|
||||
using MwmToTracks = std::unordered_map<routing::NumMwmId, UserToTrack>;
|
||||
using UserToTrack = ankerl::unordered_dense::map<std::string, Track>;
|
||||
using MwmToTracks = ankerl::unordered_dense::map<routing::NumMwmId, UserToTrack>;
|
||||
|
||||
class MatchedTrackPoint final
|
||||
{
|
||||
@@ -34,8 +35,8 @@ private:
|
||||
};
|
||||
|
||||
using MatchedTrack = std::vector<MatchedTrackPoint>;
|
||||
using UserToMatchedTracks = std::unordered_map<std::string, std::vector<MatchedTrack>>;
|
||||
using MwmToMatchedTracks = std::unordered_map<routing::NumMwmId, UserToMatchedTracks>;
|
||||
using UserToMatchedTracks = ankerl::unordered_dense::map<std::string, std::vector<MatchedTrack>>;
|
||||
using MwmToMatchedTracks = ankerl::unordered_dense::map<routing::NumMwmId, UserToMatchedTracks>;
|
||||
|
||||
class TrackFilter final
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user