diff --git a/src/math/lp/lp_core_solver_base.cpp b/src/math/lp/lp_core_solver_base.cpp index 90101e998f..b76976d371 100644 --- a/src/math/lp/lp_core_solver_base.cpp +++ b/src/math/lp/lp_core_solver_base.cpp @@ -61,7 +61,6 @@ template lp::lp_core_solver_base >::lp_core_s const vector >&, const vector >&); template bool lp::lp_core_solver_base >::print_statistics_with_cost_and_check_that_the_time_is_over(lp::numeric_pair, std::ostream&); -template void lp::lp_core_solver_base >::snap_xN_to_bounds_and_fill_xB(); template void lp::lp_core_solver_base >::solve_Ax_eq_b(); template void lp::lp_core_solver_base >::add_delta_to_entering(unsigned int, const lp::numeric_pair&); diff --git a/src/math/lp/lp_core_solver_base.h b/src/math/lp/lp_core_solver_base.h index e54c884891..c9b42f28be 100644 --- a/src/math/lp/lp_core_solver_base.h +++ b/src/math/lp/lp_core_solver_base.h @@ -74,7 +74,7 @@ class lp_core_solver_base { vector & m_x; // a feasible solution, the fist time set in the constructor vector & m_costs; lp_settings & m_settings; - lu> * m_factorization = nullptr; + vector m_y; // the buffer for yB = cb // a device that is able to solve Bx=c, xB=d, and change the basis const column_namer & m_column_names; @@ -134,7 +134,7 @@ class lp_core_solver_base { void init(); virtual ~lp_core_solver_base() { - delete m_factorization; + } vector & non_basis() { @@ -413,9 +413,6 @@ class lp_core_solver_base { } - void snap_non_basic_x_to_bound_and_free_to_zeroes(); - void snap_xN_to_bounds_and_fill_xB(); - non_basic_column_value_position get_non_basic_column_value_position(unsigned j) const; diff --git a/src/math/lp/lp_core_solver_base_def.h b/src/math/lp/lp_core_solver_base_def.h index bc902e8b05..01aa9802e8 100644 --- a/src/math/lp/lp_core_solver_base_def.h +++ b/src/math/lp/lp_core_solver_base_def.h @@ -554,52 +554,8 @@ find_error_in_BxB(vector& rs){ // recalculates the projection of x to B, such that Ax = b template void lp_core_solver_base:: solve_Ax_eq_b() { - if (numeric_traits::precise()) { - vector rs(m_m()); - rs_minus_Anx(rs); - m_factorization->solve_By(rs); - copy_rs_to_xB(rs); - } - else { - vector rs(m_m()); - rs_minus_Anx(rs); - vector rrs = rs; // another copy of rs - m_factorization->solve_By(rs); - copy_rs_to_xB(rs); - find_error_in_BxB(rrs); - m_factorization->solve_By(rrs); - add_delta_to_xB(rrs); - } -} - - - - -template void lp_core_solver_base:: -snap_non_basic_x_to_bound_and_free_to_zeroes() { - for (unsigned j : non_basis()) { - lp_assert(j < m_x.size()); - switch (m_column_types[j]) { - case column_type::fixed: - case column_type::boxed: - case column_type::lower_bound: - m_x[j] = m_lower_bounds[j]; - break; - case column_type::upper_bound: - m_x[j] = m_upper_bounds[j]; - break; - default: - m_x[j] = zero_of_type(); - break; - } - } + lp_assert(false); } -template void lp_core_solver_base:: -snap_xN_to_bounds_and_fill_xB() { - snap_non_basic_x_to_bound(); - solve_Ax_eq_b(); -} - template non_basic_column_value_position lp_core_solver_base:: diff --git a/src/math/lp/lp_primal_core_solver_def.h b/src/math/lp/lp_primal_core_solver_def.h index 19ffaa1ead..7764ce6d2d 100644 --- a/src/math/lp/lp_primal_core_solver_def.h +++ b/src/math/lp/lp_primal_core_solver_def.h @@ -642,11 +642,7 @@ template void lp_primal_core_solver::init_run( template void lp_primal_core_solver::calc_working_vector_beta_for_column_norms(){ - lp_assert(numeric_traits::precise() == false); - lp_assert(this->m_ed.is_OK()); - lp_assert(m_beta.is_OK()); - m_beta = this->m_ed; - this->m_factorization->solve_yB_with_error_check_indexed(m_beta, this->m_basis_heading, this->m_basis, this->m_settings); + lp_assert(false); } template @@ -758,10 +754,7 @@ template unsigned lp_primal_core_solver::solve() } template void lp_primal_core_solver::delete_factorization() { - if (this->m_factorization != nullptr) { - delete this->m_factorization; - this->m_factorization = nullptr; - } + lp_assert(false); } // according to Swietanowski, " A new steepest edge approximation for the simplex method for linear programming" @@ -776,15 +769,7 @@ template void lp_primal_core_solver::init_column_ // debug only template T lp_primal_core_solver::calculate_column_norm_exactly(unsigned j) { - lp_assert(numeric_traits::precise() == false); - indexed_vector w(this->m_m()); - this->m_A.copy_column_to_vector(j, w); - vector d(this->m_m()); - this->m_factorization->solve_Bd_when_w_is_ready(d, w); - T ret = zero_of_type(); - for (auto v : d) - ret += v*v; - return ret+1; + lp_assert(false); } template void lp_primal_core_solver::update_or_init_column_norms(unsigned entering, unsigned leaving) {