This commit is contained in:
GitHub Merge Button 2011-12-10 03:39:45 -08:00
commit aa4eb3504a
5 changed files with 9 additions and 9 deletions

View File

@ -264,8 +264,8 @@ private:
data->_heapForward->Insert( source, 0, source );
data->_heapBackward->Insert( target, 0, target );
int targetDistance = std::numeric_limits< int >::max();
NodeID middle = std::numeric_limits<NodeID>::max();
int targetDistance = (std::numeric_limits< int >::max)();
NodeID middle = (std::numeric_limits<NodeID>::max)();
while ( data->_heapForward->Size() + data->_heapBackward->Size() > 0 ) {
if ( data->_heapForward->Size() > 0 ) {

View File

@ -157,7 +157,7 @@ public:
forwardEdge.data.shortcut = backwardEdge.data.shortcut = false;
forwardEdge.data.via = backwardEdge.data.via = via;
forwardEdge.data.originalEdges = backwardEdge.data.originalEdges = 1;
forwardEdge.data.distance = backwardEdge.data.distance = std::numeric_limits< int >::max();
forwardEdge.data.distance = backwardEdge.data.distance = (std::numeric_limits< int >::max)();
//remove parallel edges
while ( i < edges.size() && edges[i].source == source && edges[i].target == target ) {
if ( edges[i].data.forward )
@ -397,7 +397,7 @@ private:
continue;
const NodeID target = _graph->GetTarget( outEdge );
const int pathDistance = inData.distance + outData.distance;
maxDistance = std::max( maxDistance, pathDistance );
maxDistance = (std::max)( maxDistance, pathDistance );
if ( !heap.WasInserted( target ) ) {
heap.Insert( target, pathDistance, _HeapData( true ) );
numTargets++;

View File

@ -141,7 +141,7 @@ public:
void Clear() {
heap.resize( 1 );
insertedNodes.clear();
heap[0].weight = std::numeric_limits< Weight >::min();
heap[0].weight = (std::numeric_limits< Weight >::min)();
nodeIndex.Clear();
}

View File

@ -123,7 +123,7 @@ public:
if(0 < settings[highway]) {
if(0 < maxspeed)
w.speed = std::min(maxspeed, settings[highway]);
w.speed = (std::min)(maxspeed, settings[highway]);
else
w.speed = settings[highway];
} else {

View File

@ -271,7 +271,7 @@ public:
}
}
_Coordinate tmp;
double dist = numeric_limits<double>::max();
double dist = (numeric_limits<double>::max)();
BOOST_FOREACH(_GridEdge candidate, candidates) {
double r = 0.;
double tmpDist = ComputeDistance(startCoord, candidate.startCoord, candidate.targetCoord, tmp, &r);
@ -304,7 +304,7 @@ public:
_GridEdge smallestEdge;
_Coordinate tmp, newEndpoint;
double dist = numeric_limits<double>::max();
double dist = (numeric_limits<double>::max)();
BOOST_FOREACH(_GridEdge candidate, candidates) {
double r = 0.;
double tmpDist = ComputeDistance(startCoord, candidate.startCoord, candidate.targetCoord, tmp, &r);
@ -338,7 +338,7 @@ public:
// INFO("-> node: " << resultNode.edgeBasedNode << ", bidir: " << (resultNode.isBidirected() ? "yes" : "no"));
// }
double ratio = std::min(1., LengthOfVector(smallestEdge.startCoord, newEndpoint)/LengthOfVector(smallestEdge.startCoord, smallestEdge.targetCoord) );
double ratio = (std::min)(1., LengthOfVector(smallestEdge.startCoord, newEndpoint)/LengthOfVector(smallestEdge.startCoord, smallestEdge.targetCoord) );
assert(ratio >= 0 && ratio <=1);
// INFO("Old weight1: " << resultNode.weight1 << ", old weight2: " << resultNode.weight2);
resultNode.weight1 *= ratio;