Skip to content

Commit 008e922

Browse files
committed
use std_vector more and getting NOT_IMPLEMENTING in C:\dev\z3\src\math\lp\dioph_eq.cpp
Signed-off-by: Lev Nachmanson <[email protected]>
1 parent 57b665d commit 008e922

15 files changed

+33
-37
lines changed

src/math/lp/dioph_eq.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ namespace lp {
328328
public:
329329
imp(int_solver& lia, lar_solver& lra) : lia(lia), lra(lra) {
330330
lra.register_add_term_delegate([this](const lar_term*t){add_term_delegate(t);});
331+
lra.register_add_column_bound_delegate([this](unsigned j) {add_column_bound_delegate(j);});
331332
}
332333
term_o get_term_from_entry(unsigned i) const {
333334
term_o t;
@@ -395,15 +396,10 @@ namespace lp {
395396
}
396397

397398
void init() {
398-
m_e_matrix = static_matrix<mpq, mpq>();
399399
m_report_branch = false;
400-
m_k2s.clear();
401-
m_fresh_definitions.clear();
402400
m_conflict_index = -1;
403401
m_infeas_explanation.clear();
404402
lia.get_term().clear();
405-
m_entries.clear();
406-
m_var_register.clear();
407403
m_number_of_iterations = 0;
408404
m_branch_stack.clear();
409405
m_lra_level = 0;
@@ -1071,7 +1067,6 @@ namespace lp {
10711067
if (m_branch_stack.size() == 0) {
10721068
lra.stats().m_dio_branching_infeasibles++;
10731069
transfer_explanations_from_closed_branches();
1074-
enable_trace("dioph_eq");
10751070
return lia_move::conflict;
10761071
}
10771072
TRACE("dio_br", tout << lp_status_to_string(lra.get_status()) << std::endl;
@@ -1393,7 +1388,7 @@ namespace lp {
13931388
m_e_matrix.add_new_element(fresh_row, i, q);
13941389
}
13951390

1396-
m_k2s.resize(std::max(k + 1, xt + 1), -1);
1391+
m_k2s.resize(k + 1, -1);
13971392
m_k2s[k] = fresh_row;
13981393
m_fresh_definitions.resize(xt + 1, -1);
13991394
m_fresh_definitions[xt] = fresh_row;

src/math/lp/int_solver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ namespace lp {
668668
return display_row(out, row);
669669
}
670670

671-
std::ostream & int_solver::display_row(std::ostream & out, vector<row_cell<rational>> const & row) const {
671+
std::ostream & int_solver::display_row(std::ostream & out, std_vector<row_cell<rational>> const & row) const {
672672
return m_imp->display_row(out, row);
673673
}
674674

src/math/lp/int_solver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class int_solver {
8989

9090
bool shift_var(unsigned j, unsigned range);
9191
std::ostream& display_row_info(std::ostream & out, unsigned row_index) const;
92-
std::ostream & display_row(std::ostream & out, vector<row_cell<rational>> const & row) const;
92+
std::ostream & display_row(std::ostream & out, std_vector<row_cell<rational>> const & row) const;
9393
bool is_term(unsigned j) const;
9494
unsigned column_count() const;
9595
int select_int_infeasible_var();

src/math/lp/lar_core_solver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class lar_core_solver {
3434
stacked_vector<unsigned> m_r_pushed_basis;
3535
vector<unsigned> m_r_basis;
3636
vector<unsigned> m_r_nbasis;
37-
vector<int> m_r_heading;
37+
std_vector<int> m_r_heading;
3838

3939

4040
lp_primal_core_solver<mpq, numeric_pair<mpq>> m_r_solver; // solver in rational numbers

src/math/lp/lar_solver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ class lar_solver : public column_namer {
684684
bool ax_is_correct() const;
685685
bool get_equality_and_right_side_for_term_on_current_x(lpvar j, mpq& rs, u_dependency*& ci, bool& upper_bound) const;
686686
bool var_is_int(lpvar v) const;
687-
inline const vector<int>& r_heading() const { return m_mpq_lar_core_solver.m_r_heading; }
687+
inline const std_vector<int>& r_heading() const { return m_mpq_lar_core_solver.m_r_heading; }
688688
inline const vector<unsigned>& r_basis() const { return m_mpq_lar_core_solver.r_basis(); }
689689
inline const vector<unsigned>& r_nbasis() const { return m_mpq_lar_core_solver.r_nbasis(); }
690690
inline bool column_is_real(unsigned j) const { return !column_is_int(j); }

src/math/lp/lp_core_solver_base.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ template void lp::lp_core_solver_base<lp::mpq, lp::numeric_pair<lp::mpq> >::init
3030
template void lp::lp_core_solver_base<lp::mpq, lp::numeric_pair<lp::mpq> >::init_basis_heading_and_non_basic_columns_vector();
3131
template lp::lp_core_solver_base<lp::mpq, lp::numeric_pair<lp::mpq> >::lp_core_solver_base(lp::static_matrix<lp::mpq, lp::numeric_pair<lp::mpq> >&,
3232
// vector<lp::numeric_pair<lp::mpq> >&,
33-
vector<unsigned int >&, vector<unsigned> &, vector<int> &, vector<lp::numeric_pair<lp::mpq> >&, vector<lp::mpq>&, lp::lp_settings&, const column_namer&, const vector<lp::column_type >&,
33+
vector<unsigned int >&, vector<unsigned> &, std_vector<int> &, vector<lp::numeric_pair<lp::mpq> >&, vector<lp::mpq>&, lp::lp_settings&, const column_namer&, const vector<lp::column_type >&,
3434
const vector<lp::numeric_pair<lp::mpq> >&,
3535
const vector<lp::numeric_pair<lp::mpq> >&);
3636

@@ -39,7 +39,8 @@ template lp::lp_core_solver_base<lp::mpq, lp::mpq>::lp_core_solver_base(
3939
lp::static_matrix<lp::mpq, lp::mpq>&,
4040
//vector<lp::mpq>&,
4141
vector<unsigned int >&,
42-
vector<unsigned> &, vector<int> &,
42+
vector<unsigned> &,
43+
std_vector<int> &,
4344
vector<lp::mpq>&,
4445
vector<lp::mpq>&,
4546
lp::lp_settings&,

src/math/lp/lp_core_solver_base.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class lp_core_solver_base {
7979
// vector<X> const & m_b; // the right side
8080
vector<unsigned> & m_basis;
8181
vector<unsigned>& m_nbasis;
82-
vector<int>& m_basis_heading;
82+
std_vector<int>& m_basis_heading;
8383
vector<X> & m_x; // a feasible solution, the first time set in the constructor
8484
vector<T> & m_costs;
8585
lp_settings & m_settings;
@@ -124,7 +124,7 @@ class lp_core_solver_base {
124124
//vector<X> & b, // the right side vector
125125
vector<unsigned> & basis,
126126
vector<unsigned> & nbasis,
127-
vector<int> & heading,
127+
std_vector<int> & heading,
128128
vector<X> & x,
129129
vector<T> & costs,
130130
lp_settings & settings,
@@ -516,8 +516,8 @@ class lp_core_solver_base {
516516
}
517517

518518

519-
template <typename K>
520-
static void swap(vector<K> &v, unsigned i, unsigned j) noexcept {
519+
template <typename T>
520+
void swap(T &v, unsigned i, unsigned j) noexcept {
521521
auto t = v[i];
522522
v[i] = v[j];
523523
v[j] = t;

src/math/lp/lp_core_solver_base_def.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ lp_core_solver_base(static_matrix<T, X> & A,
3131
// vector<X> & b, // the right side vector
3232
vector<unsigned> & basis,
3333
vector<unsigned> & nbasis,
34-
vector<int> & heading,
34+
std_vector<int> & heading,
3535
vector<X> & x,
3636
vector<T> & costs,
3737
lp_settings & settings,

src/math/lp/lp_primal_core_solver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ namespace lp {
640640
vector<X> &b, // the right side vector
641641
vector<X> &x, // the number of elements in x needs to be at least as large
642642
// as the number of columns in A
643-
vector<unsigned> &basis, vector<unsigned> &nbasis, vector<int> &heading,
643+
vector<unsigned> &basis, vector<unsigned> &nbasis, std_vector<int> &heading,
644644
vector<T> &costs, const vector<column_type> &column_type_array,
645645
const vector<X> &lower_bound_values, const vector<X> &upper_bound_values,
646646
lp_settings &settings, const column_namer &column_names)

src/math/lp/nla_common.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,4 +127,4 @@ template <typename T> void common::create_sum_from_row(const T& row,
127127

128128

129129
}
130-
template void nla::common::create_sum_from_row<vector<lp::row_cell<rational>, true, unsigned int> >(vector<lp::row_cell<rational>, true, unsigned int> const&, nla::nex_creator&, nla::nex_creator::sum_factory&, u_dependency*&);
130+
template void nla::common::create_sum_from_row<std_vector<lp::row_cell<rational>> >(std_vector<lp::row_cell<rational>> const&, nla::nex_creator&, nla::nex_creator::sum_factory&, u_dependency*&);

0 commit comments

Comments
 (0)