From e527fa4c0a352f2c1c873f42bf881984cc7beacf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernd=20G=C3=A4rtner?= Date: Sat, 17 Mar 2007 23:18:53 +0000 Subject: [PATCH] - U_iterator::value_type -> iterator_traits:value_type - various warnings fixed --- QP_solver/include/CGAL/QP_models.h | 2 +- QP_solver/include/CGAL/QP_solver/QP_models_impl.h | 2 +- QP_solver/include/CGAL/QP_solver/QP_solver_impl.h | 1 - .../QP_solver/QP_solver_nonstandardform_impl.h | 7 ------- .../include/CGAL/QP_solver/Unbounded_direction.h | 1 - .../test/QP_solver/master_mps_to_derivatives.cpp | 3 ++- QP_solver/test/QP_solver/test_MPS.cpp | 14 +++++++++----- 7 files changed, 13 insertions(+), 17 deletions(-) diff --git a/QP_solver/include/CGAL/QP_models.h b/QP_solver/include/CGAL/QP_models.h index 11553d09e07..f48e8c23d2a 100644 --- a/QP_solver/include/CGAL/QP_models.h +++ b/QP_solver/include/CGAL/QP_models.h @@ -58,7 +58,7 @@ typedef typename Base::U_iterator U_iterator;\ typedef typename Base::D_iterator D_iterator;\ typedef typename Base::C_iterator C_iterator;\ - typedef typename Base::C_entry C_entry; + typedef typename Base::C_entry C_entry // end QP_MODEL_ITERATOR_TYPES diff --git a/QP_solver/include/CGAL/QP_solver/QP_models_impl.h b/QP_solver/include/CGAL/QP_solver/QP_models_impl.h index 3367df52dd3..34db079caad 100644 --- a/QP_solver/include/CGAL/QP_solver/QP_models_impl.h +++ b/QP_solver/include/CGAL/QP_solver/QP_models_impl.h @@ -179,7 +179,7 @@ bool QP_from_mps::original_variable_value_under_bounds(int i) const switch (x_O_v_i[i]) { case UPPER: return qp_u[i]; - break; case ZERO: return et0; - break; case LOWER: case FIXED: return qp_l[i]; - break; case BASIC: CGAL_qpe_assertion(false); } @@ -64,17 +61,13 @@ ET QP_solver::variable_numerator_value(int i) const switch (x_O_v_i[i]) { case QP::UPPER: return ET(qp_u[i]) * d; - break; case QP::ZERO: return et0; - break; case QP::LOWER: case QP::FIXED: return ET(qp_l[i]) * d; - break; case QP::BASIC: return x_B_O[in_B[i]]; - break; default: // never reached return et0; } diff --git a/QP_solver/include/CGAL/QP_solver/Unbounded_direction.h b/QP_solver/include/CGAL/QP_solver/Unbounded_direction.h index 1738afec352..5e0c79d3519 100644 --- a/QP_solver/include/CGAL/QP_solver/Unbounded_direction.h +++ b/QP_solver/include/CGAL/QP_solver/Unbounded_direction.h @@ -34,7 +34,6 @@ ET QP_solver::unbounded_direction_value(int i) const return direction == 1 ? -d : d; return et0; } - return et0; } CGAL_END_NAMESPACE diff --git a/QP_solver/test/QP_solver/master_mps_to_derivatives.cpp b/QP_solver/test/QP_solver/master_mps_to_derivatives.cpp index 948b826b199..ebc62550507 100644 --- a/QP_solver/test/QP_solver/master_mps_to_derivatives.cpp +++ b/QP_solver/test/QP_solver/master_mps_to_derivatives.cpp @@ -109,7 +109,8 @@ void write_MPS(std::ostream& out, // output header: if (number_type.length() == 0) { const char *tn = QP_from_mps_detail::MPS_type_name - ::name(); + ::value_type>::name(); if (tn != 0) out << "* Number-type: " << tn << "\n"; } else diff --git a/QP_solver/test/QP_solver/test_MPS.cpp b/QP_solver/test/QP_solver/test_MPS.cpp index c14763ee907..36ba4688812 100644 --- a/QP_solver/test/QP_solver/test_MPS.cpp +++ b/QP_solver/test/QP_solver/test_MPS.cpp @@ -69,9 +69,11 @@ int main(const int argNr,const char **args) { CGAL::print_quadratic_program (cout, qp); cout << std::endl; } - - typedef CGAL::Quadratic_program_solution Solution; - Solution s = CGAL::solve_quadratic_program (qp, ET(0)); + typedef CGAL::QP_solver_impl::QP_tags Tags; + CGAL::QP_pricing_strategy *pricing_strategy = + new CGAL::QP_partial_filtered_pricing; + typedef CGAL::QP_solver Solver; + Solver s (qp, pricing_strategy, 1); if (s.is_valid()) { cout << "Solution is valid." << endl; @@ -87,8 +89,8 @@ int main(const int argNr,const char **args) { s.solution() << endl; cout << "Variable values:" << endl; - Solution::Variable_value_iterator it - = s.variable_values_begin() ; + Solver::Variable_value_iterator it + = s.original_variable_values_begin() ; for (int i=0; i < qp.n(); ++it, ++i) cout << " " << qp.name_of_variable(i) << " = " << CGAL::to_double(*it) << endl; @@ -98,5 +100,7 @@ int main(const int argNr,const char **args) { cout << "Problem is infeasible." << endl; else // unbounded cout << "Problem is unbounded." << endl; + + delete pricing_strategy; return 0; }