9 std::size_t n_deleted_rows = parent.
eliminators.size();
16 std::set<RowIndex> ignore;
17 auto ignore_it = parent.
ignored.begin();
20 if (col_it != col_end && r == *col_it) ++col_it;
24 if (it != parent.
ignored.end()) {
25 ignore.emplace_hint(ignore.end(), new_matr.
n_rows());
34 return Node(new_matr, new_cols, ignore);
59 std::set<RowIndex> ignore;
60 auto ignore_it = parent.
ignored.begin();
62 bool local_conflict =
false;
63 bool inserted =
false;
67 Rational scale_elim = elim_sgn*col_it->value;
69 auto combined_row = parent.
matrix.
combine(eliminator, scale_elim, r, scale_r);
75 new_matr.
append_row(combined_row.begin(), combined_row.end());
84 else local_conflict =
true;
93 for (
RowIndex r = 0; r < eliminator; ++r) {
94 if (r == col_it.row()) {
101 if (ignore_it != parent.
ignored.end() && r == *ignore_it) {
102 if (inserted) ignore.insert(new_matr.
n_rows() - 1);
108 if ((col_it != col_end) && (r == col_it.row())) {
115 if (ignore_it != parent.
ignored.end() && r == *ignore_it) {
116 if (inserted) ignore.insert(new_matr.
n_rows() - 1);
121 parent.
ignored.insert(eliminator);
124 return Node(new_matr, new_cols, ignore);
130 std::vector<RowIndex> lbs, ubs;
134 for (; col_it != col_end; ++col_it) {
135 if (col_it->value < 0) lbs.push_back(col_it.row());
136 else ubs.push_back(col_it.row());
143 auto combined_row = parent.
matrix.
combine(l, coeff_u, u, coeff_l);
158 std::vector<bool> col_used(n.
cols_to_elim.size(),
false);
159 std::vector<bool> row_used(m.
n_rows(),
false);
160 std::size_t n_unused_rows = m.
n_rows();
162 std::vector<std::size_t> pending;
165 for (std::size_t root_col = 0; root_col < n.
cols_to_elim.size();) {
166 pending.push_back(root_col);
169 while (!pending.empty()) {
170 std::size_t cur_col = pending.back();
173 if (col_used[cur_col])
continue;
174 col_used[cur_col] =
true;
177 result.back().cols_to_elim.push_back(c);
179 for (
auto it = m.
col_begin(c), col_end = m.
col_end(c); it != col_end; ++it) {
180 if (row_used[it.row()])
continue;
183 if (e.col_index == c)
continue;
184 for (std::size_t j = 0; ; ++j) {
187 pending.push_back(j);
192 row_used[it.row()] =
true;
194 if (n.
ignored.count(it.row()) > 0) {
195 result.back().ignored.insert(
result.back().matrix.n_rows());
201 while (root_col < n.
cols_to_elim.size() && col_used[root_col]) ++root_col;
ColIndex m_first_parameter_col
bool is_trivial(const Row &row) const
bool is_positive_combination(const Row &row) const
std::vector< Node > split_into_independent_nodes(const Node &n) const
Matrix::ColIndex ColIndex
bool fm_elimination(Node &parent)
void collect_constraint(const Row &row)
bool is_global_conflict(const Row &row) const
bool is_conflict(const Row &row) const
Node bounded_elimination(Node &parent)
Matrix::RowIndex RowIndex
Node unbounded_elimination(Node &parent)
Rational coeff(const RowIndex i, const ColIndex j) const
col_iterator col_begin(ColIndex c) const
col_iterator col_end(ColIndex c) const
std::size_t non_zeros_total() const
std::vector< RowEntry > combine(const RowIndex row_idx_1, const Rational &scale_1, const RowIndex row_idx_2, const Rational &scale_2) const
Computes scale_1*A_(i,-) + scale_2*A_(j,-) where i=row_idx_1, j=row_idx_2.
std::size_t n_cols() const
row_view row_entries(const RowIndex ri) const
row_iterator row_end(RowIndex r) const
void reserve(std::size_t n)
row_iterator row_begin(RowIndex r) const
RowIndex append_row(const It &begin, const It &end)
Appends the row contained in the range between begin and end to the matrix.
std::size_t n_rows() const
static bool find(V &ts, const T &t)
void gcd_normalize(std::vector< typename Matrix::RowEntry > &row)
Numeric abs(const Numeric &_value)
Calculates the absolute value of the given Numeric.
std::vector< ColIndex > cols_to_elim
void choose_elimination()
std::vector< RowIndex > eliminators
std::set< RowIndex > ignored