|
6 | 6 | #include <vector>
|
7 | 7 | #include <unordered_map>
|
8 | 8 | #include <string>
|
| 9 | +#include <algorithm> |
9 | 10 | #include "AdjacencyListGraphNode.hpp"
|
10 | 11 | #include "GraphEdge.hpp"
|
11 | 12 |
|
@@ -349,17 +350,44 @@ static PyMethodDef AdjacencyListGraph_methods[] = {
|
349 | 350 |
|
350 | 351 |
|
351 | 352 | PyTypeObject AdjacencyListGraphType = {
|
352 |
| - PyVarObject_HEAD_INIT(NULL, 0) |
353 |
| - .tp_init= 0, |
354 |
| - .tp_name = "_graph.AdjacencyListGraph", |
355 |
| - .tp_basicsize = sizeof(AdjacencyListGraph), |
356 |
| - .tp_itemsize = 0, |
357 |
| - .tp_dealloc = (destructor)AdjacencyListGraph_dealloc, |
358 |
| - .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, |
359 |
| - .tp_doc = "Adjacency List Graph data structure", |
360 |
| - .tp_methods = AdjacencyListGraph_methods, |
361 |
| - .tp_new = AdjacencyListGraph_new, |
362 |
| - .tp_dictoffset = offsetof(AdjacencyListGraph, dict) |
| 353 | + PyVarObject_HEAD_INIT(NULL, 0) // ob_base |
| 354 | + "_graph.AdjacencyListGraph", // tp_name |
| 355 | + sizeof(AdjacencyListGraph), // tp_basicsize |
| 356 | + 0, // tp_itemsize |
| 357 | + (destructor)AdjacencyListGraph_dealloc, // tp_dealloc |
| 358 | + 0, // tp_vectorcall_offset or tp_print (depends on Python version) |
| 359 | + 0, // tp_getattr |
| 360 | + 0, // tp_setattr |
| 361 | + 0, // tp_as_async / tp_reserved |
| 362 | + 0, // tp_repr |
| 363 | + 0, // tp_as_number |
| 364 | + 0, // tp_as_sequence |
| 365 | + 0, // tp_as_mapping |
| 366 | + 0, // tp_hash |
| 367 | + 0, // tp_call |
| 368 | + 0, // tp_str |
| 369 | + 0, // tp_getattro |
| 370 | + 0, // tp_setattro |
| 371 | + 0, // tp_as_buffer |
| 372 | + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, // tp_flags |
| 373 | + "Adjacency List Graph data structure", // tp_doc |
| 374 | + 0, // tp_traverse |
| 375 | + 0, // tp_clear |
| 376 | + 0, // tp_richcompare |
| 377 | + 0, // tp_weaklistoffset |
| 378 | + 0, // tp_iter |
| 379 | + 0, // tp_iternext |
| 380 | + AdjacencyListGraph_methods, // tp_methods |
| 381 | + 0, // tp_members |
| 382 | + 0, // tp_getset |
| 383 | + 0, // tp_base |
| 384 | + 0, // tp_dict |
| 385 | + 0, // tp_descr_get |
| 386 | + 0, // tp_descr_set |
| 387 | + offsetof(AdjacencyListGraph, dict), // tp_dictoffset |
| 388 | + 0, // tp_init |
| 389 | + 0, // tp_alloc |
| 390 | + AdjacencyListGraph_new // tp_new |
363 | 391 | };
|
364 | 392 |
|
365 | 393 | #endif
|
0 commit comments