@@ -3563,24 +3563,22 @@ PyObject *igraphmodule_Graph_SBM(PyTypeObject * type,
35633563{
35643564 igraphmodule_GraphObject *self;
35653565 igraph_t g;
3566- Py_ssize_t n;
35673566 PyObject *block_sizes_o, *pref_matrix_o;
35683567 PyObject *directed_o = Py_False;
35693568 PyObject *loops_o = Py_False;
3569+ PyObject *multiple_o = Py_False;
35703570 igraph_matrix_t pref_matrix;
35713571 igraph_vector_int_t block_sizes;
35723572
3573- static char *kwlist[] = { "n", " pref_matrix", "block_sizes", "directed",
3574- "loops", NULL };
3573+ static char *kwlist[] = { "pref_matrix", "block_sizes", "directed",
3574+ "loops", "multiple", NULL };
35753575
3576- if (!PyArg_ParseTupleAndKeywords(args, kwds, "nOO|OO ", kwlist,
3577- &n, & pref_matrix_o,
3576+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "OO|OOO ", kwlist,
3577+ &pref_matrix_o,
35783578 &block_sizes_o,
3579- &directed_o, &loops_o))
3579+ &directed_o, &loops_o, &multiple_o ))
35803580 return NULL;
35813581
3582- CHECK_SSIZE_T_RANGE(n, "vertex count");
3583-
35843582 if (igraphmodule_PyObject_to_matrix_t(pref_matrix_o, &pref_matrix, "pref_matrix")) {
35853583 return NULL;
35863584 }
@@ -3590,7 +3588,7 @@ PyObject *igraphmodule_Graph_SBM(PyTypeObject * type,
35903588 return NULL;
35913589 }
35923590
3593- if (igraph_sbm_game(&g, n, &pref_matrix, &block_sizes, PyObject_IsTrue(directed_o), PyObject_IsTrue(loops_o))) {
3591+ if (igraph_sbm_game(&g, &pref_matrix, &block_sizes, PyObject_IsTrue(directed_o), PyObject_IsTrue(loops_o), PyObject_IsTrue(multiple_o ))) {
35943592 igraphmodule_handle_igraph_error();
35953593 igraph_matrix_destroy(&pref_matrix);
35963594 igraph_vector_int_destroy(&block_sizes);
@@ -14760,13 +14758,15 @@ struct PyMethodDef igraphmodule_Graph_methods[] = {
1476014758 "vertex pair is evaluated and an edge is created between them with a\n"
1476114759 "probability depending on the types of the vertices involved. The\n"
1476214760 "probabilities are taken from the preference matrix.\n\n"
14763- "@param n: the number of vertices in the graph\n"
1476414761 "@param pref_matrix: matrix giving the connection probabilities for\n"
14765- " different vertex types.\n"
14762+ " different vertex types (when C{multiple} = C{False}) or the expected\n"
14763+ " number of edges between a vertex pair (when C{multiple} = C{True}).\n"
1476614764 "@param block_sizes: list giving the number of vertices in each block; must\n"
1476714765 " sum up to I{n}.\n"
1476814766 "@param directed: whether to generate a directed graph.\n"
14769- "@param loops: whether loop edges are allowed.\n"},
14767+ "@param loops: whether loop edges are allowed.\n"
14768+ "@param multiple: whether multiple edges are allowed.\n"
14769+ },
1477014770
1477114771 // interface to igraph_star
1477214772 {"Star", (PyCFunction) igraphmodule_Graph_Star,
@@ -16279,18 +16279,11 @@ struct PyMethodDef igraphmodule_Graph_methods[] = {
1627916279 },
1628016280
1628116281 /* interface to igraph_rewire */
16282- {"rewire ", (PyCFunction) igraphmodule_Graph_rewire,
16282+ {"_rewire ", (PyCFunction) igraphmodule_Graph_rewire,
1628316283 METH_VARARGS | METH_KEYWORDS,
16284- "rewire(n=None, allowed_edge_types=\"simple\")\n--\n\n"
16285- "Randomly rewires the graph while preserving the degree distribution.\n\n"
16286- "The rewiring is done \"in-place\", so the original graph will be modified.\n"
16287- "If you want to preserve the original graph, use the L{copy} method before\n"
16288- "rewiring.\n\n"
16289- "@param n: the number of rewiring trials. The default is 10 times the number\n"
16290- " of edges.\n"
16291- "@param allowed_edge_types: the rewiring algorithm to use. It can either be C{\"simple\"} or\n"
16292- " C{\"loops\"}; the former does not create or destroy loop edges while the\n"
16293- " latter does.\n"},
16284+ "_rewire(n=None, allowed_edge_types=\"simple\")\n--\n\n"
16285+ "Internal function, undocumented.\n\n"
16286+ "@see: Graph.rewire()\n\n"},
1629416287
1629516288 /* interface to igraph_rewire_edges */
1629616289 {"rewire_edges", (PyCFunction) igraphmodule_Graph_rewire_edges,
0 commit comments