Skip to content

Commit

Permalink
chore: sync functions-R.yaml to C core, temporarily disable feedback_…
Browse files Browse the repository at this point in the history
…vertex_set
  • Loading branch information
szhorvat committed Aug 24, 2024
1 parent 9733b8d commit c282139
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 56 deletions.
21 changes: 0 additions & 21 deletions R/aaa-auto.R
Original file line number Diff line number Diff line change
Expand Up @@ -1231,27 +1231,6 @@ feedback_arc_set_impl <- function(graph, weights=NULL, algo=c("approx_eades", "e
res
}

feedback_vertex_set_impl <- function(graph, weights=NULL, algo=EXACT_IP) {
# Argument checks
ensure_igraph(graph)
if (is.null(weights) && "weight" %in% vertex_attr_names(graph)) {
weights <- V(graph)$weight
}
if (!is.null(weights) && any(!is.na(weights))) {
weights <- as.numeric(weights)
} else {
weights <- NULL
}

on.exit( .Call(R_igraph_finalizer) )
# Function call
res <- .Call(R_igraph_feedback_vertex_set, graph, weights, algo)
if (igraph_opt("return.vs.es")) {
res <- create_vs(graph, res)
}
res
}

is_loop_impl <- function(graph, eids=E(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 @@ -163,7 +163,6 @@ extern SEXP R_igraph_extended_chordal_ring(SEXP, SEXP, SEXP);
extern SEXP R_igraph_famous(SEXP);
extern SEXP R_igraph_farthest_points(SEXP, SEXP, SEXP, SEXP);
extern SEXP R_igraph_feedback_arc_set(SEXP, SEXP, SEXP);
extern SEXP R_igraph_feedback_vertex_set(SEXP, SEXP, SEXP);
extern SEXP R_igraph_finalizer(void);
extern SEXP R_igraph_find_cycle(SEXP, SEXP);
extern SEXP R_igraph_forest_fire_game(SEXP, SEXP, SEXP, SEXP, SEXP);
Expand Down Expand Up @@ -621,7 +620,6 @@ static const R_CallMethodDef CallEntries[] = {
{"R_igraph_famous", (DL_FUNC) &R_igraph_famous, 1},
{"R_igraph_farthest_points", (DL_FUNC) &R_igraph_farthest_points, 4},
{"R_igraph_feedback_arc_set", (DL_FUNC) &R_igraph_feedback_arc_set, 3},
{"R_igraph_feedback_vertex_set", (DL_FUNC) &R_igraph_feedback_vertex_set, 3},
{"R_igraph_finalizer", (DL_FUNC) &R_igraph_finalizer, 0},
{"R_igraph_find_cycle", (DL_FUNC) &R_igraph_find_cycle, 2},
{"R_igraph_forest_fire_game", (DL_FUNC) &R_igraph_forest_fire_game, 5},
Expand Down
33 changes: 0 additions & 33 deletions src/rinterface.c
Original file line number Diff line number Diff line change
Expand Up @@ -3755,39 +3755,6 @@ SEXP R_igraph_feedback_arc_set(SEXP graph, SEXP weights, SEXP algo) {
return(r_result);
}

/*-------------------------------------------/
/ igraph_feedback_vertex_set /
/-------------------------------------------*/
SEXP R_igraph_feedback_vertex_set(SEXP graph, SEXP weights, SEXP algo) {
/* Declarations */
igraph_t c_graph;
igraph_vector_int_t c_result;
igraph_vector_t c_weights;
igraph_fvs_algorithm_t c_algo;
SEXP result;

SEXP r_result;
/* Convert input */
R_SEXP_to_igraph(graph, &c_graph);
if (0 != igraph_vector_int_init(&c_result, 0)) {
igraph_error("", __FILE__, __LINE__, IGRAPH_ENOMEM);
}
IGRAPH_FINALLY(igraph_vector_int_destroy, &c_result);
if (!Rf_isNull(weights)) { R_SEXP_to_vector(weights, &c_weights); }
c_algo = (igraph_fvs_algorithm_t) Rf_asInteger(algo);
/* Call igraph */
IGRAPH_R_CHECK(igraph_feedback_vertex_set(&c_graph, &c_result, (Rf_isNull(weights) ? 0 : &c_weights), c_algo));

/* Convert output */
PROTECT(result=R_igraph_vector_int_to_SEXPp1(&c_result));
igraph_vector_int_destroy(&c_result);
IGRAPH_FINALLY_CLEAN(1);
r_result = result;

UNPROTECT(1);
return(r_result);
}

/*-------------------------------------------/
/ igraph_is_loop /
/-------------------------------------------*/
Expand Down
9 changes: 9 additions & 0 deletions tools/stimulus/functions-R.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,9 @@ igraph_topological_sorting:

igraph_feedback_arc_set:

igraph_feedback_vertex_set:
IGNORE: RR, RC

igraph_is_loop:
PARAM_NAMES:
es: eids
Expand Down Expand Up @@ -1421,6 +1424,12 @@ igraph_eigen_matrix_symmetric:

igraph_solve_lsap:

#######################################
# Finding cycles
#######################################

igraph_find_cycle:

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

0 comments on commit c282139

Please sign in to comment.