* the fixed portion and add its length to both the moveables,
* so that we have one subsegspec for the whole of each position:
*
- * <---l---> <----l'----> <--------(l+l')------>
+ * <---l---> <----l'---> <---------(l+l')------>
*
* *----A1---*----A1/P0--* becomes *--------A1/P0----------*
* `---A1/P1---* `-------A1/P1-----------*
*
- * <----l''---> <--------(l+l'')------>
+ * <----l''---> <---------(l+l'')------>
*/
for (;;) {
static void elimtrivial(void) {
/* Eliminate trivial nodes: ones which have only two edges, which
- * come in on opposite sides, have the same subsegspec. The two
- * ends are supposed to be identically aligned.
-
- for $lk (@links) {
- $nodeentries[$lk->[0]][$lk->[1]]++;
- $nodeentries[$lk->[1]][$lk->[2]]++;
+ * come in on opposite sides, have the same subsegspec, and with the
+ * two ends identically aligned.
+ */
+ for (node=nodes_head; node; node=next_node) {
+ next_node=node->next;
+ trace("elimtrivial node "); trace_node(node); trace(" ");
+ if (!(count_edges(&node->sides[0])==1 &&
+ count_edges(&node->sides[1])==1)) {
+ trace("no, a non-unitary side\n");
+ continue;
}
- for ($nodenum=0; $nodenum<@nodes; $nodenum++) {
-
-}
-static void
-
+ leftedge= node->sides[0].head;
+ rightedge= node->sides[0].head;
+ if (strcmp(leftedge->edge.segment,rightedge->edge.segment)) {
+ trace("no, segments differ\n");
+ continue;
+ }
+ if (!!leftedge->edge.movfeatpos != !!rightedge->edge.movfeatpos ||
+ strcmp(leftedge->edge.movfeatpos, rightedge->edge.movfeatpos)) {
+ trace("no, movfeatpos's differ\n");
+ continue;
+ }
+ if (leftedge->end == rightedge->end) {
+ trace("no, opposite alignment\n");
+ continue;
+ }
+ trace(" yes:\n");
+ rightedge->edge->distance += leftedge->edge->distance;
+ edge_replumb(rightedge, edgeend_otherend(leftedge)->node);
+ edge_delete(leftedge->edge);
+ node_surely_orphaned(node);
+ trace(" elimtrivial operation complete\n");
+ }
+}