Skip to content

Commit

Permalink
var_queue display
Browse files Browse the repository at this point in the history
  • Loading branch information
JakobR authored and NikolajBjorner committed Aug 1, 2022
1 parent 6a929f9 commit e31926d
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/util/var_queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class var_queue {

void mk_var_eh(var v) {
m_queue.reserve(v+1);
m_queue.insert(v);
unassign_var_eh(v);
}

void del_var_eh(var v) {
Expand All @@ -76,5 +76,21 @@ class var_queue {
var min_var() { SASSERT(!empty()); return m_queue.min_value(); }

bool more_active(var v1, var v2) const { return m_queue.less_than(v1, v2); }

std::ostream& display(std::ostream& out) const {
bool first = true;
for (auto v : m_queue) {
if (first) {
first = false;
} else {
out << " ";
}
out << v;
}
return out;
}
};

inline std::ostream& operator<<(std::ostream& out, var_queue const& queue) {
return queue.display(out);
}

0 comments on commit e31926d

Please sign in to comment.