Apply clang-format

This commit is contained in:
Patrick Niklaus
2017-03-09 22:45:27 +00:00
committed by Patrick Niklaus
parent 94e2a8598d
commit fb552fd751
11 changed files with 64 additions and 65 deletions
+14 -12
View File
@@ -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};
}
+2 -3
View File
@@ -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
+1 -2
View File
@@ -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>;
}
}
+6 -6
View File
@@ -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;
};
}