mirror of
https://github.com/Z3Prover/z3
synced 2025-04-10 03:07:07 +00:00
make explicit rational(double)constructor
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
parent
057151c7a8
commit
885d640301
|
@ -214,7 +214,7 @@ public:
|
|||
if (m_A.m_columns[bj].size() > 1)
|
||||
return true;
|
||||
for (const auto & c : m_A.m_columns[bj]) {
|
||||
if (m_A.get_val(c) != one_of_type<mpq>())
|
||||
if (m_A.get_val(c) != one_of_type<T>())
|
||||
return true;
|
||||
else
|
||||
break;
|
||||
|
|
|
@ -561,7 +561,7 @@ template <typename T, typename X> void lp_solver<T, X>::set_scaled_cost(unsigned
|
|||
column_info<T> * ci = this->m_map_from_var_index_to_column_info[this->m_core_solver_columns_to_external_columns[j]];
|
||||
T cost = ci->get_cost();
|
||||
if (ci->is_flipped()){
|
||||
cost *= -1;
|
||||
cost *= T(-1);
|
||||
}
|
||||
lp_assert(ci->is_fixed() == false);
|
||||
this->m_costs[j] = cost * this->m_column_scale[j];
|
||||
|
|
|
@ -221,15 +221,15 @@ template <typename T, typename X> void scaler<T, X>::scale_row(unsigned i) {
|
|||
}
|
||||
if (row_max < m_scaling_minimum) {
|
||||
do {
|
||||
alpha *= 2;
|
||||
row_max *= 2;
|
||||
alpha *= T(2);
|
||||
row_max *= T(2);
|
||||
} while (row_max < m_scaling_minimum);
|
||||
m_A.multiply_row(i, alpha);
|
||||
m_b[i] *= alpha;
|
||||
} else if (row_max > m_scaling_maximum) {
|
||||
do {
|
||||
alpha /= 2;
|
||||
row_max /= 2;
|
||||
alpha /= T(2);
|
||||
row_max /= T(2);
|
||||
} while (row_max > m_scaling_maximum);
|
||||
m_A.multiply_row(i, alpha);
|
||||
m_b[i] *= alpha;
|
||||
|
@ -245,13 +245,13 @@ template <typename T, typename X> void scaler<T, X>::scale_column(unsigned i)
|
|||
}
|
||||
if (column_max < m_scaling_minimum) {
|
||||
do {
|
||||
alpha *= 2;
|
||||
column_max *= 2;
|
||||
alpha *= T(2);
|
||||
column_max *= T(2);
|
||||
} while (column_max < m_scaling_minimum);
|
||||
} else if (column_max > m_scaling_maximum) {
|
||||
do {
|
||||
alpha /= 2;
|
||||
column_max /= 2;
|
||||
alpha /= T(2);
|
||||
column_max /= T(2);
|
||||
} while (column_max > m_scaling_maximum);
|
||||
} else {
|
||||
return;
|
||||
|
|
|
@ -53,7 +53,7 @@ public:
|
|||
|
||||
rational(mpz const & z) { m().set(m_val, z); }
|
||||
|
||||
rational(double z) { UNREACHABLE(); }
|
||||
explicit rational(double z) { UNREACHABLE(); }
|
||||
|
||||
explicit rational(char const * v) { m().set(m_val, v); }
|
||||
|
||||
|
|
Loading…
Reference in a new issue