Skip to content

Commit 1d6616a

Browse files
make var-queue a template
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
1 parent 156426a commit 1d6616a

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/sat/sat_solver.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ namespace sat {
164164
unsigned m_rephase_inc;
165165
backoff m_rephase;
166166
backoff m_reorder;
167-
var_queue m_case_split_queue;
167+
var_queue<unsigned_vector> m_case_split_queue;
168168
unsigned m_qhead;
169169
unsigned m_scope_lvl;
170170
unsigned m_search_lvl;

src/util/var_queue.h

+8-7
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,20 @@ Revision History:
2121
#include "util/heap.h"
2222

2323

24-
24+
template <class ActivityVector>
2525
class var_queue {
2626
typedef unsigned var;
2727

2828
struct lt {
29-
svector<unsigned> & m_activity;
30-
lt(svector<unsigned> & act):m_activity(act) {}
29+
ActivityVector & m_activity;
30+
lt(ActivityVector & act):m_activity(act) {}
3131
bool operator()(var v1, var v2) const { return m_activity[v1] > m_activity[v2]; }
3232
};
3333
heap<lt> m_queue;
34-
public:
3534

35+
public:
3636

37-
var_queue(svector<unsigned> & act):m_queue(128, lt(act)) {}
37+
var_queue(ActivityVector & act):m_queue(128, lt(act)) {}
3838

3939
void activity_increased_eh(var v) {
4040
if (m_queue.contains(v))
@@ -90,11 +90,12 @@ class var_queue {
9090
return out;
9191
}
9292

93-
using const_iterator = decltype(m_queue)::const_iterator;
93+
using const_iterator = const int *;
9494
const_iterator begin() const { return m_queue.begin(); }
9595
const_iterator end() const { return m_queue.end(); }
9696
};
9797

98-
inline std::ostream& operator<<(std::ostream& out, var_queue const& queue) {
98+
template <typename T>
99+
inline std::ostream& operator<<(std::ostream& out, var_queue<T> const& queue) {
99100
return queue.display(out);
100101
}

0 commit comments

Comments
 (0)