Commit 06ff5369 authored by Jan Möbius's avatar Jan Möbius
Browse files

Fixed some cppcheck warnings

git-svn-id: http://www.openflipper.org/svnrepo/CoMISo/trunk@147 1355f012-dd97-4b2f-ae87-10fa9f823a57
parent 3bbfe4ca
...@@ -198,7 +198,7 @@ solve(NProblemInterface* _problem, ...@@ -198,7 +198,7 @@ solve(NProblemInterface* _problem,
std::cout << "GUROBI Objective: " << model.get(GRB_DoubleAttr_ObjVal) << std::endl; std::cout << "GUROBI Objective: " << model.get(GRB_DoubleAttr_ObjVal) << std::endl;
return true; return true;
} }
catch(GRBException e) catch(GRBException& e)
{ {
std::cout << "Error code = " << e.getErrorCode() << std::endl; std::cout << "Error code = " << e.getErrorCode() << std::endl;
std::cout << e.getMessage() << std::endl; std::cout << e.getMessage() << std::endl;
......
...@@ -524,7 +524,7 @@ MISolver::solve_multiple_rounding( ...@@ -524,7 +524,7 @@ MISolver::solve_multiple_rounding(
time_search_next_integer += sw.stop(); time_search_next_integer += sw.stop();
// nothing more to do? // nothing more to do?
if( tr_best.size() == 0) if( tr_best.empty() )
break; break;
if( noisy_ > 5) if( noisy_ > 5)
...@@ -668,7 +668,7 @@ MISolver::solve_gurobi( ...@@ -668,7 +668,7 @@ MISolver::solve_gurobi(
std::cout << "GUROBI objective: " << model.get(GRB_DoubleAttr_ObjVal) << std::endl; std::cout << "GUROBI objective: " << model.get(GRB_DoubleAttr_ObjVal) << std::endl;
} }
catch(GRBException e) catch(GRBException& e)
{ {
std::cout << "Error code = " << e.getErrorCode() << std::endl; std::cout << "Error code = " << e.getErrorCode() << std::endl;
std::cout << e.getMessage() << std::endl; std::cout << e.getMessage() << std::endl;
......
...@@ -230,7 +230,7 @@ public: ...@@ -230,7 +230,7 @@ public:
bool add( int _id, double _rd_val) bool add( int _id, double _rd_val)
{ {
// empty set? -> always add one element // empty set? -> always add one element
if( rset_.size() == 0 || cur_sum_+_rd_val <= threshold_) if( rset_.empty() || cur_sum_+_rd_val <= threshold_)
{ {
rset_.insert( PairDI(_rd_val,_id) ); rset_.insert( PairDI(_rd_val,_id) );
cur_sum_ += _rd_val; cur_sum_ += _rd_val;
......
...@@ -168,8 +168,6 @@ bool UMFPACKSolver::update_system( const std::vector<int>& _colptr, ...@@ -168,8 +168,6 @@ bool UMFPACKSolver::update_system( const std::vector<int>& _colptr,
rowind_ = _rowind; rowind_ = _rowind;
values_ = _values; values_ = _values;
int n = colptr_.size()-1;
if( numeric_ ) if( numeric_ )
{ {
umfpack_di_free_numeric( &numeric_); umfpack_di_free_numeric( &numeric_);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment