4 #include "../util/Matrix.h"
37 std::size_t lbs = 0, ubs = 0;
38 std::size_t ignored_lbs = 0, ignored_ubs = 0;
41 if (col_it->value < 0) {
42 if (
ignored.contains(col_it.row())) ++ignored_lbs;
45 if (
ignored.contains(col_it.row())) ++ignored_ubs;
49 if (lbs == 0 || ubs == 0) {
55 std::size_t min_j = std::min(lbs-ignored_lbs, ubs-ignored_ubs);
56 if (min_j < min_branches) {
70 for (; col_it != col_end; ++col_it) {
71 if (ign_it !=
ignored.end() && *ign_it == col_it.row()) ++ign_it;
72 else if (col_it->value < 0)
eliminators.push_back(col_it.row());
76 for (; col_it != col_end; ++col_it){
77 if (ign_it !=
ignored.end() && *ign_it == col_it.row()) ++ign_it;
78 else if (col_it->value > 0)
eliminators.push_back(col_it.row());
82 for (; col_it != col_end; ++col_it){
111 Node(
const Matrix& m,
const std::vector<ColIndex>& cols,
const std::set<RowIndex>& ign)
130 std::ostream&
print_vec(std::ostream& os,
const std::vector<T>& vec) {
131 os <<
"[" << vec.size() <<
": ";
132 for (
const auto& t : vec) os << t <<
", ";
138 os <<
"\n========== NODE ============\n";
141 case Type::CONFLICT: os <<
"CONFLICT\n";
return os;
142 case Type::LEAF: os <<
"Leaf\n";
return os;
143 case Type::LBS: os <<
"LBS";
break;
144 case Type::UBS: os <<
"UBS";
break;
145 case Type::NBS: os <<
"NBS";
break;
146 case Type::FM: os <<
"FM";
break;
147 case Type::UNDETERMINED: os <<
"Undet.";
break;
149 os <<
"| Chose col " << n.
chosen_col <<
" out of ";
152 os <<
"Total n. rows:" << n.
matrix.
n_rows() <<
", Eliminators: ";
156 std::vector<qe::util::Matrix::RowEntry> es;
161 os <<
"============================\n";
col_iterator col_end(ColIndex c) const
std::size_t n_rows() const
col_iterator col_begin(ColIndex c) const
row_view row_entries(const RowIndex ri) const
std::ostream & operator<<(std::ostream &os, const smtrat::qe::fmplex::Node &n)
std::ostream & print_vec(std::ostream &os, const std::vector< T > &vec)
Matrix::RowIndex RowIndex
void choose_elimination()
bool is_suitable_for_splitting()
Matrix::ColIndex ColIndex
std::vector< ColIndex > cols_to_elim
Node(const Matrix &m, const std::vector< ColIndex > &cols, const std::set< RowIndex > &ign)
std::set< RowIndex > ignored
Node(const Matrix &m, const std::vector< ColIndex > &cols)
Node(Matrix &&m, const std::vector< ColIndex > &cols)
std::vector< RowIndex > eliminators