Use 16bit for SegmentWeight and SegmentDuration

This commit is contained in:
Patrick Niklaus
2017-04-10 19:09:14 +00:00
committed by Patrick Niklaus
parent 5c4f96e4bc
commit d6c6a262d8
9 changed files with 74 additions and 62 deletions
@@ -22,8 +22,8 @@ class CompressedEdgeContainer
{
public:
NodeID node_id; // refers to an internal node-based-node
EdgeWeight weight; // the weight of the edge leading to this node
EdgeWeight duration; // the duration of the edge leading to this node
SegmentWeight weight; // the weight of the edge leading to this node
SegmentDuration duration; // the duration of the edge leading to this node
};
using OnewayEdgeBucket = std::vector<OnewayCompressedEdge>;
@@ -35,13 +35,13 @@ class CompressedEdgeContainer
const NodeID target_node,
const EdgeWeight weight1,
const EdgeWeight weight2,
const EdgeWeight duration1,
const EdgeWeight duration2);
const EdgeDuration duration1,
const EdgeDuration duration2);
void AddUncompressedEdge(const EdgeID edge_id,
const NodeID target_node,
const EdgeWeight weight,
const EdgeWeight duration);
const SegmentWeight weight,
const SegmentWeight duration);
void InitializeBothwayVector();
unsigned ZipEdges(const unsigned f_edge_pos, const unsigned r_edge_pos);
+5 -5
View File
@@ -19,7 +19,7 @@ struct NodeBasedEdge
NodeID target,
NodeID name_id,
EdgeWeight weight,
EdgeWeight duration,
EdgeDuration duration,
bool forward,
bool backward,
bool roundabout,
@@ -37,7 +37,7 @@ struct NodeBasedEdge
NodeID target; // 32 4
NodeID name_id; // 32 4
EdgeWeight weight; // 32 4
EdgeWeight duration; // 32 4
EdgeDuration duration; // 32 4
std::uint8_t forward : 1; // 1
std::uint8_t backward : 1; // 1
std::uint8_t roundabout : 1; // 1
@@ -56,7 +56,7 @@ struct NodeBasedEdgeWithOSM : NodeBasedEdge
OSMNodeID target,
NodeID name_id,
EdgeWeight weight,
EdgeWeight duration,
EdgeDuration duration,
bool forward,
bool backward,
bool roundabout,
@@ -86,7 +86,7 @@ inline NodeBasedEdge::NodeBasedEdge(NodeID source,
NodeID target,
NodeID name_id,
EdgeWeight weight,
EdgeWeight duration,
EdgeDuration duration,
bool forward,
bool backward,
bool roundabout,
@@ -125,7 +125,7 @@ inline NodeBasedEdgeWithOSM::NodeBasedEdgeWithOSM(OSMNodeID source,
OSMNodeID target,
NodeID name_id,
EdgeWeight weight,
EdgeWeight duration,
EdgeDuration duration,
bool forward,
bool backward,
bool roundabout,
+8 -8
View File
@@ -55,10 +55,10 @@ template <storage::Ownership Ownership> class SegmentDataContainerImpl
SegmentDataContainerImpl(Vector<std::uint32_t> index_,
Vector<NodeID> nodes_,
Vector<EdgeWeight> fwd_weights_,
Vector<EdgeWeight> rev_weights_,
Vector<EdgeWeight> fwd_durations_,
Vector<EdgeWeight> rev_durations_,
Vector<SegmentWeight> fwd_weights_,
Vector<SegmentWeight> rev_weights_,
Vector<SegmentDuration> fwd_durations_,
Vector<SegmentDuration> rev_durations_,
Vector<DatasourceID> datasources_)
: index(std::move(index_)), nodes(std::move(nodes_)), fwd_weights(std::move(fwd_weights_)),
rev_weights(std::move(rev_weights_)), fwd_durations(std::move(fwd_durations_)),
@@ -201,10 +201,10 @@ template <storage::Ownership Ownership> class SegmentDataContainerImpl
private:
Vector<std::uint32_t> index;
Vector<NodeID> nodes;
Vector<EdgeWeight> fwd_weights;
Vector<EdgeWeight> rev_weights;
Vector<EdgeWeight> fwd_durations;
Vector<EdgeWeight> rev_durations;
Vector<SegmentWeight> fwd_weights;
Vector<SegmentWeight> rev_weights;
Vector<SegmentDuration> fwd_durations;
Vector<SegmentDuration> rev_durations;
Vector<DatasourceID> datasources;
};
}