Add clipping for 20 bits to SegmentWeight/SegmentDuration

This commit is contained in:
Patrick Niklaus
2017-04-11 16:44:34 +00:00
committed by Patrick Niklaus
parent d6c6a262d8
commit 11d8b2ba5a
4 changed files with 53 additions and 18 deletions
@@ -21,8 +21,8 @@ class CompressedEdgeContainer
struct OnewayCompressedEdge
{
public:
NodeID node_id; // refers to an internal node-based-node
SegmentWeight weight; // the weight of the edge leading to this node
NodeID node_id; // refers to an internal node-based-node
SegmentWeight weight; // the weight of the edge leading to this node
SegmentDuration duration; // the duration of the edge leading to this node
};
@@ -64,6 +64,8 @@ class CompressedEdgeContainer
private:
int free_list_maximum = 0;
std::atomic_size_t clipped_weights;
std::atomic_size_t clipped_durations;
void IncreaseFreeList();
std::vector<OnewayEdgeBucket> m_compressed_oneway_geometries;
+4 -4
View File
@@ -59,8 +59,8 @@ using EdgeID = std::uint32_t;
using NameID = std::uint32_t;
using EdgeWeight = std::int32_t;
using EdgeDuration = std::int32_t;
using SegmentWeight = std::uint16_t;
using SegmentDuration = std::uint16_t;
using SegmentWeight = std::int32_t;
using SegmentDuration = std::int32_t;
using TurnPenalty = std::int16_t; // turn penalty in 100ms units
static const std::size_t INVALID_INDEX = std::numeric_limits<std::size_t>::max();
@@ -88,8 +88,8 @@ static const EdgeID SPECIAL_EDGEID = std::numeric_limits<EdgeID>::max();
static const NameID INVALID_NAMEID = std::numeric_limits<NameID>::max();
static const NameID EMPTY_NAMEID = 0;
static const unsigned INVALID_COMPONENTID = 0;
static const SegmentWeight INVALID_SEGMENT_WEIGHT = std::numeric_limits<SegmentWeight>::max();
static const SegmentDuration INVALID_SEGMENT_DURATION = std::numeric_limits<SegmentDuration>::max();
static const SegmentWeight INVALID_SEGMENT_WEIGHT = (1u << 20) - 1;
static const SegmentDuration INVALID_SEGMENT_DURATION = (1u << 20) - 1;
static const EdgeWeight INVALID_EDGE_WEIGHT = std::numeric_limits<EdgeWeight>::max();
static const EdgeDuration MAXIMAL_EDGE_DURATION = std::numeric_limits<EdgeDuration>::max();
static const TurnPenalty INVALID_TURN_PENALTY = std::numeric_limits<TurnPenalty>::max();