Switch code to use packed vector for segment weights/durations
This commit is contained in:
committed by
Patrick Niklaus
parent
5c61f00ffa
commit
3599d1db8e
@@ -411,6 +411,8 @@ template <typename T, std::size_t Bits, storage::Ownership Ownership> class Pack
|
||||
|
||||
void push_back(const T value)
|
||||
{
|
||||
BOOST_ASSERT_MSG(value <= T{(1ULL << Bits) - 1}, "Value too big for packed storage.");
|
||||
|
||||
auto internal_index = get_internal_index(num_elements);
|
||||
|
||||
while (internal_index.lower_word + 1 >= vec.size())
|
||||
|
||||
@@ -96,8 +96,12 @@ 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 = (1u << 20) - 1;
|
||||
static const SegmentDuration INVALID_SEGMENT_DURATION = (1u << 20) - 1;
|
||||
static const std::size_t SEGMENT_WEIGHT_BITS = 22;
|
||||
static const std::size_t SEGMENT_DURAITON_BITS = 22;
|
||||
static const SegmentWeight INVALID_SEGMENT_WEIGHT = (1u << SEGMENT_WEIGHT_BITS) - 1;
|
||||
static const SegmentDuration INVALID_SEGMENT_DURATION = (1u << SEGMENT_DURAITON_BITS) - 1;
|
||||
static const SegmentWeight MAX_SEGMENT_WEIGHT = INVALID_SEGMENT_WEIGHT - 1;
|
||||
static const SegmentDuration MAX_SEGMENT_DURATION = INVALID_SEGMENT_DURATION - 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();
|
||||
|
||||
Reference in New Issue
Block a user