12 May 2000 lkcl   » (Master)

patch to do number of certifications required be greater than x. node_paths is incremented not only when node_flow is incremented but also when it is found that there is a path [any path] to the supersink. could be implemented as returning node_flow[i] + node_sink[i]. not entirely confident about whether this Does The Right Thing!

--- net_flow.old.c      Fri May 12 06:21:51 2000
+++ net_flow.c  Fri May 12 06:10:32 2000
@@ -13,6 +13,7 @@
   int *edge_flow;

int *node_sink; /* 1 if there is flow from this node to the supersink */ + int *node_paths; /* number of paths to the node */ int *node_flow; /* total flow through the node */ int *node_in_degree; int *node_in_degree_max; @@ -100,6 +101,7 @@

g_free (priv->node_sink); + g_free (priv->node_paths); g_free (priv->node_flow); g_free (priv->node_in_degree); g_free (priv->node_in_degree_max); @@ -488,6 +490,7 @@ priv->edge_flow = g_new (int, n_edges);

priv->node_sink = g_new (int, self->n_nodes); + priv->node_paths = g_new (int, self->n_nodes); priv->node_flow = g_new (int, self->n_nodes); priv->node_in_degree = g_new (int, self->n_nodes); priv->node_in_degree_max = g_new (int, self->n_nodes); @@ -499,6 +502,7 @@ for (i = 0; i < self->n_nodes; i++) { priv->node_sink[i] = 0; + priv->node_paths[i] = 0; priv->node_flow[i] = 0; priv->node_in_degree[i] = 0; priv->node_in_degree_max[i] = 16; @@ -579,6 +583,7 @@ { next = pred_list[ix]; priv->node_flow[ix]++; + priv->node_paths[node]++; if (ix != next) { /* find edge from next to ix and increment flow */ @@ -663,6 +668,7 @@ #endif

priv->node_sink[node] = 1; + priv->node_paths[node]++; q_ptr = q_beg; while (q_ptr != 0) { @@ -1011,8 +1017,8 @@ { int *result;

- result = self->priv->node_sink; - self->priv->node_sink = NULL; + result = self->priv->node_paths; + self->priv->node_paths = NULL; return result; }

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!