src/LPSolver.cpp
// TODO: better lookup (hash waypoints to indices maybe?)
better lookup (hash waypoints to indices maybe?)
better lookup ( hash waypoints to indices maybe? )
size_t LPSolver::perchStateToIndex(PerchState s)
{
  for (size_t i = 0; i < perch_states.size(); i ++)
  {
    if (perch_states[i].perched == s.perched && perch_states[i].waypoint.x == s.waypoint.x
        && perch_states[i].waypoint.y == s.waypoint.y && perch_states[i].waypoint.z == s.waypoint.z)
    {
      return i;
    }
  }
  return perch_states.size();  
}
size_t LPSolver :: perchStateToIndex ( PerchState s ) { for ( size_t i = 0 ; i < perch_states . size ( ) ; i ++ ) { if ( perch_states [ i ] . perched == s . perched && perch_states [ i ] . waypoint . x == s . waypoint . x && perch_states [ i ] . waypoint . y == s . waypoint . y && perch_states [ i ] . waypoint . z == s . waypoint . z ) { return i ; } } return perch_states . size ( ) ; }
TODO: better lookup (hash waypoints to indices maybe?)
TODO : better lookup ( hash waypoints to indices maybe? )
// error case, waypoint not found in list