mirror of
				https://github.com/Z3Prover/z3
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	union_find::reserve
This commit is contained in:
		
							parent
							
								
									e8e64d3098
								
							
						
					
					
						commit
						5d858da58a
					
				
					 2 changed files with 6 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -192,7 +192,7 @@ public:
 | 
			
		|||
            m_set(&s), m_index(at_end?s.get_max_elem():0), m_last(s.get_max_elem()) {
 | 
			
		||||
            scan();
 | 
			
		||||
            SASSERT(invariant());
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
        unsigned operator*() const { return m_index; }
 | 
			
		||||
        bool operator==(iterator const& it) const { return m_index == it.m_index; }
 | 
			
		||||
        bool operator!=(iterator const& it) const { return m_index != it.m_index; }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -93,6 +93,11 @@ public:
 | 
			
		|||
        return r;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void reserve(unsigned v) {
 | 
			
		||||
        while (get_num_vars() <= v)
 | 
			
		||||
            mk_var();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    unsigned get_num_vars() const { return m_find.size(); }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue