Format with clang-format 3.8
This commit is contained in:
@@ -8,8 +8,8 @@
|
||||
#ifndef NDEBUG
|
||||
#include <bitset>
|
||||
#endif
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
#include <limits>
|
||||
|
||||
namespace osrm
|
||||
@@ -17,7 +17,6 @@ namespace osrm
|
||||
namespace util
|
||||
{
|
||||
|
||||
|
||||
bool Coordinate::IsValid() const
|
||||
{
|
||||
return !(lat > FixedLatitude(90 * COORDINATE_PRECISION) ||
|
||||
@@ -26,16 +25,12 @@ bool Coordinate::IsValid() const
|
||||
lon < FixedLongitude(-180 * COORDINATE_PRECISION));
|
||||
}
|
||||
|
||||
|
||||
bool FloatCoordinate::IsValid() const
|
||||
{
|
||||
return !(lat > FloatLatitude(90) ||
|
||||
lat < FloatLatitude(-90) ||
|
||||
lon > FloatLongitude(180) ||
|
||||
return !(lat > FloatLatitude(90) || lat < FloatLatitude(-90) || lon > FloatLongitude(180) ||
|
||||
lon < FloatLongitude(-180));
|
||||
}
|
||||
|
||||
|
||||
bool operator==(const Coordinate lhs, const Coordinate rhs)
|
||||
{
|
||||
return lhs.lat == rhs.lat && lhs.lon == rhs.lon;
|
||||
@@ -56,8 +51,7 @@ std::ostream &operator<<(std::ostream &out, const Coordinate coordinate)
|
||||
}
|
||||
std::ostream &operator<<(std::ostream &out, const FloatCoordinate coordinate)
|
||||
{
|
||||
out << std::setprecision(12) << "(lon:" << coordinate.lon
|
||||
<< ", lat:" << coordinate.lat << ")";
|
||||
out << std::setprecision(12) << "(lon:" << coordinate.lon << ", lat:" << coordinate.lat << ")";
|
||||
return out;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +77,6 @@ double greatCircleDistance(const Coordinate coordinate_1, const Coordinate coord
|
||||
return std::hypot(x_value, y_value) * detail::EARTH_RADIUS;
|
||||
}
|
||||
|
||||
|
||||
double perpendicularDistance(const Coordinate segment_source,
|
||||
const Coordinate segment_target,
|
||||
const Coordinate query_location,
|
||||
@@ -89,9 +88,10 @@ double perpendicularDistance(const Coordinate segment_source,
|
||||
BOOST_ASSERT(query_location.IsValid());
|
||||
|
||||
FloatCoordinate projected_nearest;
|
||||
std::tie(ratio, projected_nearest) = projectPointOnSegment(
|
||||
web_mercator::fromWGS84(segment_source), web_mercator::fromWGS84(segment_target),
|
||||
web_mercator::fromWGS84(query_location));
|
||||
std::tie(ratio, projected_nearest) =
|
||||
projectPointOnSegment(web_mercator::fromWGS84(segment_source),
|
||||
web_mercator::fromWGS84(segment_target),
|
||||
web_mercator::fromWGS84(query_location));
|
||||
nearest_location = web_mercator::toWGS84(projected_nearest);
|
||||
|
||||
const double approximate_distance = greatCircleDistance(query_location, nearest_location);
|
||||
@@ -106,8 +106,8 @@ double perpendicularDistance(const Coordinate source_coordinate,
|
||||
double ratio;
|
||||
Coordinate nearest_location;
|
||||
|
||||
return perpendicularDistance(source_coordinate, target_coordinate, query_location,
|
||||
nearest_location, ratio);
|
||||
return perpendicularDistance(
|
||||
source_coordinate, target_coordinate, query_location, nearest_location, ratio);
|
||||
}
|
||||
|
||||
Coordinate centroid(const Coordinate lhs, const Coordinate rhs)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "extractor/guidance/discrete_angle.hpp"
|
||||
#include "util/guidance/bearing_class.hpp"
|
||||
#include "extractor/guidance/discrete_angle.hpp"
|
||||
#include "util/guidance/toolkit.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
@@ -44,10 +44,7 @@ bool BearingClass::operator<(const BearingClass &other) const
|
||||
return false;
|
||||
}
|
||||
|
||||
void BearingClass::add(const DiscreteBearing bearing)
|
||||
{
|
||||
available_bearings.push_back(bearing);
|
||||
}
|
||||
void BearingClass::add(const DiscreteBearing bearing) { available_bearings.push_back(bearing); }
|
||||
|
||||
const std::vector<DiscreteBearing> &BearingClass::getAvailableBearings() const
|
||||
{
|
||||
@@ -69,7 +66,8 @@ std::size_t BearingClass::findMatchingBearing(const double bearing) const
|
||||
// the small size of the intersections allows a linear compare
|
||||
auto discrete_bearing = static_cast<DiscreteBearing>(bearing);
|
||||
auto max_element =
|
||||
std::max_element(available_bearings.begin(), available_bearings.end(),
|
||||
std::max_element(available_bearings.begin(),
|
||||
available_bearings.end(),
|
||||
[&](const DiscreteBearing first, const DiscreteBearing second) {
|
||||
return angularDeviation(first, discrete_bearing) >
|
||||
angularDeviation(second, discrete_bearing);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "util/exception.hpp"
|
||||
#include "util/name_table.hpp"
|
||||
#include "util/exception.hpp"
|
||||
#include "util/simple_logger.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
@@ -57,7 +57,8 @@ std::string NameTable::GetNameForID(const unsigned name_id) const
|
||||
{
|
||||
result.resize(range.back() - range.front() + 1);
|
||||
std::copy(m_names_char_list.begin() + range.front(),
|
||||
m_names_char_list.begin() + range.back() + 1, result.begin());
|
||||
m_names_char_list.begin() + range.back() + 1,
|
||||
result.begin());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user