]> granicus.if.org Git - graphviz/commitdiff
Split use of Agnode_t out of vtx_data structure so that it can be used
authorerg <devnull@localhost>
Fri, 25 Apr 2008 14:38:29 +0000 (14:38 +0000)
committererg <devnull@localhost>
Fri, 25 Apr 2008 14:38:29 +0000 (14:38 +0000)
independently of all the main graphviz machinery.

lib/neatogen/constrained_majorization.c
lib/neatogen/constrained_majorization_ipsep.c

index 9e3992f27b2e95c8c4cd7c62b8ca4e9382dcacc7..f11c4c3f73f8ee08d7e65f53d1744adf0c3998c8 100644 (file)
@@ -39,6 +39,7 @@ stress_majorization_with_hierarchy(
     int n,              /* Number of nodes */
     int nedges_graph,   /* Number of edges */
     double** d_coords,  /* Coordinates of nodes (output layout)  */
+    node_t** nodes,     /* Original nodes */
     int dim,            /* Dimemsionality of layout */
     int smart_ini,      /* smart initialization */
     int model,          /* difference model */
@@ -100,7 +101,7 @@ stress_majorization_with_hierarchy(
                }
        }
        if (!directionalityExist) {
-               return stress_majorization_kD_mkernel(graph, n, nedges_graph, d_coords, dim, smart_ini, model, maxi);
+               return stress_majorization_kD_mkernel(graph, n, nedges_graph, d_coords, nodes, dim, smart_ini, model, maxi);
        }
 
        /******************************************************************
@@ -112,7 +113,7 @@ stress_majorization_with_hierarchy(
                double* y;
                if (dim>2) {
                        /* the dim==2 case is handled below                      */
-                       stress_majorization_kD_mkernel(graph, n, nedges_graph, d_coords+1, dim-1, smart_ini, model, 15);
+                       stress_majorization_kD_mkernel(graph, n, nedges_graph, d_coords+1, nodes, dim-1, smart_ini, model, 15);
                        /* now copy the y-axis into the (dim-1)-axis */
                        for (i=0; i<n; i++) {
                                d_coords[dim-1][i] = d_coords[1][i];
@@ -124,7 +125,7 @@ stress_majorization_with_hierarchy(
                compute_hierarchy(graph, n, abs_tol, relative_tol, y, &ordering, &levels, &num_levels);
                if (num_levels<=1) {
                        /* no hierarchy found, use faster algorithm */
-                       return stress_majorization_kD_mkernel(graph, n, nedges_graph, d_coords, dim, smart_ini, model, maxi);
+                       return stress_majorization_kD_mkernel(graph, n, nedges_graph, d_coords, nodes, dim, smart_ini, model, maxi);
                }
 
                if (levels_gap>0) {
@@ -144,7 +145,7 @@ stress_majorization_with_hierarchy(
                }
        }
        else {
-        initLayout(graph, n, dim, d_coords);
+        initLayout(graph, n, dim, d_coords, nodes);
                compute_hierarchy(graph, n, abs_tol, relative_tol, NULL, &ordering, &levels, &num_levels);              
        }
     if (n == 1) return 0;
index 9d2ec8e7dbd33548bb5b43f22ae58b3e3577c40e..b0072077f70086f40c5a7824ac149151a644f4a3 100644 (file)
@@ -59,6 +59,7 @@ int stress_majorization_cola(
     int n,              /* Number of nodes */
     int nedges_graph,  /* Number of edges */
     double **d_coords, /* Coordinates of nodes (output layout)  */
+    node_t **nodes,    /* Original nodes */
     int dim,            /* Dimemsionality of layout */
     int model,         /* difference model */
     int maxi,          /* max iterations */
@@ -103,7 +104,7 @@ int stress_majorization_cola(
     float maxEdgeLen = 0;
     double max = 1;
 
-    initLayout(graph, n, dim, d_coords);
+    initLayout(graph, n, dim, d_coords, nodes);
     if (n == 1)
        return 0;