Skip to content

Commit

Permalink
change type of m_ibounds to std::vector
Browse files Browse the repository at this point in the history
  • Loading branch information
levnach committed Sep 17, 2023
1 parent 30b743d commit 66f6a03
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/math/lp/lp_bound_propagator.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class lp_bound_propagator {
std::unordered_map<unsigned, unsigned> m_improved_upper_bounds;

T& m_imp;
vector<implied_bound> m_ibounds;
std::vector<implied_bound> m_ibounds;

map<mpq, unsigned, obj_hash<mpq>, default_eq<mpq>> m_val2fixed_row;
// works for rows of the form x + y + sum of fixed = 0
Expand Down Expand Up @@ -109,12 +109,12 @@ class lp_bound_propagator {
public:
lp_bound_propagator(T& imp) : m_imp(imp) {}

const vector<implied_bound>& ibounds() const { return m_ibounds; }
const std::vector<implied_bound>& ibounds() const { return m_ibounds; }

void init() {
m_improved_upper_bounds.clear();
m_improved_lower_bounds.clear();
m_ibounds.reset();
m_ibounds.clear();
m_column_types = &lp().get_column_types();
}

Expand Down Expand Up @@ -151,7 +151,7 @@ class lp_bound_propagator {
TRACE("add_bound", lp().print_column_info(j, tout) << std::endl;);
j = lp().column_to_reported_index(j);
if (!try_get_value(m_improved_lower_bounds, j, k)) {
m_improved_lower_bounds[j] = m_ibounds.size();
m_improved_lower_bounds[j] = static_cast<unsigned>(m_ibounds.size());
m_ibounds.push_back(implied_bound(v, j, true, is_strict, explain_dep));
} else {
auto& found_bound = m_ibounds[k];
Expand All @@ -166,7 +166,7 @@ class lp_bound_propagator {
j = lp().column_to_reported_index(j);
unsigned k;
if (!try_get_value(m_improved_upper_bounds, j, k)) {
m_improved_upper_bounds[j] = m_ibounds.size();
m_improved_upper_bounds[j] = static_cast<unsigned>(m_ibounds.size());
m_ibounds.push_back(implied_bound(bound_val, j, false, is_strict, explain_bound));
} else {
auto& found_bound = m_ibounds[k];
Expand Down Expand Up @@ -333,7 +333,7 @@ class lp_bound_propagator {
TRACE("add_bound", lp().print_implied_bound(found_bound, tout););
}
} else {
m_improved_lower_bounds[j] = m_ibounds.size();
m_improved_lower_bounds[j] = static_cast<unsigned>(m_ibounds.size());
m_ibounds.push_back(implied_bound(v, j, is_low, strict, explain_bound));
TRACE("add_bound", lp().print_implied_bound(m_ibounds.back(), tout););
}
Expand All @@ -347,7 +347,7 @@ class lp_bound_propagator {
TRACE("add_bound", lp().print_implied_bound(found_bound, tout););
}
} else {
m_improved_upper_bounds[j] = m_ibounds.size();
m_improved_upper_bounds[j] = static_cast<unsigned>(m_ibounds.size());
m_ibounds.push_back(implied_bound(v, j, is_low, strict, explain_bound));
TRACE("add_bound", lp().print_implied_bound(m_ibounds.back(), tout););
}
Expand Down

0 comments on commit 66f6a03

Please sign in to comment.