Skip to content
Snippets Groups Projects
Commit 08e9eab1 authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Solved some errors of the Eigen library when trying to index a matrix with double indexes.

parent 1bf1ba61
No related branches found
No related tags found
No related merge requests found
......@@ -95,10 +95,10 @@ double CDijkstra::find_shortest_path(Eigen::MatrixXd &graph,unsigned int start_n
new_d2=d2.block(1,0,d2.rows()-1,2);
for(i=0;i<new_d2.rows();i++)
{
if(d(new_d2(i,1),0)>(d(k,0)+int_graph(k,new_d2(i,1))))
if(d((int)new_d2(i,1),0)>(d(k,0)+int_graph(k,(int)new_d2(i,1))))
{
d(new_d2(i,1),0)=d(k,0)+int_graph(k,new_d2(i,1));
new_d2(i,0)=d(new_d2(i,1),0);
d((int)new_d2(i,1),0)=d(k,0)+int_graph(k,(int)new_d2(i,1));
new_d2(i,0)=d((int)new_d2(i,1),0);
}
}
for(i=1;i<int_graph.rows();i++)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment