summaryrefslogtreecommitdiffhomepage
path: root/ir/kaps
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2016-06-27 09:05:01 +0200
committerMatthias Braun <matze@braunis.de>2016-06-27 09:17:15 +0200
commit73698854f7c98cab6293b57706d378b2182bb599 (patch)
tree953aec4dd3de8ccb33f88438ae59da72f34aad2f /ir/kaps
parent02a3b1647e34c9a7df3a260ed5f5dc17eba79e54 (diff)
Use ARR_F and deq_t instead of plist
Diffstat (limited to 'ir/kaps')
-rw-r--r--ir/kaps/heuristical_co.c17
-rw-r--r--ir/kaps/heuristical_co.h4
-rw-r--r--ir/kaps/heuristical_co_ld.c17
-rw-r--r--ir/kaps/heuristical_co_ld.h4
4 files changed, 20 insertions, 22 deletions
diff --git a/ir/kaps/heuristical_co.c b/ir/kaps/heuristical_co.c
index 0de7538..577ef10 100644
--- a/ir/kaps/heuristical_co.c
+++ b/ir/kaps/heuristical_co.c
@@ -27,21 +27,20 @@
#include "pbqp_node_t.h"
#include "vector.h"
-#include "plist.h"
+#include "pdeq_new.h"
#include "timing.h"
-static void merge_into_RN_node(pbqp_t *pbqp, plist_t *rpeo)
+static void merge_into_RN_node(pbqp_t *pbqp, deq_t *rpeo)
{
pbqp_node_t *node;
/* We want to reduce the first node in reverse perfect elimination order. */
do {
/* get first element from reverse perfect elimination order */
- node = (pbqp_node_t *)plist_first(rpeo)->data;
- /* remove element from reverse perfect elimination order */
- plist_erase(rpeo, plist_first(rpeo));
- /* insert node at the end of rpeo so the rpeo already exits after pbqp solving */
- plist_insert_back(rpeo, node);
+ node = deq_pop_pointer_left(pbqp_node_t, rpeo);
+ /* insert node at the end of rpeo so the rpeo already exits after pbqp
+ * solving */
+ deq_push_pointer_right(rpeo, node);
} while (node_is_reduced(node));
assert(pbqp_node_get_degree(node) > 2);
@@ -86,7 +85,7 @@ static void apply_RN_co(pbqp_t *pbqp)
select_alternative(node, min_index);
}
-static void apply_heuristic_reductions_co(pbqp_t *pbqp, plist_t *rpeo)
+static void apply_heuristic_reductions_co(pbqp_t *pbqp, deq_t *rpeo)
{
#if KAPS_TIMING
/* create timers */
@@ -160,7 +159,7 @@ static void apply_heuristic_reductions_co(pbqp_t *pbqp, plist_t *rpeo)
}
}
-void solve_pbqp_heuristical_co(pbqp_t *pbqp, plist_t *rpeo)
+void solve_pbqp_heuristical_co(pbqp_t *pbqp, deq_t *rpeo)
{
#ifndef NDEBUG
assert(pbqp);
diff --git a/ir/kaps/heuristical_co.h b/ir/kaps/heuristical_co.h
index 38f2560..21fda68 100644
--- a/ir/kaps/heuristical_co.h
+++ b/ir/kaps/heuristical_co.h
@@ -14,8 +14,8 @@
#include "pbqp_t.h"
-#include "plist.h"
+#include "deq.h"
-void solve_pbqp_heuristical_co(pbqp_t *pbqp, plist_t *rpeo);
+void solve_pbqp_heuristical_co(pbqp_t *pbqp, deq_t *rpeo);
#endif
diff --git a/ir/kaps/heuristical_co_ld.c b/ir/kaps/heuristical_co_ld.c
index 66b7eff..cad287b 100644
--- a/ir/kaps/heuristical_co_ld.c
+++ b/ir/kaps/heuristical_co_ld.c
@@ -21,7 +21,7 @@
#include "pbqp_node_t.h"
#include "vector.h"
-#include "plist.h"
+#include "pdeq_new.h"
#include "timing.h"
static void back_propagate_RI(pbqp_t *pbqp, pbqp_node_t *node)
@@ -170,17 +170,16 @@ static void back_propagate_ld(pbqp_t *pbqp)
}
}
-static void merge_into_RN_node(pbqp_t *pbqp, plist_t *rpeo)
+static void merge_into_RN_node(pbqp_t *pbqp, deq_t *rpeo)
{
pbqp_node_t *node;
do {
/* get last element from reverse perfect elimination order */
- node = (pbqp_node_t *)plist_last(rpeo)->data;
- /* remove element from reverse perfect elimination order */
- plist_erase(rpeo, plist_last(rpeo));
- /* insert node at the beginning of rpeo so the rpeo already exits after pbqp solving */
- plist_insert_front(rpeo, node);
+ node = deq_pop_pointer_right(pbqp_node_t, rpeo);
+ /* insert node at the beginning of rpeo so the rpeo already exits after
+ * pbqp solving */
+ deq_push_pointer_left(rpeo, node);
} while (node_is_reduced(node));
assert(pbqp_node_get_degree(node) > 2);
@@ -234,7 +233,7 @@ static void apply_RN_co_without_selection(pbqp_t *pbqp)
node_bucket_insert(&reduced_bucket, node);
}
-static void apply_heuristic_reductions_co(pbqp_t *pbqp, plist_t *rpeo)
+static void apply_heuristic_reductions_co(pbqp_t *pbqp, deq_t *rpeo)
{
#if KAPS_TIMING
/* create timers */
@@ -308,7 +307,7 @@ static void apply_heuristic_reductions_co(pbqp_t *pbqp, plist_t *rpeo)
}
}
-void solve_pbqp_heuristical_co_ld(pbqp_t *pbqp, plist_t *rpeo)
+void solve_pbqp_heuristical_co_ld(pbqp_t *pbqp, deq_t *rpeo)
{
#ifndef NDEBUG
assert(pbqp);
diff --git a/ir/kaps/heuristical_co_ld.h b/ir/kaps/heuristical_co_ld.h
index 651c167..a42eda3 100644
--- a/ir/kaps/heuristical_co_ld.h
+++ b/ir/kaps/heuristical_co_ld.h
@@ -6,8 +6,8 @@
#define HEURISTICAL_CO_LD_H_
#include "pbqp_t.h"
-#include "plist.h"
+#include "deq.h"
-void solve_pbqp_heuristical_co_ld(pbqp_t *pbqp, plist_t *rpeo);
+void solve_pbqp_heuristical_co_ld(pbqp_t *pbqp, deq_t *rpeo);
#endif