Skip to content

Commit

Permalink
Fix indexing bug when building edges
Browse files Browse the repository at this point in the history
  • Loading branch information
Levi Armstrong authored and Levi-Armstrong committed Feb 20, 2021
1 parent a4f486c commit d495fac
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,17 +120,17 @@ void Solver<FloatType>::build(const std::vector<typename WaypointSampler<FloatTy
const auto& to = graph_.getRung(static_cast<size_t>(i));

bool found = false;
for (std::size_t i = 0; i < from.nodes.size(); ++i)
for (std::size_t j = 0; j < from.nodes.size(); ++j)
{
for (std::size_t j = 0; j < to.nodes.size(); ++j)
for (std::size_t k = 0; k < to.nodes.size(); ++k)
{
// Consider the edge:
std::pair<bool, FloatType> results =
edge_eval[static_cast<size_t>(i - 1)]->evaluate(from.nodes[i].state, to.nodes[j].state);
edge_eval[static_cast<size_t>(i - 1)]->evaluate(from.nodes[j].state, to.nodes[k].state);
if (results.first)
{
found = true;
from.nodes[i].edges.emplace_back(results.second, j);
from.nodes[j].edges.emplace_back(results.second, k);
}
}
}
Expand Down

0 comments on commit d495fac

Please sign in to comment.