Replace, again HUGE by HUGE_VAL in Knik (for Cygwin).

This commit is contained in:
Jean-Paul Chaput 2014-08-06 17:44:07 +02:00
parent 6d7dad54d1
commit 4cf6bef950
2 changed files with 15 additions and 15 deletions

View File

@ -72,7 +72,7 @@
/*! \var float Vertex::_distance /*! \var float Vertex::_distance
* In Dijkstra's algorithm implementation each vertex has a distance from source vertex * In Dijkstra's algorithm implementation each vertex has a distance from source vertex
* *
* \Initial (float)(HUGE) * \Initial (float)(HUGE_VAL)
*/ */
/*! \var int Vertex::_connexID /*! \var int Vertex::_connexID

View File

@ -1016,7 +1016,7 @@ int Graph::initRouting ( Net* net )
//cerr << " Adding vertex to _vertexes_to_route: continue" << endl; //cerr << " Adding vertex to _vertexes_to_route: continue" << endl;
_vertexes_to_route.insert ( contactVertex ); _vertexes_to_route.insert ( contactVertex );
_searchingArea.merge ( contactVertex->getBox() ); _searchingArea.merge ( contactVertex->getBox() );
contactVertex->setDistance((float)(HUGE)); contactVertex->setDistance((float)(HUGE_VAL));
contactVertex->setPredecessor(NULL); contactVertex->setPredecessor(NULL);
currentConnexID++; currentConnexID++;
} }
@ -1056,7 +1056,7 @@ int Graph::initRouting ( Net* net )
_searchingArea.merge ( rpVertex->getBox() ); _searchingArea.merge ( rpVertex->getBox() );
rpVertex->setConnexID ( currentConnexID ); rpVertex->setConnexID ( currentConnexID );
rpVertex->setNetStamp ( _netStamp ); rpVertex->setNetStamp ( _netStamp );
rpVertex->setDistance((float)(HUGE)); rpVertex->setDistance((float)(HUGE_VAL));
rpVertex->setPredecessor(NULL); rpVertex->setPredecessor(NULL);
currentConnexID++; currentConnexID++;
} }
@ -1142,7 +1142,7 @@ void Graph::Dijkstra()
while ( _vertexes_to_route.size() > 1 ) { while ( _vertexes_to_route.size() > 1 ) {
// Now, let's expanse the top of the queue // Now, let's expanse the top of the queue
VertexList reachedVertexes; VertexList reachedVertexes;
float reachedDistance = (float)(HUGE); float reachedDistance = (float)(HUGE_VAL);
//checkGraphConsistency(); //checkGraphConsistency();
if (ltracelevel() >= 600) { if (ltracelevel() >= 600) {
@ -1274,7 +1274,7 @@ void Graph::Dijkstra()
message << " Unable to reach target on net " << _working_net->getName() << "."; message << " Unable to reach target on net " << _working_net->getName() << ".";
throw Error( message.str() ); throw Error( message.str() );
} }
assert( reachedDistance < (float)(HUGE) ); assert( reachedDistance < (float)(HUGE_VAL) );
ltrace(600) << "Updating two connex components:" << endl; ltrace(600) << "Updating two connex components:" << endl;
ltrace(600) << "1. " << (*(reachedVertexes.begin())) << endl; ltrace(600) << "1. " << (*(reachedVertexes.begin())) << endl;
@ -1375,8 +1375,8 @@ void Graph::Monotonic()
while ( topEdge ) { while ( topEdge ) {
Vertex* currentVertex = topEdge->getOpposite ( vertPred ); Vertex* currentVertex = topEdge->getOpposite ( vertPred );
if ( currentVertex->getPosition().getY() <= targetY ) { if ( currentVertex->getPosition().getY() <= targetY ) {
float vertDistance = (float)(HUGE); float vertDistance = (float)(HUGE_VAL);
float horzDistance = (float)(HUGE); float horzDistance = (float)(HUGE_VAL);
vertDistance = vertPred->getDistance() + topEdge->getCost ( vertPred->getPredecessor() ); vertDistance = vertPred->getDistance() + topEdge->getCost ( vertPred->getPredecessor() );
Edge* leftEdge = currentVertex->getHEdgeIn(); Edge* leftEdge = currentVertex->getHEdgeIn();
@ -1450,8 +1450,8 @@ void Graph::Monotonic()
while ( bottomEdge ) { while ( bottomEdge ) {
Vertex* currentVertex = bottomEdge->getOpposite ( vertPred ); Vertex* currentVertex = bottomEdge->getOpposite ( vertPred );
if ( currentVertex->getPosition().getY() >= targetY ) { if ( currentVertex->getPosition().getY() >= targetY ) {
float vertDistance = (float)(HUGE); float vertDistance = (float)(HUGE_VAL);
float horzDistance = (float)(HUGE); float horzDistance = (float)(HUGE_VAL);
vertDistance = vertPred->getDistance() + bottomEdge->getCost ( vertPred->getPredecessor() ); vertDistance = vertPred->getDistance() + bottomEdge->getCost ( vertPred->getPredecessor() );
Edge* leftEdge = currentVertex->getHEdgeIn(); Edge* leftEdge = currentVertex->getHEdgeIn();
@ -1819,7 +1819,7 @@ void Graph::rebuildConnexComponent ( Contact* contact, int connexID, Segment* ar
contactVertex->setContact ( contact ); contactVertex->setContact ( contact );
contactVertex->setConnexID ( connexID ); contactVertex->setConnexID ( connexID );
contactVertex->setNetStamp ( _netStamp ); contactVertex->setNetStamp ( _netStamp );
contactVertex->setDistance((float)(HUGE)); contactVertex->setDistance((float)(HUGE_VAL));
contactVertex->setPredecessor(NULL); contactVertex->setPredecessor(NULL);
//cerr << "from :" << contact << endl; //cerr << "from :" << contact << endl;
//cerr << "arrivalSegment: " << arrivalSegment << endl; //cerr << "arrivalSegment: " << arrivalSegment << endl;
@ -1858,7 +1858,7 @@ void Graph::setNetStampConnexID ( Segment* segment, int connexID )
assert(vertex); assert(vertex);
vertex->setNetStamp ( _netStamp ); vertex->setNetStamp ( _netStamp );
vertex->setConnexID ( connexID ); vertex->setConnexID ( connexID );
vertex->setDistance((float)(HUGE)); vertex->setDistance((float)(HUGE_VAL));
Edge* edge = vertex->getVEdgeOut(); Edge* edge = vertex->getVEdgeOut();
assert(edge); assert(edge);
edge->setNetStamp ( _netStamp ); edge->setNetStamp ( _netStamp );
@ -1868,7 +1868,7 @@ void Graph::setNetStampConnexID ( Segment* segment, int connexID )
assert(vertex); assert(vertex);
vertex->setNetStamp ( _netStamp ); vertex->setNetStamp ( _netStamp );
vertex->setConnexID ( connexID ); vertex->setConnexID ( connexID );
vertex->setDistance((float)(HUGE)); vertex->setDistance((float)(HUGE_VAL));
return; return;
} }
if ( sourceLineIdx == targetLineIdx ) { // horizontal segment if ( sourceLineIdx == targetLineIdx ) { // horizontal segment
@ -1877,7 +1877,7 @@ void Graph::setNetStampConnexID ( Segment* segment, int connexID )
assert(vertex); assert(vertex);
vertex->setNetStamp ( _netStamp ); vertex->setNetStamp ( _netStamp );
vertex->setConnexID ( connexID ); vertex->setConnexID ( connexID );
vertex->setDistance((float)(HUGE)); vertex->setDistance((float)(HUGE_VAL));
Edge* edge = vertex->getHEdgeOut(); Edge* edge = vertex->getHEdgeOut();
assert(edge); assert(edge);
edge->setNetStamp ( _netStamp ); edge->setNetStamp ( _netStamp );
@ -1887,7 +1887,7 @@ void Graph::setNetStampConnexID ( Segment* segment, int connexID )
assert(vertex); assert(vertex);
vertex->setNetStamp ( _netStamp ); vertex->setNetStamp ( _netStamp );
vertex->setConnexID ( connexID ); vertex->setConnexID ( connexID );
vertex->setDistance((float)(HUGE)); vertex->setDistance((float)(HUGE_VAL));
return; return;
} }
throw Error ( "Graph::setNetStampConnexId(): what sort of segment is that, a diagonal one?" ); throw Error ( "Graph::setNetStampConnexId(): what sort of segment is that, a diagonal one?" );
@ -2332,7 +2332,7 @@ void Graph::CleanRoutingState()
// assert (vertex); // assert (vertex);
// vertex->setLocalRingHook(NULL); // vertex->setLocalRingHook(NULL);
// vertex->setConnexID(-1); // vertex->setConnexID(-1);
// vertex->setDistance((float)(HUGE)); // vertex->setDistance((float)(HUGE_VAL));
// vertex->setPredecessor(NULL); // vertex->setPredecessor(NULL);
// assert ( vertex->getVTuple() == NULL ); // assert ( vertex->getVTuple() == NULL );
//} //}