* Remove the edge between two vertices. * @param [in] vertex_1 one vertex of the edge * @param [in] vertex_2 another vertex of the edge */
| 109 | * @param [in] vertex_2 another vertex of the edge |
| 110 | */ |
| 111 | void removeEdge(const int& vertex_1, const int& vertex_2) { |
| 112 | if (vertex_1 >= adj_list_.size() || vertex_2 >= adj_list_.size()) { |
| 113 | TEASER_DEBUG_ERROR_MSG("Trying to remove non-existent edge."); |
| 114 | return; |
| 115 | } |
| 116 | |
| 117 | adj_list_[vertex_1].erase( |
| 118 | std::remove(adj_list_[vertex_1].begin(), adj_list_[vertex_1].end(), vertex_2), |
| 119 | adj_list_[vertex_1].end()); |
| 120 | adj_list_[vertex_2].erase( |
| 121 | std::remove(adj_list_[vertex_2].begin(), adj_list_[vertex_2].end(), vertex_1), |
| 122 | adj_list_[vertex_2].end()); |
| 123 | |
| 124 | num_edges_--; |
| 125 | } |
| 126 | |
| 127 | /** |
| 128 | * Get the number of vertices |