3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-25 10:05:32 +00:00

prepare for std::vector

This commit is contained in:
Nikolaj Bjorner 2021-04-20 09:24:16 -07:00
parent 831afa8124
commit 770c79a939
12 changed files with 146 additions and 33 deletions

View file

@ -1010,7 +1010,7 @@ namespace dd {
m_todo.push_back(p);
while (!m_todo.empty()) {
PDD r = m_todo.back();
if (is_marked(r))
if (is_marked(r))
m_todo.pop_back();
else if (is_val(r))
m_todo.pop_back();
@ -1025,8 +1025,10 @@ namespace dd {
max_d = std::max(d, max_d);
m_todo.pop_back();
}
else
m_todo.push_back(lo(r)).push_back(hi(r));
else {
m_todo.push_back(lo(r));
m_todo.push_back(hi(r));
}
}
return max_d;
}

View file

@ -89,7 +89,7 @@ class hilbert_basis {
reslimit& m_limit;
vector<num_vector> m_ineqs; // set of asserted inequalities
bool_vector m_iseq; // inequalities that are equalities
num_vector m_store; // store of vectors
mutable num_vector m_store; // store of vectors
svector<offset_t> m_basis; // vector of current basis
svector<offset_t> m_free_list; // free list of unused storage
svector<offset_t> m_active; // active set

View file

@ -4096,7 +4096,7 @@ namespace polynomial {
// select a new random value in GF(p) that is not in vals, and store it in r
void peek_fresh(scoped_numeral_vector const & vals, unsigned p, scoped_numeral & r) {
SASSERT(vals.size() < p); // otherwise we can't keep the fresh value
unsigned sz = vals.size();
auto sz = vals.size();
while (true) {
m().set(r, rand() % p);
// check if fresh value...
@ -6240,7 +6240,7 @@ namespace polynomial {
}
void reset() {
unsigned sz = m_xs.size();
auto sz = m_xs.size();
for (unsigned i = 0; i < sz; i++) {
m_max_degree[m_xs[i]] = 0;
}

View file

@ -2126,7 +2126,7 @@ namespace upolynomial {
}
frame_stack.push_back(drs_frame(parent_idx, sz, true));
// right child
translate(sz, p_stack.end() - sz, p_aux);
translate(sz, p_stack.data() + p_stack.size() - sz, p_aux);
normalize(p_aux);
for (unsigned i = 0; i < sz; i++) {
p_stack.push_back(numeral());
@ -2226,7 +2226,7 @@ namespace upolynomial {
drs_frame & fr = frame_stack.back();
unsigned sz = fr.m_size;
SASSERT(sz <= p_stack.size());
numeral const * p = p_stack.end() - sz;
numeral const * p = p_stack.data() + p_stack.size() - sz;
TRACE("upolynomial", tout << "processing frame #" << frame_stack.size() - 1 << "\n"
<< "first: " << fr.m_first << ", left: " << fr.m_left << ", sz: " << fr.m_size << ", parent_idx: ";
if (fr.m_parent_idx == UINT_MAX) tout << "<null>"; else tout << fr.m_parent_idx;