Commit 98b6059 1 parent 8bd289d commit 98b6059 Copy full SHA for 98b6059
File tree 1 file changed +11
-2
lines changed
libgalois/include/galois/graphs
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -186,12 +186,21 @@ class LS_LC_CSR_Graph : private boost::noncopyable {
186
186
return m_vertices.size () - 1 ;
187
187
}
188
188
189
+ /* *
190
+ * Adds multiple vertices to the graph. The new vertices will be assigned
191
+ * consecutive topology IDs, and the lowest new ID is returned.
192
+ */
193
+ VertexTopologyID addVerticesTopologyOnly (size_t count) {
194
+ VertexTopologyID const start = m_vertices.size ();
195
+ m_vertices.resize (start + count);
196
+ return start;
197
+ }
198
+
189
199
// Adds multiple vertices to the graph. The new vertices will be assigned
190
200
// consecutive topology IDs, and the lowest new ID is returned.
191
201
template <typename V = VertexData, typename = std::enable_if<HasVertexData>>
192
202
VertexTopologyID addVertices (std::vector<V> data) {
193
- VertexTopologyID const start = m_vertices.size ();
194
- m_vertices.resize (m_vertices.size () + data.size ());
203
+ auto const start = addVerticesTopologyOnly (data.size ());
195
204
m_vertex_data.resize (m_vertices.size ());
196
205
resetPrefixSum ();
197
206
galois::do_all (
You can’t perform that action at this time.
0 commit comments