amyoxen / k-shortest-paths

Automatically exported from code.google.com/p/k-shortest-paths
0 stars 0 forks source link

One bug in QYKShortestPaths.cpp #3

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Using Borland C++ Builder 6 to compile this project.
2. There are a error in QYKShortestPaths.cpp during compiling the project.
3. The bug is in "void CQYKShortestPaths::_SearchTopKShortestPaths()" and 
line 127 :
// Call _Restore4CostAjustment again for the deviated_node
_RestoreEdges4CostAjustment(node_list_in_path, deviated_node_id, 
node_list_in_path.at(i+1), true);
4. The error message tells me that "Undefined symbol "i" on line 127.

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
I use k-shortest-paths-1.0.2
My operating system is Windows XP SP2

Please provide any additional information below.
Please tell me how tow modify this error.

Original issue reported on code.google.com by a009...@gmail.com on 21 Apr 2008 at 5:30

GoogleCodeExporter commented 8 years ago
This is an inconsistency between different compilers. I programmed with VC++, 
and the
compiler used by Microsoft in VS6.0 doesn't exactly follow the standard cpp 
syntax. 
So you could make a little bit change on the code from:
for (int i=path_length-2; i>=0 && node_list_in_path.at(i) != deviated_node_id; 
--i)    {
_RestoreEdges4CostAjustment(node_list_in_path, node_list_in_path.at(i),
node_list_in_path.at(i+1));
}

to:
int i = 0;
for (i=path_length-2; i>=0 && node_list_in_path.at(i) != deviated_node_id; --i)
{
_RestoreEdges4CostAjustment(node_list_in_path, node_list_in_path.at(i),
node_list_in_path.at(i+1));
}

Original comment by yan.qi....@gmail.com on 25 May 2008 at 6:49