Apply clang-format
This commit is contained in:
committed by
Patrick Niklaus
parent
94e2a8598d
commit
fb552fd751
@@ -74,7 +74,6 @@ struct ContractorConfig
|
||||
//(e.g. 0.8 contracts 80 percent of the hierarchy, leaving a core of 20%)
|
||||
double core_factor;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
#include "engine/algorithm.hpp"
|
||||
#include "engine/geospatial_query.hpp"
|
||||
|
||||
#include "extractor/segment_data_container.hpp"
|
||||
#include "extractor/guidance/turn_instruction.hpp"
|
||||
#include "extractor/guidance/turn_lane_types.hpp"
|
||||
#include "extractor/profile_properties.hpp"
|
||||
#include "extractor/segment_data_container.hpp"
|
||||
|
||||
#include "partition/cell_storage.hpp"
|
||||
#include "partition/multi_level_partition.hpp"
|
||||
@@ -574,41 +574,41 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
||||
{
|
||||
|
||||
auto range = segment_data.GetForwardGeometry(id);
|
||||
return std::vector<NodeID> {range.begin(), range.end()};
|
||||
return std::vector<NodeID>{range.begin(), range.end()};
|
||||
}
|
||||
|
||||
virtual std::vector<NodeID> GetUncompressedReverseGeometry(const EdgeID id) const override final
|
||||
{
|
||||
auto range = segment_data.GetReverseGeometry(id);
|
||||
return std::vector<NodeID> {range.begin(), range.end()};
|
||||
return std::vector<NodeID>{range.begin(), range.end()};
|
||||
}
|
||||
|
||||
virtual std::vector<EdgeWeight>
|
||||
GetUncompressedForwardDurations(const EdgeID id) const override final
|
||||
{
|
||||
auto range = segment_data.GetForwardDurations(id);
|
||||
return std::vector<EdgeWeight> {range.begin(), range.end()};
|
||||
return std::vector<EdgeWeight>{range.begin(), range.end()};
|
||||
}
|
||||
|
||||
virtual std::vector<EdgeWeight>
|
||||
GetUncompressedReverseDurations(const EdgeID id) const override final
|
||||
{
|
||||
auto range = segment_data.GetReverseDurations(id);
|
||||
return std::vector<EdgeWeight> {range.begin(), range.end()};
|
||||
return std::vector<EdgeWeight>{range.begin(), range.end()};
|
||||
}
|
||||
|
||||
virtual std::vector<EdgeWeight>
|
||||
GetUncompressedForwardWeights(const EdgeID id) const override final
|
||||
{
|
||||
auto range = segment_data.GetForwardWeights(id);
|
||||
return std::vector<EdgeWeight> {range.begin(), range.end()};
|
||||
return std::vector<EdgeWeight>{range.begin(), range.end()};
|
||||
}
|
||||
|
||||
virtual std::vector<EdgeWeight>
|
||||
GetUncompressedReverseWeights(const EdgeID id) const override final
|
||||
{
|
||||
auto range = segment_data.GetReverseWeights(id);
|
||||
return std::vector<EdgeWeight> {range.begin(), range.end()};
|
||||
return std::vector<EdgeWeight>{range.begin(), range.end()};
|
||||
}
|
||||
|
||||
virtual GeometryID GetGeometryIndexForEdgeID(const EdgeID id) const override final
|
||||
|
||||
@@ -12,8 +12,7 @@ namespace extractor
|
||||
namespace io
|
||||
{
|
||||
|
||||
template <>
|
||||
void read(const boost::filesystem::path &path, SegmentDataContainer &segment_data)
|
||||
template <> void read(const boost::filesystem::path &path, SegmentDataContainer &segment_data)
|
||||
{
|
||||
const auto fingerprint = storage::io::FileReader::HasNoFingerprint;
|
||||
storage::io::FileReader reader{path, fingerprint};
|
||||
@@ -36,7 +35,8 @@ void read(const boost::filesystem::path &path, SegmentDataContainer &segment_dat
|
||||
reader.ReadInto(segment_data.rev_durations.data(), segment_data.rev_durations.size());
|
||||
}
|
||||
|
||||
template <> void write(const boost::filesystem::path &path, const SegmentDataContainer &segment_data)
|
||||
template <>
|
||||
void write(const boost::filesystem::path &path, const SegmentDataContainer &segment_data)
|
||||
{
|
||||
const auto fingerprint = storage::io::FileWriter::HasNoFingerprint;
|
||||
storage::io::FileWriter writer{path, fingerprint};
|
||||
@@ -54,7 +54,6 @@ template <> void write(const boost::filesystem::path &path, const SegmentDataCon
|
||||
writer.WriteFrom(segment_data.fwd_durations.data(), segment_data.fwd_durations.size());
|
||||
writer.WriteFrom(segment_data.rev_durations.data(), segment_data.rev_durations.size());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
#include "util/shared_memory_vector_wrapper.hpp"
|
||||
#include "util/typedefs.hpp"
|
||||
|
||||
#include <boost/filesystem/path.hpp>
|
||||
#include <boost/range/adaptor/reversed.hpp>
|
||||
#include <boost/range/iterator_range.hpp>
|
||||
#include <boost/filesystem/path.hpp>
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
@@ -28,9 +28,11 @@ template <bool UseShareMemory> class SegmentDataContainerImpl;
|
||||
namespace io
|
||||
{
|
||||
template <bool UseShareMemory>
|
||||
inline void read(const boost::filesystem::path &path, detail::SegmentDataContainerImpl<UseShareMemory> &segment_data);
|
||||
inline void read(const boost::filesystem::path &path,
|
||||
detail::SegmentDataContainerImpl<UseShareMemory> &segment_data);
|
||||
template <bool UseShareMemory>
|
||||
inline void write(const boost::filesystem::path &path, const detail::SegmentDataContainerImpl<UseShareMemory> &segment_data);
|
||||
inline void write(const boost::filesystem::path &path,
|
||||
const detail::SegmentDataContainerImpl<UseShareMemory> &segment_data);
|
||||
}
|
||||
|
||||
namespace detail
|
||||
@@ -61,19 +63,19 @@ template <bool UseShareMemory> class SegmentDataContainerImpl
|
||||
}
|
||||
|
||||
// TODO these random access functions can be removed after we implemented #3737
|
||||
auto& ForwardDuration(const DirectionalGeometryID id, const SegmentOffset offset)
|
||||
auto &ForwardDuration(const DirectionalGeometryID id, const SegmentOffset offset)
|
||||
{
|
||||
return fwd_durations[index[id] + 1 + offset];
|
||||
}
|
||||
auto& ReverseDuration(const DirectionalGeometryID id, const SegmentOffset offset)
|
||||
auto &ReverseDuration(const DirectionalGeometryID id, const SegmentOffset offset)
|
||||
{
|
||||
return rev_durations[index[id] + offset];
|
||||
}
|
||||
auto& ForwardWeight(const DirectionalGeometryID id, const SegmentOffset offset)
|
||||
auto &ForwardWeight(const DirectionalGeometryID id, const SegmentOffset offset)
|
||||
{
|
||||
return fwd_weights[index[id] + 1 + offset];
|
||||
}
|
||||
auto& ReverseWeight(const DirectionalGeometryID id, const SegmentOffset offset)
|
||||
auto &ReverseWeight(const DirectionalGeometryID id, const SegmentOffset offset)
|
||||
{
|
||||
return rev_weights[index[id] + offset];
|
||||
}
|
||||
@@ -129,15 +131,14 @@ template <bool UseShareMemory> class SegmentDataContainerImpl
|
||||
return boost::adaptors::reverse(boost::make_iterator_range(begin, end));
|
||||
}
|
||||
|
||||
auto GetNumberOfSegments() const
|
||||
{
|
||||
return fwd_weights.size();
|
||||
}
|
||||
auto GetNumberOfSegments() const { return fwd_weights.size(); }
|
||||
|
||||
friend void io::read<UseShareMemory>(const boost::filesystem::path &path,
|
||||
detail::SegmentDataContainerImpl<UseShareMemory> &segment_data);
|
||||
friend void io::write<UseShareMemory>(const boost::filesystem::path &path,
|
||||
const detail::SegmentDataContainerImpl<UseShareMemory> &segment_data);
|
||||
friend void
|
||||
io::read<UseShareMemory>(const boost::filesystem::path &path,
|
||||
detail::SegmentDataContainerImpl<UseShareMemory> &segment_data);
|
||||
friend void
|
||||
io::write<UseShareMemory>(const boost::filesystem::path &path,
|
||||
const detail::SegmentDataContainerImpl<UseShareMemory> &segment_data);
|
||||
|
||||
private:
|
||||
Vector<std::uint32_t> index;
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
#include "updater/source.hpp"
|
||||
|
||||
#include "util/log.hpp"
|
||||
#include "util/exception.hpp"
|
||||
#include "util/exception_utils.hpp"
|
||||
#include "util/log.hpp"
|
||||
|
||||
#include <tbb/parallel_for.h>
|
||||
#include <tbb/spin_mutex.h>
|
||||
@@ -51,16 +51,18 @@ template <typename Key, typename Value> struct CSVFilesParser
|
||||
{
|
||||
tbb::spin_mutex mutex;
|
||||
std::vector<std::pair<Key, Value>> lookup;
|
||||
tbb::parallel_for(std::size_t{0}, csv_filenames.size(), [&](const std::size_t idx) {
|
||||
auto local = ParseCSVFile(csv_filenames[idx], start_index + idx);
|
||||
tbb::parallel_for(std::size_t{0},
|
||||
csv_filenames.size(),
|
||||
[&](const std::size_t idx) {
|
||||
auto local = ParseCSVFile(csv_filenames[idx], start_index + idx);
|
||||
|
||||
{ // Merge local CSV results into a flat global vector
|
||||
tbb::spin_mutex::scoped_lock _{mutex};
|
||||
lookup.insert(end(lookup),
|
||||
std::make_move_iterator(begin(local)),
|
||||
std::make_move_iterator(end(local)));
|
||||
}
|
||||
});
|
||||
{ // Merge local CSV results into a flat global vector
|
||||
tbb::spin_mutex::scoped_lock _{mutex};
|
||||
lookup.insert(end(lookup),
|
||||
std::make_move_iterator(begin(local)),
|
||||
std::make_move_iterator(end(local)));
|
||||
}
|
||||
});
|
||||
|
||||
// With flattened map-ish view of all the files, make a stable sort on key and source
|
||||
// and unique them on key to keep only the value with the largest file index
|
||||
@@ -78,8 +80,8 @@ template <typename Key, typename Value> struct CSVFilesParser
|
||||
});
|
||||
lookup.erase(it, end(lookup));
|
||||
|
||||
util::Log() << "In total loaded " << csv_filenames.size()
|
||||
<< " file(s) with a total of " << lookup.size() << " unique values";
|
||||
util::Log() << "In total loaded " << csv_filenames.size() << " file(s) with a total of "
|
||||
<< lookup.size() << " unique values";
|
||||
|
||||
return LookupTable<Key, Value>{lookup};
|
||||
}
|
||||
|
||||
@@ -9,11 +9,10 @@ namespace updater
|
||||
{
|
||||
namespace csv
|
||||
{
|
||||
SegmentLookupTable readSegmentValues(const std::vector<std::string> &paths);
|
||||
TurnLookupTable readTurnValues(const std::vector<std::string> &paths);
|
||||
SegmentLookupTable readSegmentValues(const std::vector<std::string> &paths);
|
||||
TurnLookupTable readTurnValues(const std::vector<std::string> &paths);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -63,7 +63,7 @@ struct Turn final
|
||||
: from(from), via(via), to(to)
|
||||
{
|
||||
}
|
||||
template<typename Other>
|
||||
template <typename Other>
|
||||
Turn(const Other &turn)
|
||||
: from(static_cast<std::uint64_t>(turn.from_id)),
|
||||
via(static_cast<std::uint64_t>(turn.via_id)), to(static_cast<std::uint64_t>(turn.to_id))
|
||||
@@ -89,7 +89,6 @@ struct PenaltySource final
|
||||
|
||||
using SegmentLookupTable = LookupTable<Segment, SpeedSource>;
|
||||
using TurnLookupTable = LookupTable<Turn, PenaltySource>;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,14 +13,14 @@ namespace updater
|
||||
{
|
||||
class Updater
|
||||
{
|
||||
public:
|
||||
Updater(UpdaterConfig config_) :config(std::move(config_)) {}
|
||||
public:
|
||||
Updater(UpdaterConfig config_) : config(std::move(config_)) {}
|
||||
|
||||
EdgeID LoadAndUpdateEdgeExpandedGraph(
|
||||
std::vector<extractor::EdgeBasedEdge> &edge_based_edge_list,
|
||||
std::vector<EdgeWeight> &node_weights) const;
|
||||
EdgeID
|
||||
LoadAndUpdateEdgeExpandedGraph(std::vector<extractor::EdgeBasedEdge> &edge_based_edge_list,
|
||||
std::vector<EdgeWeight> &node_weights) const;
|
||||
|
||||
private:
|
||||
private:
|
||||
UpdaterConfig config;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user