Skip to content

Commit

Permalink
fixed index-out-of-bounds bug in rank computation.
Browse files Browse the repository at this point in the history
  • Loading branch information
IngoKresse committed Jan 29, 2014
1 parent b3a9c59 commit 3578b65
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion feature_constraints/src/Analysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ int Analysis::rank(const std::vector<Constraint> &constraints,
analyzeH(Ht_, J_, lambda_, eps);

int rank=0;
for(int i=0; i < size; i++)
for(int i=0; i < size && i < 6; i++)
if(lambda_(i) > eps)
rank++;

Expand Down
2 changes: 1 addition & 1 deletion feature_constraints/src/rank_test_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
bool service_callback(constraint_msgs::ConstraintsRank::Request& request, constraint_msgs::ConstraintsRank::Response& answer)
{
Analysis analyzer(request.constraints.size());
answer.rank = analyzer.rank(fromMsg(request.constraints), 0.01, 1e-6);
answer.rank = analyzer.rank(fromMsg(request.constraints), 0.0001, 1e-6);
return true;
}

Expand Down

0 comments on commit 3578b65

Please sign in to comment.