pbqp: add pbqp_ prefix to fix nameclashes
authorMatthias Braun <matze@braunis.de>
Mon, 5 Dec 2011 12:38:50 +0000 (13:38 +0100)
committerMatthias Braun <matze@braunis.de>
Mon, 5 Dec 2011 12:38:50 +0000 (13:38 +0100)
ir/kaps/brute_force.c
ir/kaps/heuristical.c
ir/kaps/heuristical_co.c
ir/kaps/heuristical_co_ld.c
ir/kaps/html_dumper.c
ir/kaps/html_dumper.h
ir/kaps/optimal.c

index 4c3e8ef..ca8f975 100644 (file)
@@ -155,7 +155,7 @@ static void apply_Brute_Force(pbqp_t *pbqp)
        if (pbqp->dump_file) {
                char     txt[100];
                sprintf(txt, "BF-Reduction of Node n%d", node->index);
-               dump_section(pbqp->dump_file, 2, txt);
+               pbqp_dump_section(pbqp->dump_file, 2, txt);
                pbqp_dump_graph(pbqp);
        }
 #endif
@@ -320,7 +320,7 @@ static void back_propagate_brute_force(pbqp_t *pbqp)
 
 #if KAPS_DUMP
        if (pbqp->dump_file) {
-               dump_section(pbqp->dump_file, 2, "Back Propagation");
+               pbqp_dump_section(pbqp->dump_file, 2, "Back Propagation");
        }
 #endif
 
index 98a6e3f..18ef165 100644 (file)
@@ -60,7 +60,7 @@ static void apply_RN(pbqp_t *pbqp)
        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_section(pbqp->dump_file, 2, txt);
                pbqp_dump_graph(pbqp);
        }
 #endif
index f3bc582..06e7e7c 100644 (file)
@@ -85,7 +85,7 @@ static void apply_RN_co(pbqp_t *pbqp)
        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_section(pbqp->dump_file, 2, txt);
                pbqp_dump_graph(pbqp);
        }
 #endif
index c0b5f21..fe7db8c 100644 (file)
@@ -182,7 +182,7 @@ static void back_propagate_ld(pbqp_t *pbqp)
 
 #if KAPS_DUMP
        if (pbqp->dump_file) {
-               dump_section(pbqp->dump_file, 2, "Back Propagation");
+               pbqp_dump_section(pbqp->dump_file, 2, "Back Propagation");
        }
 #endif
 
@@ -241,7 +241,7 @@ static void apply_RN_co_without_selection(pbqp_t *pbqp)
        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_section(pbqp->dump_file, 2, txt);
                pbqp_dump_graph(pbqp);
        }
 #endif
index cda6cf8..a9dd2f1 100644 (file)
@@ -86,7 +86,7 @@ static void dump_matrix(FILE *f, pbqp_matrix_t *mat)
        fprintf(f, "\t\\end{pmatrix}\n");
 }
 
-void dump_edge(FILE *file, pbqp_edge_t *edge)
+void pbqp_dump_edge(FILE *file, pbqp_edge_t *edge)
 {
        fputs("<tex>\n", file);
        fprintf(file, "\t\\overline\n{C}_{%u,%u}=\n",
@@ -113,14 +113,14 @@ static void dump_edge_costs(pbqp_t *pbqp)
                        pbqp_edge_t *edge      = src_node->edges[edge_index];
                        unsigned     tgt_index = edge->tgt->index;
                        if (src_index < tgt_index) {
-                               dump_edge(pbqp->dump_file, edge);
+                               pbqp_dump_edge(pbqp->dump_file, edge);
                        }
                }
        }
        fputs("</p>", pbqp->dump_file);
 }
 
