Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions R/aaa-auto.R
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,7 @@ full_bipartite_impl <- function(n1, n2, directed=FALSE, mode=c("all", "out", "in
on.exit( .Call(R_igraph_finalizer) )
# Function call
res <- .Call(R_igraph_full_bipartite, n1, n2, directed, mode)
if (igraph_opt("add.vertex.names") && is_named(graph)) {
names(res$types) <- vertex_attr(graph, "name")
}

res
}

Expand Down
20 changes: 3 additions & 17 deletions src/rinterface.c
Original file line number Diff line number Diff line change
Expand Up @@ -912,18 +912,14 @@ SEXP R_igraph_adjlist(SEXP adjlist, SEXP mode, SEXP duplicate) {
SEXP R_igraph_full_bipartite(SEXP n1, SEXP n2, SEXP directed, SEXP mode) {
/* Declarations */
igraph_t c_graph;
igraph_vector_bool_t c_types;
igraph_integer_t c_n1;
igraph_integer_t c_n2;
igraph_bool_t c_directed;
igraph_neimode_t c_mode;
SEXP graph;
SEXP types;

SEXP r_result, r_names;
SEXP r_result;
/* Convert input */
IGRAPH_R_CHECK(igraph_vector_bool_init(&c_types, 0));
IGRAPH_FINALLY(igraph_vector_bool_destroy, &c_types);
IGRAPH_R_CHECK_INT(n1);
c_n1 = (igraph_integer_t) REAL(n1)[0];
IGRAPH_R_CHECK_INT(n2);
Expand All @@ -932,24 +928,14 @@ SEXP R_igraph_full_bipartite(SEXP n1, SEXP n2, SEXP directed, SEXP mode) {
c_directed = LOGICAL(directed)[0];
c_mode = (igraph_neimode_t) Rf_asInteger(mode);
/* Call igraph */
IGRAPH_R_CHECK(igraph_full_bipartite(&c_graph, &c_types, c_n1, c_n2, c_directed, c_mode));
IGRAPH_R_CHECK(igraph_full_bipartite(&c_graph, c_n1, c_n2, c_directed, c_mode));

/* Convert output */
PROTECT(r_result=NEW_LIST(2));
PROTECT(r_names=NEW_CHARACTER(2));
IGRAPH_FINALLY(igraph_destroy, &c_graph);
PROTECT(graph=R_igraph_to_SEXP(&c_graph));
IGRAPH_I_DESTROY(&c_graph);
IGRAPH_FINALLY_CLEAN(1);
PROTECT(types=R_igraph_vector_bool_to_SEXP(&c_types));
igraph_vector_bool_destroy(&c_types);
IGRAPH_FINALLY_CLEAN(1);
SET_VECTOR_ELT(r_result, 0, graph);
SET_VECTOR_ELT(r_result, 1, types);
SET_STRING_ELT(r_names, 0, Rf_mkChar("graph"));
SET_STRING_ELT(r_names, 1, Rf_mkChar("types"));
SET_NAMES(r_result, r_names);
UNPROTECT(3);
r_result = graph;

UNPROTECT(1);
return(r_result);
Expand Down
3 changes: 1 addition & 2 deletions src/vendor/cigraph/interfaces/functions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,8 @@ igraph_adjlist:

igraph_full_bipartite:
PARAMS: |-
OUT GRAPH graph, OPTIONAL OUT ALL_BIPARTITE_TYPES types, INTEGER n1,
OUT GRAPH graph, INTEGER n1,
INTEGER n2, BOOLEAN directed=False, NEIMODE mode=ALL
DEPS: types ON graph

igraph_full_multipartite:
PARAMS: |-
Expand Down
Loading