diff options
| author | Jon A. Cruz <jon@joncruz.org> | 2011-07-02 06:11:08 +0000 |
|---|---|---|
| committer | Jon A. Cruz <jon@joncruz.org> | 2011-07-02 06:11:08 +0000 |
| commit | 07c8dea2b0361314ac4bbf0e45dd4c33ce11f206 (patch) | |
| tree | d5452b36543452b5e79e9c7c688c897a6b87dfe8 /src/libcola/shortest_paths.cpp | |
| parent | compatibility for building with clang, this failed for 2 reasons. (diff) | |
| download | inkscape-07c8dea2b0361314ac4bbf0e45dd4c33ce11f206.tar.gz inkscape-07c8dea2b0361314ac4bbf0e45dd4c33ce11f206.zip | |
Applying patch from Campbell Barton to help building on other than gcc.
(bzr r10399)
Diffstat (limited to 'src/libcola/shortest_paths.cpp')
| -rw-r--r-- | src/libcola/shortest_paths.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
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<Edge>& es, double* eweights) { - assert(s<n); - Node vs[n]; - dijkstra_init(vs,es,eweights); - dijkstra(s,n,vs,d); + assert(s < n); + std::vector<Node> vs(n); + dijkstra_init(&vs[0], es, eweights); + dijkstra(s, n, &vs[0], d); } + void johnsons( unsigned n, double** D, vector<Edge>& es, double* eweights) { - Node vs[n]; - dijkstra_init(vs,es,eweights); - for(unsigned k=0;k<n;k++) { - dijkstra(k,n,vs,D[k]); + std::vector<Node> vs(n); + dijkstra_init(&vs[0], es, eweights); + for (unsigned k = 0; k < n; k++) { + dijkstra(k,n,&vs[0],D[k]); } } } |