-void dump_node(FILE *file, pbqp_node_t *node)
+void pbqp_dump_node(FILE *file, pbqp_node_t *node)
 {
        if (node) {
                fprintf(file, "\tc<sub>%u</sub> = ", node->index);
@@ -136,12 +136,12 @@ static void dump_node_costs(pbqp_t *pbqp)
        /* dump node costs */
        fputs("<p>", pbqp->dump_file);
        for (index = 0; index < pbqp->num_nodes; ++index) {
-               dump_node(pbqp->dump_file, get_node(pbqp, index));
+               pbqp_dump_node(pbqp->dump_file, get_node(pbqp, index));
        }
        fputs("</p>", pbqp->dump_file);
 }
 
-void dump_section(FILE *f, int level, const char *txt)
+void pbqp_dump_section(FILE *f, int level, const char *txt)
 {
        fprintf(f, "<h%d>%s</h%d>\n", level, txt, level);
 }
@@ -188,18 +188,18 @@ void pbqp_dump_graph(pbqp_t *pbqp)
 
 void pbqp_dump_input(pbqp_t *pbqp)
 {
-       dump_section(pbqp->dump_file, 1, "1. PBQP Problem");
-       dump_section(pbqp->dump_file, 2, "1.1 Topology");
+       pbqp_dump_section(pbqp->dump_file, 1, "1. PBQP Problem");
+       pbqp_dump_section(pbqp->dump_file, 2, "1.1 Topology");
        pbqp_dump_graph(pbqp);
-       dump_section(pbqp->dump_file, 2, "1.2 Cost Vectors");
+       pbqp_dump_section(pbqp->dump_file, 2, "1.2 Cost Vectors");
        dump_node_costs(pbqp);
-       dump_section(pbqp->dump_file, 2, "1.3 Cost Matrices");
+       pbqp_dump_section(pbqp->dump_file, 2, "1.3 Cost Matrices");
        dump_edge_costs(pbqp);
 }
 
-void dump_simplifyedge(pbqp_t *pbqp, pbqp_edge_t *edge)
+void pbqp_dump_simplifyedge(pbqp_t *pbqp, pbqp_edge_t *edge)
 {
-       dump_node(pbqp->dump_file, edge->src);
-       dump_edge(pbqp->dump_file, edge);
-       dump_node(pbqp->dump_file, edge->tgt);
+       pbqp_dump_node(pbqp->dump_file, edge->src);
+       pbqp_dump_edge(pbqp->dump_file, edge);
+       pbqp_dump_node(pbqp->dump_file, edge->tgt);
 }
index 62af221..7beadf6 100644 (file)
@@ -32,11 +32,11 @@ void pbqp_dump_input(pbqp_t *pbqp);
 
 void pbqp_dump_graph(pbqp_t *pbqp);
 
-void dump_simplifyedge(pbqp_t *pbqp, pbqp_edge_t *edge);
+void pbqp_dump_simplifyedge(pbqp_t *pbqp, pbqp_edge_t *edge);
 
-void dump_section(FILE *f, int level, const char *txt);
+void pbqp_dump_section(FILE *f, int level, const char *txt);
 
-void dump_node(FILE *file, pbqp_node_t *node);
-void dump_edge(FILE *file, pbqp_edge_t *edge);
+void pbqp_dump_node(FILE *file, pbqp_node_t *node);
+void pbqp_dump_edge(FILE *file, pbqp_edge_t *edge);
 
 #endif /* KAPS_HTML_DUMPER_H */
index b5f3a0e..802534c 100644 (file)
@@ -328,7 +328,7 @@ static void merge_source_into_target(pbqp_t *pbqp, pbqp_edge_t *edge)
        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);
+               pbqp_dump_section(pbqp->dump_file, 3, txt);
        }
 #endif
 
@@ -490,7 +490,7 @@ static void merge_target_into_source(pbqp_t *pbqp, pbqp_edge_t *edge)
        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);
+               pbqp_dump_section(pbqp->dump_file, 3, txt);
        }
 #endif
 
@@ -673,7 +673,7 @@ void simplify_edge(pbqp_t *pbqp, pbqp_edge_t *edge)
        if (pbqp->dump_file) {
                char txt[100];
                sprintf(txt, "Simplification of Edge n%d-n%d", src_node->index, tgt_node->index);
-               dump_section(pbqp->dump_file, 3, txt);
+               pbqp_dump_section(pbqp->dump_file, 3, txt);
        }
 #endif
 
@@ -690,7 +690,7 @@ void simplify_edge(pbqp_t *pbqp, pbqp_edge_t *edge)
 #if KAPS_DUMP
        if (pbqp->dump_file) {
                fputs("Input:<br>\n", pbqp->dump_file);
-               dump_simplifyedge(pbqp, edge);
+               pbqp_dump_simplifyedge(pbqp, edge);
        }
 #endif
 
@@ -700,7 +700,7 @@ void simplify_edge(pbqp_t *pbqp, pbqp_edge_t *edge)
 #if KAPS_DUMP
        if (pbqp->dump_file) {
                fputs("<br>\nOutput:<br>\n", pbqp->dump_file);
-               dump_simplifyedge(pbqp, edge);
+               pbqp_dump_simplifyedge(pbqp, edge);
        }
 #endif
 
