]> granicus.if.org Git - graphviz/commitdiff
fixed indentation
authorJonathan Zheng <jonathanzheng@hotmail.co.uk>
Fri, 17 Jan 2020 11:09:25 +0000 (11:09 +0000)
committerMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Sun, 5 Apr 2020 20:18:29 +0000 (22:18 +0200)
lib/neatogen/sgd.c

index e71ccb24c75d79c463fc58668edff9a4df1e09f8..67c9ce01e439e6cdcb146c9ba1b8d125ac3ef441 100644 (file)
@@ -90,19 +90,19 @@ graph_sgd * extract_adjacency(graph_t *G, int model) {
         bool *neighbours_i = N_NEW(graph->n, bool);
         bool *neighbours_j = N_NEW(graph->n, bool);
         for (i=0; i<graph->n; i++) {
-                       // initialise to no neighbours
+            // initialise to no neighbours
             neighbours_i[i] = false;
-                       neighbours_j[i] = false;
+            neighbours_j[i] = false;
         }
         for (i=0; i<graph->n; i++) {
             int x;
-                       int deg_i = 0;
+            int deg_i = 0;
             for (x=graph->sources[i]; x<graph->sources[i+1]; x++) {
                 int j = graph->targets[x];
-                               if (neighbours_i[j] == false) { // ignore multiedges
-                                       neighbours_i[j] = true; // set up sort of hashset
-                                       deg_i++;
-                               }
+                if (neighbours_i[j] == false) { // ignore multiedges
+                    neighbours_i[j] = true; // set up sort of hashset
+                    deg_i++;
+                }
             }
             for (x=graph->sources[i]; x<graph->sources[i+1]; x++) {
                 int j = graph->targets[x];
@@ -111,18 +111,18 @@ graph_sgd * extract_adjacency(graph_t *G, int model) {
                 for (y=graph->sources[j]; y<graph->sources[j+1]; y++) {
                     int k = graph->targets[y];
                     if (neighbours_j[k] == false) { // ignore multiedges
-                                               neighbours_j[k] = true; // set up sort of hashset
-                                               deg_j++;
-                                               if (neighbours_i[k]) {
-                                                       intersect++;
-                                               }
+                        neighbours_j[k] = true; // set up sort of hashset
+                        deg_j++;
+                        if (neighbours_i[k]) {
+                            intersect++;
+                        }
                     }
                 }
                 graph->weights[x] = deg_i + deg_j - (2*intersect);
                 assert(graph->weights[x] > 0);
                 for (y=graph->sources[j]; y<graph->sources[j+1]; y++) {
                     int k = graph->targets[y];
-                                       neighbours_j[k] = false; // reset sort of hashset
+                    neighbours_j[k] = false; // reset sort of hashset
                 }
             }
             for (x=graph->sources[i]; x<graph->sources[i+1]; x++) {