3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-07-19 02:42:02 +00:00

some renaming in nla_solver

Signed-off-by: Lev <levnach@hotmail.com>
This commit is contained in:
Lev 2018-10-08 16:45:34 -07:00 committed by Lev Nachmanson
parent 540ea825b0
commit ce48605d99

View file

@ -26,8 +26,6 @@
namespace nla { namespace nla {
struct solver::imp { struct solver::imp {
typedef lp::lar_base_constraint lpcon; typedef lp::lar_base_constraint lpcon;
@ -40,13 +38,13 @@ struct solver::imp {
}; };
vars_equivalence m_vars_equivalence; vars_equivalence m_vars_equivalence;
vector<monomial> m_monomials; vector<monomial> m_monomials;
// maps the vector of the rooted monomial vars to the list of the indices of monomials having the same rooted monomial // maps the vector of the rooted monomial vars to the list of the indices of monomials having the same rooted monomial
std::unordered_map<svector<lpvar>, vector<mono_index_with_sign>, hash_svector> std::unordered_map<svector<lpvar>, vector<mono_index_with_sign>, hash_svector>
m_rooted_monomials; m_rooted_monomials;
unsigned_vector m_monomials_lim; unsigned_vector m_monomials_lim;
lp::lar_solver& m_lar_solver; lp::lar_solver& m_lar_solver;
std::unordered_map<lpvar, unsigned_vector> m_var_to_mon_indices; std::unordered_map<lpvar, unsigned_vector> m_var_containing_monomials;
// monomial.var() -> monomial index // monomial.var() -> monomial index
u_map<unsigned> m_var_to_its_monomial; u_map<unsigned> m_var_to_its_monomial;
@ -228,7 +226,7 @@ struct solver::imp {
// otherwise it remains false // otherwise it remains false
// Returns 2 if the sign is not defined. // Returns 2 if the sign is not defined.
int get_mon_sign_zero_var(unsigned j, bool & strict) { int get_mon_sign_zero_var(unsigned j, bool & strict) {
if (m_var_to_mon_indices.find(j) == m_var_to_mon_indices.end()) if (m_var_containing_monomials.find(j) == m_var_containing_monomials.end())
return 2; return 2;
lpci lci = -1; lpci lci = -1;
lpci uci = -1; lpci uci = -1;
@ -1116,11 +1114,11 @@ struct solver::imp {
void map_monomial_vars_to_monomial_indices(unsigned i) { void map_monomial_vars_to_monomial_indices(unsigned i) {
const monomial& m = m_monomials[i]; const monomial& m = m_monomials[i];
for (lpvar j : m.vars()) { for (lpvar j : m.vars()) {
auto it = m_var_to_mon_indices.find(j); auto it = m_var_containing_monomials.find(j);
if (it == m_var_to_mon_indices.end()) { if (it == m_var_containing_monomials.end()) {
unsigned_vector v; unsigned_vector v;
v.push_back(i); v.push_back(i);
m_var_to_mon_indices[j] = v; m_var_containing_monomials[j] = v;
} }
else { else {
it->second.push_back(i); it->second.push_back(i);