@@ -732,7 +732,7 @@ void initial_simplify_edges(pbqp_t *pbqp)
 #if KAPS_DUMP
        if (pbqp->dump_file) {
                pbqp_dump_input(pbqp);
-               dump_section(pbqp->dump_file, 1, "2. Simplification of Cost Matrices");
+               pbqp_dump_section(pbqp->dump_file, 1, "2. Simplification of Cost Matrices");
        }
 #endif
 
@@ -789,8 +789,8 @@ num determine_solution(pbqp_t *pbqp)
        file = pbqp->dump_file;
 
        if (file) {
-               dump_section(file, 1, "4. Determine Solution/Minimum");
-               dump_section(file, 2, "4.1. Trivial Solution");
+               pbqp_dump_section(file, 1, "4. Determine Solution/Minimum");
+               pbqp_dump_section(file, 2, "4.1. Trivial Solution");
        }
 #endif
 
@@ -811,14 +811,14 @@ num determine_solution(pbqp_t *pbqp)
 #if KAPS_DUMP
                if (file) {
                        fprintf(file, "node n%d is set to %d<br>\n", node->index, node->solution);
-                       dump_node(file, node);
+                       pbqp_dump_node(file, node);
                }
 #endif
        }
 
 #if KAPS_DUMP
        if (file) {
-               dump_section(file, 2, "Minimum");
+               pbqp_dump_section(file, 2, "Minimum");
 #if KAPS_USE_UNSIGNED
                fprintf(file, "Minimum is equal to %u.", solution);
 #else
@@ -948,7 +948,7 @@ void back_propagate(pbqp_t *pbqp)
 
 #if KAPS_DUMP
        if (pbqp->dump_file) {
-               dump_section(pbqp->dump_file, 2, "Back Propagation");
+               pbqp_dump_section(pbqp->dump_file, 2, "Back Propagation");
        }
 #endif
 
@@ -996,12 +996,12 @@ void apply_RI(pbqp_t *pbqp)
        if (pbqp->dump_file) {
                char     txt[100];
                sprintf(txt, "RI-Reduction of Node n%d", node->index);
-               dump_section(pbqp->dump_file, 2, txt);
+               pbqp_dump_section(pbqp->dump_file, 2, txt);
                pbqp_dump_graph(pbqp);
                fputs("<br>\nBefore reduction:<br>\n", pbqp->dump_file);
-               dump_node(pbqp->dump_file, node);
-               dump_node(pbqp->dump_file, other_node);
-               dump_edge(pbqp->dump_file, edge);
+               pbqp_dump_node(pbqp->dump_file, node);
+               pbqp_dump_node(pbqp->dump_file, other_node);
+               pbqp_dump_edge(pbqp->dump_file, edge);
        }
 #endif
 
@@ -1017,7 +1017,7 @@ void apply_RI(pbqp_t *pbqp)
 #if KAPS_DUMP
        if (pbqp->dump_file) {
                fputs("<br>\nAfter reduction:<br>\n", pbqp->dump_file);
-               dump_node(pbqp->dump_file, other_node);
+               pbqp_dump_node(pbqp->dump_file, other_node);
        }
 #endif
 
@@ -1088,14 +1088,14 @@ void apply_RII(pbqp_t *pbqp)
        if (pbqp->dump_file) {
                char     txt[100];
                sprintf(txt, "RII-Reduction of Node n%d", node->index);
-               dump_section(pbqp->dump_file, 2, txt);
+               pbqp_dump_section(pbqp->dump_file, 2, txt);
                pbqp_dump_graph(pbqp);
                fputs("<br>\nBefore reduction:<br>\n", pbqp->dump_file);
-               dump_node(pbqp->dump_file, src_node);
-               dump_edge(pbqp->dump_file, src_edge);
-               dump_node(pbqp->dump_file, node);
-               dump_edge(pbqp->dump_file, tgt_edge);
-               dump_node(pbqp->dump_file, tgt_node);
+               pbqp_dump_node(pbqp->dump_file, src_node);
+               pbqp_dump_edge(pbqp->dump_file, src_edge);
+               pbqp_dump_node(pbqp->dump_file, node);
+               pbqp_dump_edge(pbqp->dump_file, tgt_edge);
+               pbqp_dump_node(pbqp->dump_file, tgt_node);
        }
 #endif
 
@@ -1162,7 +1162,7 @@ void apply_RII(pbqp_t *pbqp)
 #if KAPS_DUMP
        if (pbqp->dump_file) {
                fputs("<br>\nAfter reduction:<br>\n", pbqp->dump_file);
-               dump_edge(pbqp->dump_file, edge);
+               pbqp_dump_edge(pbqp->dump_file, edge);
        }
 #endif