Skip to content

Commit

Permalink
fix: temporarily disable generating an interface for `igraph_simple_c…
Browse files Browse the repository at this point in the history
…ycles_callback()`

as the framework for handling callback functions is not yet present
  • Loading branch information
szhorvat authored and krlmlr committed Nov 7, 2024
1 parent a8469f6 commit 34bcf0c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 44 deletions.
14 changes: 0 additions & 14 deletions R/aaa-auto.R
Original file line number Diff line number Diff line change
Expand Up @@ -3598,20 +3598,6 @@ simple_cycles_impl <- function(graph, mode=c("out", "in", "all", "total"), max.c
res
}

simple_cycles_callback_impl <- function(graph, mode=c("out", "in", "all", "total"), max.cycle.length=-1, cycle.handler) {
# Argument checks
ensure_igraph(graph)
mode <- switch(igraph.match.arg(mode), "out"=1L, "in"=2L, "all"=3L, "total"=3L)
max.cycle.length <- as.numeric(max.cycle.length)

on.exit( .Call(R_igraph_finalizer) )
# Function call
res <- .Call(R_igraph_simple_cycles_callback, graph, mode, max.cycle.length, cycle.handler)


res
}

is_eulerian_impl <- function(graph) {
# Argument checks
ensure_igraph(graph)
Expand Down
2 changes: 0 additions & 2 deletions src/cpp11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,6 @@ extern SEXP R_igraph_similarity_jaccard(SEXP, SEXP, SEXP, SEXP);
extern SEXP R_igraph_similarity_jaccard_es(SEXP, SEXP, SEXP, SEXP);
extern SEXP R_igraph_similarity_jaccard_pairs(SEXP, SEXP, SEXP, SEXP);
extern SEXP R_igraph_simple_cycles(SEXP, SEXP, SEXP);
extern SEXP R_igraph_simple_cycles_callback(SEXP, SEXP, SEXP, SEXP);
extern SEXP R_igraph_simple_interconnected_islands_game(SEXP, SEXP, SEXP, SEXP);
extern SEXP R_igraph_simplify(SEXP, SEXP, SEXP, SEXP);
extern SEXP R_igraph_simplify_and_colorize(SEXP);
Expand Down Expand Up @@ -858,7 +857,6 @@ static const R_CallMethodDef CallEntries[] = {
{"R_igraph_similarity_jaccard_es", (DL_FUNC) &R_igraph_similarity_jaccard_es, 4},
{"R_igraph_similarity_jaccard_pairs", (DL_FUNC) &R_igraph_similarity_jaccard_pairs, 4},
{"R_igraph_simple_cycles", (DL_FUNC) &R_igraph_simple_cycles, 3},
{"R_igraph_simple_cycles_callback", (DL_FUNC) &R_igraph_simple_cycles_callback, 4},
{"R_igraph_simple_interconnected_islands_game", (DL_FUNC) &R_igraph_simple_interconnected_islands_game, 4},
{"R_igraph_simplify", (DL_FUNC) &R_igraph_simplify, 4},
{"R_igraph_simplify_and_colorize", (DL_FUNC) &R_igraph_simplify_and_colorize, 1},
Expand Down
28 changes: 0 additions & 28 deletions src/rinterface.c
Original file line number Diff line number Diff line change
Expand Up @@ -11011,34 +11011,6 @@ SEXP R_igraph_simple_cycles(SEXP graph, SEXP mode, SEXP max_cycle_length) {
return(r_result);
}

/*-------------------------------------------/
/ igraph_simple_cycles_callback /
/-------------------------------------------*/
SEXP R_igraph_simple_cycles_callback(SEXP graph, SEXP mode, SEXP max_cycle_length, SEXP cycle_handler) {
/* Declarations */
igraph_t c_graph;
igraph_neimode_t c_mode;
igraph_integer_t c_max_cycle_length;
igraph_cycle_handler_t c_cycle_handler;

igraph_error_t c_result;
SEXP r_result;
/* Convert input */
R_SEXP_to_igraph(graph, &c_graph);
c_mode = (igraph_neimode_t) Rf_asInteger(mode);
IGRAPH_R_CHECK_INT(max_cycle_length);
c_max_cycle_length = (igraph_integer_t) REAL(max_cycle_length)[0];
/* Call igraph */
IGRAPH_R_CHECK(igraph_simple_cycles_callback(&c_graph, c_mode, c_max_cycle_length, c_cycle_handler, 0));

/* Convert output */



UNPROTECT(1);
return(r_result);
}

/*-------------------------------------------/
/ igraph_is_eulerian /
/-------------------------------------------*/
Expand Down
5 changes: 5 additions & 0 deletions tools/stimulus/functions-R.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1440,6 +1440,11 @@ igraph_solve_lsap:

igraph_find_cycle:

igraph_simple_cycles:

igraph_simple_cycles_callback:
IGNORE: RR, RC

#######################################
# Eulerian functions
#######################################
Expand Down

0 comments on commit 34bcf0c

Please sign in to comment.