Skip to content

Commit

Permalink
Fix clang warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-moulard committed Sep 28, 2013
1 parent 70b41d9 commit eb9c71a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/nag-nlp-sparse.cc
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ namespace roboptim
it (j, k); it; ++it)
g_[offset++] = it.value ();

unsigned constraintId = 0;
NagSolverNlpSparse::function_t::size_type constraintId = 0;
for (iter_t it = solver->problem ().constraints ().begin ();
it != solver->problem ().constraints ().end ();
++it, ++constraintId)
Expand Down Expand Up @@ -331,10 +331,11 @@ namespace roboptim

for (Function::size_type i = 0; i < g->outputSize (); ++i)
{
std::size_t i_ = static_cast<std::size_t> (i);
flow_[offset] =
problem ().boundsVector ()[constraintId][i].first;
problem ().boundsVector ()[constraintId][i_].first;
fupp_[offset] =
problem ().boundsVector ()[constraintId][i].second;
problem ().boundsVector ()[constraintId][i_].second;
++offset;
}
}
Expand All @@ -355,13 +356,14 @@ namespace roboptim

for (function_t::size_type i = 0; i < g->outputSize (); ++i)
{
std::size_t i_ = static_cast<std::size_t> (i);
// warning: we shift bounds here.
flow_[offset] =
problem ().boundsVector ()
[constraintId][i].first - g->b ()[i];
[constraintId][i_].first - g->b ()[i];
fupp_[offset] =
problem ().boundsVector ()
[constraintId][i].second - g->b ()[i];
[constraintId][i_].second - g->b ()[i];
++offset;
}
}
Expand Down

0 comments on commit eb9c71a

Please sign in to comment.