From 07c8dea2b0361314ac4bbf0e45dd4c33ce11f206 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Fri, 1 Jul 2011 23:11:08 -0700 Subject: Applying patch from Campbell Barton to help building on other than gcc. (bzr r10399) --- src/libcola/shortest_paths.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src/libcola/shortest_paths.cpp') diff --git a/src/libcola/shortest_paths.cpp b/src/libcola/shortest_paths.cpp index 4f4183b07..ebc2c93de 100644 --- a/src/libcola/shortest_paths.cpp +++ b/src/libcola/shortest_paths.cpp @@ -73,6 +73,7 @@ void dijkstra( } } } + void dijkstra( unsigned s, unsigned n, @@ -80,21 +81,22 @@ void dijkstra( vector& es, double* eweights) { - assert(s vs(n); + dijkstra_init(&vs[0], es, eweights); + dijkstra(s, n, &vs[0], d); } + void johnsons( unsigned n, double** D, vector& es, double* eweights) { - Node vs[n]; - dijkstra_init(vs,es,eweights); - for(unsigned k=0;k vs(n); + dijkstra_init(&vs[0], es, eweights); + for (unsigned k = 0; k < n; k++) { + dijkstra(k,n,&vs[0],D[k]); } } } -- cgit v1.2.3