Skip to content
Merged
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
24 changes: 12 additions & 12 deletions R/aaa-auto.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
# Generated by make -f Makefile-cigraph, do not edit by hand
# styler: off

empty_impl <- function(n=0, directed=TRUE) {
# Argument checks
n <- as.numeric(n)
directed <- as.logical(directed)

on.exit( .Call(R_igraph_finalizer) )
# Function call
res <- .Call(R_igraph_empty, n, directed)

res
}

copy_impl <- function(from) {
# Argument checks
ensure_igraph(from)
Expand Down Expand Up @@ -36,18 +48,6 @@ vcount_impl <- function(graph) {
res
}

empty_attrs_impl <- function(n, directed) {
# Argument checks
n <- as.numeric(n)
directed <- as.logical(directed)

on.exit( .Call(R_igraph_finalizer) )
# Function call
res <- .Call(R_igraph_empty_attrs, n, directed)

res
}

get_all_eids_between_impl <- function(graph, from, to, directed=TRUE) {
# Argument checks
ensure_igraph(graph)
Expand Down
20 changes: 1 addition & 19 deletions R/make.R
Original file line number Diff line number Diff line change
Expand Up @@ -698,25 +698,7 @@ undirected_graph <- function(...) constructor_spec(make_undirected_graph, ...)
#' @examples
#' make_empty_graph(n = 10)
#' make_empty_graph(n = 5, directed = FALSE)
make_empty_graph <- function(n = 0, directed = TRUE) {
# Argument checks
if (is.null(n)) {
stop("number of vertices must be an integer")
}

n <- suppressWarnings(as.numeric(n))
if (is.na(n)) {
stop("number of vertices must be an integer")
}

directed <- as.logical(directed)

on.exit(.Call(R_igraph_finalizer))
# Function call
res <- .Call(R_igraph_empty, n, directed)

res
}
make_empty_graph <- empty_impl

#' @rdname make_empty_graph
#' @param ... Passed to `make_graph_empty`.
Expand Down
2 changes: 0 additions & 2 deletions src/cpp11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ extern SEXP R_igraph_edges(void *, void *);
extern SEXP R_igraph_eigen_adjacency(void *, void *, void *, void *);
extern SEXP R_igraph_eigenvector_centrality(void *, void *, void *, void *, void *);
extern SEXP R_igraph_empty(void *, void *);
extern SEXP R_igraph_empty_attrs(void *, void *);
extern SEXP R_igraph_erdos_renyi_game(void *, void *, void *, void *, void *);
extern SEXP R_igraph_es_adj(void *, void *, void *, void *);
extern SEXP R_igraph_es_pairs(void *, void *, void *);
Expand Down Expand Up @@ -616,7 +615,6 @@ static const R_CallMethodDef CallEntries[] = {
{"R_igraph_eigen_adjacency", (DL_FUNC) &R_igraph_eigen_adjacency, 4},
{"R_igraph_eigenvector_centrality", (DL_FUNC) &R_igraph_eigenvector_centrality, 5},
{"R_igraph_empty", (DL_FUNC) &R_igraph_empty, 2},
{"R_igraph_empty_attrs", (DL_FUNC) &R_igraph_empty_attrs, 2},
{"R_igraph_erdos_renyi_game", (DL_FUNC) &R_igraph_erdos_renyi_game, 5},
{"R_igraph_es_adj", (DL_FUNC) &R_igraph_es_adj, 4},
{"R_igraph_es_pairs", (DL_FUNC) &R_igraph_es_pairs, 3},
Expand Down
31 changes: 0 additions & 31 deletions src/rinterface.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,37 +162,6 @@ SEXP R_igraph_vcount(SEXP graph) {
return(r_result);
}

/*-------------------------------------------/
/ igraph_empty_attrs /
/-------------------------------------------*/
SEXP R_igraph_empty_attrs(SEXP n, SEXP directed) {
/* Declarations */
igraph_t c_graph;
igraph_integer_t c_n;
igraph_bool_t c_directed;

SEXP graph;

SEXP r_result;
/* Convert input */
IGRAPH_R_CHECK_INT(n);
c_n = (igraph_integer_t) REAL(n)[0];
IGRAPH_R_CHECK_BOOL(directed);
c_directed = LOGICAL(directed)[0];
/* Call igraph */
IGRAPH_R_CHECK(igraph_empty_attrs(&c_graph, c_n, c_directed, 0));

/* Convert output */
IGRAPH_FINALLY(igraph_destroy, &c_graph);
PROTECT(graph=R_igraph_to_SEXP(&c_graph));
IGRAPH_I_DESTROY(&c_graph);
IGRAPH_FINALLY_CLEAN(1);
r_result = graph;

UNPROTECT(1);
return(r_result);
}

/*-------------------------------------------/
/ igraph_get_all_eids_between /
/-------------------------------------------*/
Expand Down
7 changes: 4 additions & 3 deletions tools/stimulus/functions-R.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
#######################################

igraph_empty:
IGNORE: RR

# Not needed in R, we use igraph_emtpy() instead
igraph_empty_attrs:
IGNORE: RR, RC
Comment thread
szhorvat marked this conversation as resolved.

igraph_add_edges:
IGNORE: RR, RC, RInit
Expand Down Expand Up @@ -49,8 +52,6 @@ igraph_edge:
igraph_edges:
IGNORE: RR, RC

igraph_empty_attrs:

igraph_get_eid:
IGNORE: RR, RC, RInit

Expand Down