mirror of
https://github.com/Z3Prover/z3
synced 2025-08-03 18:00:23 +00:00
Refactor pivot rules
This commit is contained in:
parent
97dfb6d521
commit
3b2dd47cd4
5 changed files with 47 additions and 29 deletions
|
@ -420,14 +420,15 @@ namespace smt {
|
|||
|
||||
template<typename Ext>
|
||||
void basic_spanning_tree<Ext>::initialize(svector<edge_id> const & tree) {
|
||||
unsigned num_nodes = m_graph.get_num_nodes();
|
||||
m_tree_graph = alloc(graph);
|
||||
m_tree = tree;
|
||||
unsigned num_nodes = m_graph.get_num_nodes();
|
||||
for (unsigned i = 0; i < num_nodes; ++i) {
|
||||
m_tree_graph->init_var(i);
|
||||
}
|
||||
|
||||
vector<edge> const & es = m_graph.get_all_edges();
|
||||
svector<edge_id>::const_iterator it = tree.begin(), end = tree.end();
|
||||
svector<edge_id>::const_iterator it = m_tree.begin(), end = m_tree.end();
|
||||
for(; it != end; ++it) {
|
||||
edge const & e = es[*it];
|
||||
m_tree_graph->add_edge(e.get_source(), e.get_target(), e.get_weight(), explanation());
|
||||
|
@ -440,8 +441,7 @@ namespace smt {
|
|||
|
||||
template<typename Ext>
|
||||
void basic_spanning_tree<Ext>::update(edge_id enter_id, edge_id leave_id) {
|
||||
if (m_tree_graph)
|
||||
dealloc(m_tree_graph);
|
||||
if (m_tree_graph) dealloc(m_tree_graph);
|
||||
m_tree_graph = alloc(graph);
|
||||
unsigned num_nodes = m_graph.get_num_nodes();
|
||||
for (unsigned i = 0; i < num_nodes; ++i) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue