mirror of
https://github.com/Z3Prover/z3
synced 2025-04-28 19:35:50 +00:00
avoid patching vars in powers
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
commit
ec1f449d34
15 changed files with 160 additions and 96 deletions
|
@ -16,6 +16,7 @@
|
|||
#include "util/vector.h"
|
||||
#include "math/lp/lar_solver.h"
|
||||
#include "math/lp/nla_defs.h"
|
||||
#include <algorithm>
|
||||
namespace nla {
|
||||
|
||||
class mon_eq {
|
||||
|
@ -38,7 +39,15 @@ public:
|
|||
unsigned size() const { return m_vs.size(); }
|
||||
const svector<lp::var_index>& vars() const { return m_vs; }
|
||||
bool empty() const { return m_vs.empty(); }
|
||||
|
||||
bool is_sorted() const {
|
||||
for (unsigned i = 0; i + 1 < size(); i++)
|
||||
if (m_vs[i] > m_vs[i + 1])
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
bool contains_var(lpvar j) const {
|
||||
return std::binary_search(m_vs.begin(), m_vs.end(), j);
|
||||
}
|
||||
protected:
|
||||
svector<lp::var_index>& vars1() { return m_vs; }
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue