+ for (j = 0; j < lines_used; j++)
+ if (SN_COMP_LEFT (c) > right[j])
+ break;
+
+ lines[i] = j;
+ right[j] = SN_COMP_RIGHT (c);
+ if (j >= lines_used)
+ lines_used = j + 1;
+ }
+ assert (lines_used >= 1);
+
+ return (((double) (lines_used - 1)) * INNER_SPACING);
+}
+
+static double determine_network_width (sn_network_t *n) /* {{{ */
+{
+ double width;
+ int i;
+
+ /* Spacing between stages and at the beginning and end of the network */
+ width = (SN_NETWORK_STAGE_NUM (n) + 1) * OUTER_SPACING;
+
+ /* Spacing required within a stage */
+ for (i = 0; i < SN_NETWORK_STAGE_NUM (n); i++)
+ width += determine_stage_width (SN_NETWORK_STAGE_GET (n, i));
+
+ return (width);
+} /* }}} double determine_network_width */
+
+static int sn_svg_show_stage (sn_stage_t *s)
+{
+ int lines[s->comparators_num];
+ int right[s->comparators_num];
+ int lines_used = 0;
+ int i;