Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Byko-Ianko <v.bykoianko@corp.mail.ru>2018-03-27 11:44:49 +0300
committerTatiana Yan <tatiana.kondakova@gmail.com>2018-03-27 12:53:15 +0300
commit0df50f44ec86c420ef8b2d0ce0b4725818a95b92 (patch)
tree146495bd650784a479facdd5684228c42e15495b /routing
parent48cdf4405762fd43a7c478025fd5e6840830abea (diff)
Using double for m_transitTime.
Diffstat (limited to 'routing')
-rw-r--r--routing/route_weight.hpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/routing/route_weight.hpp b/routing/route_weight.hpp
index b5a83ac1d4..aedb731dba 100644
--- a/routing/route_weight.hpp
+++ b/routing/route_weight.hpp
@@ -22,7 +22,7 @@ public:
: m_weight(weight)
, m_numPassThroughChanges(static_cast<int8_t>(numPassThroughChanges))
, m_numAccessChanges(static_cast<int8_t>(numAccessChanges))
- , m_transitTime(static_cast<float>(transitTime))
+ , m_transitTime(transitTime)
{
}
@@ -32,7 +32,7 @@ public:
double GetWeight() const { return m_weight; }
int8_t GetNumPassThroughChanges() const { return m_numPassThroughChanges; }
int8_t GetNumAccessChanges() const { return m_numAccessChanges; }
- double GetTransitTime() const { return static_cast<double>(m_transitTime); }
+ double GetTransitTime() const { return m_transitTime; }
bool operator<(RouteWeight const & rhs) const
{
@@ -48,7 +48,7 @@ public:
return m_numAccessChanges < rhs.m_numAccessChanges;
if (m_weight != rhs.m_weight)
return m_weight < rhs.m_weight;
- // Preffer bigger transit time if total weights are same.
+ // Prefer bigger transit time if total weights are same.
return m_transitTime > rhs.m_transitTime;
}
@@ -80,7 +80,7 @@ public:
return m_numPassThroughChanges == rhs.m_numPassThroughChanges &&
m_numAccessChanges == rhs.m_numAccessChanges &&
my::AlmostEqualAbs(m_weight, rhs.m_weight, epsilon) &&
- my::AlmostEqualAbs(m_transitTime, rhs.m_transitTime, static_cast<float>(epsilon));
+ my::AlmostEqualAbs(m_transitTime, rhs.m_transitTime, epsilon);
}
private:
@@ -91,7 +91,7 @@ private:
// Number of access=yes/access={private,destination} zone changes.
int8_t m_numAccessChanges = 0;
// Transit time. It's already included in |m_weight| (m_transitTime <= m_weight).
- float m_transitTime = 0.0F;
+ double m_transitTime = 0.0F;
};
std::ostream & operator<<(std::ostream & os, RouteWeight const & routeWeight);
@@ -101,7 +101,7 @@ RouteWeight operator*(double lhs, RouteWeight const & rhs);
template <>
constexpr RouteWeight GetAStarWeightMax<RouteWeight>()
{
- return RouteWeight(std::numeric_limits<float>::max() /* weight */,
+ return RouteWeight(std::numeric_limits<double>::max() /* weight */,
std::numeric_limits<int8_t>::max() /* numPassThroughChanges */,
std::numeric_limits<int8_t>::max() /* numAccessChanges */,
0.0 /* transitTime */); // operator< prefers bigger transit time