Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Missing includes.
[simgrid.git] / src / xbt / graph.c
index 42c211f..befa76c 100644 (file)
@@ -1,6 +1,6 @@
 /* a generic graph library.                                                 */
 
-/* Copyright (c) 2006-2014. The SimGrid Team.
+/* Copyright (c) 2006-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
 #include "graph_private.h"
 #include "xbt/dict.h"
 #include "xbt/heap.h"
-#include "xbt/str.h"
 #include "xbt/file.h"
 
 #include <errno.h>
+#include <stdio.h>
 #include <stdlib.h>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_graph, xbt, "Graph");
@@ -227,11 +227,10 @@ void xbt_floyd_algorithm(xbt_graph_t g, double *adj, double *d, xbt_node_t * p)
   for (k = 0; k < n; k++) {
     for (i = 0; i < n; i++) {
       for (j = 0; j < n; j++) {
-        if ((d[i*n+k] > -1) && (d[k*n+j] > -1)) {
-          if ((d[i*n+j] < 0) || (d[i*n+j] > d[i*n+k] + d[k*n+j])) {
-            d[i*n+j] = d[i*n+k] + d[k*n+j];
-            p[i*n+j] = p[k*n+j];
-          }
+        if (d[i * n + k] > -1 && d[k * n + j] > -1 &&
+            (d[i * n + j] < 0 || d[i * n + j] > d[i * n + k] + d[k * n + j])) {
+          d[i * n + j] = d[i * n + k] + d[k * n + j];
+          p[i * n + j] = p[k * n + j];
         }
       }
     }