Removed dead code

This commit is contained in:
DennisOSRM 2011-10-14 15:04:57 +02:00
parent 77c6a06c15
commit eae9e95c66

View File

@ -268,7 +268,6 @@ public:
/** search for point on edge next to source */ /** search for point on edge next to source */
unsigned fileIndex = GetFileIndexForLatLon(startCoord.lat, startCoord.lon); unsigned fileIndex = GetFileIndexForLatLon(startCoord.lat, startCoord.lon);
std::vector<_Edge> candidates; std::vector<_Edge> candidates;
double timestamp = get_timestamp();
for(int j = -32768; j < (32768+1); j+=32768) { for(int j = -32768; j < (32768+1); j+=32768) {
for(int i = -1; i < 2; i++){ for(int i = -1; i < 2; i++){
@ -277,12 +276,10 @@ public:
} }
_Coordinate tmp; _Coordinate tmp;
double dist = (numeric_limits<double>::max)(); double dist = (numeric_limits<double>::max)();
timestamp = get_timestamp();
for(std::vector<_Edge>::iterator it = candidates.begin(); it != candidates.end(); it++) { for(std::vector<_Edge>::iterator it = candidates.begin(); it != candidates.end(); it++) {
double r = 0.; double r = 0.;
double tmpDist = ComputeDistance(startCoord, it->startCoord, it->targetCoord, tmp, &r); double tmpDist = ComputeDistance(startCoord, it->startCoord, it->targetCoord, tmp, &r);
if(tmpDist < dist) { if(tmpDist < dist) {
// std::cout << "[debug] start distance " << (it - candidates.begin()) << " " << tmpDist << std::endl;
nodesOfEdge.startID = it->start; nodesOfEdge.startID = it->start;
nodesOfEdge.destID = it->target; nodesOfEdge.destID = it->target;
nodesOfEdge.ratio = r; nodesOfEdge.ratio = r;
@ -303,7 +300,6 @@ public:
/** search for point on edge close to source */ /** search for point on edge close to source */
unsigned fileIndex = GetFileIndexForLatLon(startCoord.lat, startCoord.lon); unsigned fileIndex = GetFileIndexForLatLon(startCoord.lat, startCoord.lon);
std::vector<_Edge> candidates; std::vector<_Edge> candidates;
// double timestamp = get_timestamp();
for(int j = -32768; j < (32768+1); j+=32768) { for(int j = -32768; j < (32768+1); j+=32768) {
for(int i = -1; i < 2; i++){ for(int i = -1; i < 2; i++){
@ -313,7 +309,6 @@ public:
_Coordinate tmp; _Coordinate tmp;
double dist = (numeric_limits<double>::max)(); double dist = (numeric_limits<double>::max)();
// timestamp = get_timestamp();
for(std::vector<_Edge>::iterator it = candidates.begin(); it != candidates.end(); it++) { for(std::vector<_Edge>::iterator it = candidates.begin(); it != candidates.end(); it++) {
double r = 0.; double r = 0.;
double tmpDist = ComputeDistance(startCoord, it->startCoord, it->targetCoord, tmp, &r); double tmpDist = ComputeDistance(startCoord, it->startCoord, it->targetCoord, tmp, &r);
@ -340,7 +335,6 @@ public:
void FindNearestNodeInGraph(const _Coordinate& inputCoordinate, _Coordinate& outputCoordinate) { void FindNearestNodeInGraph(const _Coordinate& inputCoordinate, _Coordinate& outputCoordinate) {
unsigned fileIndex = GetFileIndexForLatLon(100000*(lat2y(static_cast<double>(inputCoordinate.lat)/100000.)), inputCoordinate.lon); unsigned fileIndex = GetFileIndexForLatLon(100000*(lat2y(static_cast<double>(inputCoordinate.lat)/100000.)), inputCoordinate.lon);
std::vector<_Edge> candidates; std::vector<_Edge> candidates;
double timestamp = get_timestamp();
for(int j = -32768; j < (32768+1); j+=32768) { for(int j = -32768; j < (32768+1); j+=32768) {
for(int i = -1; i < 2; i++) { for(int i = -1; i < 2; i++) {
GetContentsOfFileBucket(fileIndex+i+j, candidates); GetContentsOfFileBucket(fileIndex+i+j, candidates);
@ -348,7 +342,6 @@ public:
} }
_Coordinate tmp; _Coordinate tmp;
double dist = (numeric_limits<double>::max)(); double dist = (numeric_limits<double>::max)();
timestamp = get_timestamp();
for(std::vector<_Edge>::iterator it = candidates.begin(); it != candidates.end(); it++) { for(std::vector<_Edge>::iterator it = candidates.begin(); it != candidates.end(); it++) {
double r = 0.; double r = 0.;
double tmpDist = ComputeDistance(inputCoordinate, it->startCoord, it->targetCoord, tmp, &r); double tmpDist = ComputeDistance(inputCoordinate, it->startCoord, it->targetCoord, tmp, &r);
@ -405,10 +398,8 @@ private:
unsigned columnBase = ramIndex%1024; unsigned columnBase = ramIndex%1024;
columnBase=columnBase*32; columnBase=columnBase*32;
for(int i = 0; i < 32; i++) for(int i = 0; i < 32; i++) {
{ for(int j = 0; j < 32; j++) {
for(int j = 0; j < 32; j++)
{
unsigned fileIndex = lineBase + i*32768 + columnBase+j; unsigned fileIndex = lineBase + i*32768 + columnBase+j;
unsigned cellIndex = i*32+j; unsigned cellIndex = i*32+j;
cellMap->insert(std::make_pair(fileIndex, cellIndex)); cellMap->insert(std::make_pair(fileIndex, cellIndex));
@ -563,9 +554,6 @@ private:
} }
} }
{ {
// if(cellCache.exists(startIndexInFile)) {
// cellCache.fetch(startIndexInFile, cellIndex);
// } else {
std::ifstream localStream(iif.c_str(), std::ios::in | std::ios::binary); std::ifstream localStream(iif.c_str(), std::ios::in | std::ios::binary);
localStream.seekg(startIndexInFile); localStream.seekg(startIndexInFile);
localStream.read((char*) &cellIndex[0], 32*32*sizeof(unsigned)); localStream.read((char*) &cellIndex[0], 32*32*sizeof(unsigned));
@ -574,16 +562,9 @@ private:
if(cellIndex[cellMap.find(fileIndex)->second] == UINT_MAX) { if(cellIndex[cellMap.find(fileIndex)->second] == UINT_MAX) {
return; return;
} }
//#pragma omp critical
// {
// cellCache.insert(startIndexInFile, cellIndex);
// }
} }
const unsigned position = cellIndex[cellMap.find(fileIndex)->second] + 32*32*sizeof(unsigned) ; const unsigned position = cellIndex[cellMap.find(fileIndex)->second] + 32*32*sizeof(unsigned) ;
// if(fileCache.exists(position)) {
// fileCache.fetch(position, result);
// } else {
std::ifstream localStream(iif.c_str(), std::ios::in | std::ios::binary); std::ifstream localStream(iif.c_str(), std::ios::in | std::ios::binary);
localStream.seekg(position); localStream.seekg(position);
DiskEdge diskEdge; DiskEdge diskEdge;
@ -602,11 +583,6 @@ private:
} while(true); } while(true);
localStream.close(); localStream.close();
//#pragma omp critical
// {
// fileCache.insert(position, result);
// }
// }
} }
void AddEdge(_GridEdge edge) { void AddEdge(_GridEdge edge) {