Improved dump for RM.
authorSebastian Buchwald <Sebastian.Buchwald@kit.edu>
Mon, 16 Aug 2010 15:07:09 +0000 (15:07 +0000)
committerSebastian Buchwald <Sebastian.Buchwald@kit.edu>
Mon, 16 Aug 2010 15:07:09 +0000 (15:07 +0000)
[r27934]

heuristical_co.c
optimal.c

index f65db2c..0e4a474 100644 (file)
@@ -66,14 +66,6 @@ static void merge_into_RN_node(pbqp *pbqp, plist_t *rpeo)
        assert(node);
        assert(pbqp_node_get_degree(node) > 2);
 
-#if    KAPS_DUMP
-       if (pbqp->dump_file) {
-               char     txt[100];
-               sprintf(txt, "RN-Reduction of Node n%d", node->index);
-               dump_section(pbqp->dump_file, 2, txt);
-               pbqp_dump_graph(pbqp);
-       }
-#endif
        /* Check whether we can merge a neighbor into the current node. */
        apply_RM(pbqp, node);
 }
@@ -92,6 +84,15 @@ static void apply_RN_co(pbqp *pbqp)
        if (node_is_reduced(node))
                return;
 
+#if    KAPS_DUMP
+       if (pbqp->dump_file) {
+               char     txt[100];
+               sprintf(txt, "RN-Reduction of Node n%d", node->index);
+               dump_section(pbqp->dump_file, 2, txt);
+               pbqp_dump_graph(pbqp);
+       }
+#endif
+
        min_index = get_local_minimal_alternative(pbqp, node);
 
 #if    KAPS_DUMP
index 61f0082..9d6d2b6 100644 (file)
--- a/optimal.c
+++ b/optimal.c
@@ -348,6 +348,14 @@ static void merge_source_into_target(pbqp *pbqp, pbqp_edge *edge)
        pbqp->num_rm++;
 #endif
 
+#if    KAPS_DUMP
+       if (pbqp->dump_file) {
+               char txt[100];
+               sprintf(txt, "Merging n%d into n%d", src_node->index, tgt_node->index);
+               dump_section(pbqp->dump_file, 3, txt);
+       }
+#endif
+
        /* Reconnect the source's edges with the target node. */
        for (edge_index = 0; edge_index < edge_len; ++edge_index) {
                pbqp_edge   *old_edge = src_node->edges[edge_index];
@@ -514,6 +522,14 @@ static void merge_target_into_source(pbqp *pbqp, pbqp_edge *edge)
        pbqp->num_rm++;
 #endif
 
+#if    KAPS_DUMP
+       if (pbqp->dump_file) {
+               char txt[100];
+               sprintf(txt, "Merging n%d into n%d", tgt_node->index, src_node->index);
+               dump_section(pbqp->dump_file, 3, txt);
+       }
+#endif
+
        /* Reconnect the target's edges with the source node. */
        for (edge_index = 0; edge_index < edge_len; ++edge_index) {
                pbqp_edge   *old_edge = tgt_node->edges[edge_index];