diff --git a/R/aaa-auto.R b/R/aaa-auto.R index 03e9b13846c..167c352764e 100644 --- a/R/aaa-auto.R +++ b/R/aaa-auto.R @@ -768,14 +768,14 @@ realize_degree_sequence_impl <- function( out.deg, in.deg = NULL, allowed.edge.types = c("simple", "loops", "multi", "all"), - method = c("smallest", "largest", "index") + algorithm = c("smallest", "largest", "index") ) { # Argument checks out.deg <- as.numeric(out.deg) if (!is.null(in.deg)) in.deg <- as.numeric(in.deg) allowed.edge.types <- switch_igraph_arg(allowed.edge.types, "simple" = 0L, "loop" = 1L, "loops" = 1L, "multi" = 6L, "multiple" = 6L, "all" = 7L) - method <- switch_igraph_arg(method, "smallest" = 0L, "largest" = 1L, "index" = 2L) + algorithm <- switch_igraph_arg(algorithm, "smallest" = 0L, "largest" = 1L, "index" = 2L) on.exit(.Call(R_igraph_finalizer)) # Function call @@ -784,7 +784,7 @@ realize_degree_sequence_impl <- function( out.deg, in.deg, allowed.edge.types, - method + algorithm ) if (igraph_opt("add.params")) { @@ -792,7 +792,7 @@ realize_degree_sequence_impl <- function( res$out.deg <- out.deg res$in.deg <- in.deg res$allowed.edge.types <- allowed.edge.types - res$method <- method + res$algorithm <- algorithm } res @@ -802,14 +802,14 @@ realize_bipartite_degree_sequence_impl <- function( degrees1, degrees2, allowed.edge.types = c("simple", "loops", "multi", "all"), - method = c("smallest", "largest", "index") + algorithm = c("smallest", "largest", "index") ) { # Argument checks degrees1 <- as.numeric(degrees1) degrees2 <- as.numeric(degrees2) allowed.edge.types <- switch_igraph_arg(allowed.edge.types, "simple" = 0L, "loop" = 1L, "loops" = 1L, "multi" = 6L, "multiple" = 6L, "all" = 7L) - method <- switch_igraph_arg(method, "smallest" = 0L, "largest" = 1L, "index" = 2L) + algorithm <- switch_igraph_arg(algorithm, "smallest" = 0L, "largest" = 1L, "index" = 2L) on.exit(.Call(R_igraph_finalizer)) # Function call @@ -818,7 +818,7 @@ realize_bipartite_degree_sequence_impl <- function( degrees1, degrees2, allowed.edge.types, - method + algorithm ) if (igraph_opt("add.params")) { @@ -826,7 +826,7 @@ realize_bipartite_degree_sequence_impl <- function( res$degrees1 <- degrees1 res$degrees2 <- degrees2 res$allowed.edge.types <- allowed.edge.types - res$method <- method + res$algorithm <- algorithm } res @@ -2441,7 +2441,7 @@ harmonic_centrality_cutoff_impl <- function( personalized_pagerank_impl <- function( graph, - algo = c("prpack", "arpack"), + algorithm = c("prpack", "arpack"), vids = V(graph), directed = TRUE, damping = 0.85, @@ -2451,7 +2451,7 @@ personalized_pagerank_impl <- function( ) { # Argument checks ensure_igraph(graph) - algo <- switch_igraph_arg(algo, "arpack" = 1L, "prpack" = 2L) + algorithm <- switch_igraph_arg(algorithm, "arpack" = 1L, "prpack" = 2L) vids <- as_igraph_vs(graph, vids) directed <- as.logical(directed) damping <- as.numeric(damping) @@ -2479,7 +2479,7 @@ personalized_pagerank_impl <- function( res <- .Call( R_igraph_personalized_pagerank, graph, - algo, + algorithm, vids - 1, directed, damping, @@ -2495,7 +2495,7 @@ personalized_pagerank_impl <- function( personalized_pagerank_vs_impl <- function( graph, - algo = c("prpack", "arpack"), + algorithm = c("prpack", "arpack"), vids = V(graph), directed = TRUE, damping = 0.85, @@ -2506,7 +2506,7 @@ personalized_pagerank_vs_impl <- function( ) { # Argument checks ensure_igraph(graph) - algo <- switch_igraph_arg(algo, "arpack" = 1L, "prpack" = 2L) + algorithm <- switch_igraph_arg(algorithm, "arpack" = 1L, "prpack" = 2L) vids <- as_igraph_vs(graph, vids) directed <- as.logical(directed) damping <- as.numeric(damping) @@ -2534,7 +2534,7 @@ personalized_pagerank_vs_impl <- function( res <- .Call( R_igraph_personalized_pagerank_vs, graph, - algo, + algorithm, vids - 1, directed, damping, @@ -2554,7 +2554,7 @@ personalized_pagerank_vs_impl <- function( rewire_impl <- function( rewire, n, - mode = 0L + mode = SIMPLE ) { # Argument checks ensure_igraph(rewire) @@ -2972,7 +2972,7 @@ topological_sorting_impl <- function( feedback_arc_set_impl <- function( graph, weights = NULL, - algo = c("approx_eades", "exact_ip") + algorithm = c("approx_eades", "exact_ip") ) { # Argument checks ensure_igraph(graph) @@ -2984,7 +2984,7 @@ feedback_arc_set_impl <- function( } else { weights <- NULL } - algo <- switch_igraph_arg(algo, "exact_ip" = 0L, "approx_eades" = 1L) + algorithm <- switch_igraph_arg(algorithm, "exact_ip" = 0L, "approx_eades" = 1L) on.exit(.Call(R_igraph_finalizer)) # Function call @@ -2992,7 +2992,7 @@ feedback_arc_set_impl <- function( R_igraph_feedback_arc_set, graph, weights, - algo + algorithm ) if (igraph_opt("return.vs.es")) { res <- create_es(graph, res) @@ -3003,7 +3003,7 @@ feedback_arc_set_impl <- function( feedback_vertex_set_impl <- function( graph, weights = NULL, - algo = c("exact_ip") + algorithm = c("exact_ip") ) { # Argument checks ensure_igraph(graph) @@ -3015,7 +3015,7 @@ feedback_vertex_set_impl <- function( } else { weights <- NULL } - algo <- switch_igraph_arg(algo, "exact_ip" = 0L) + algorithm <- switch_igraph_arg(algorithm, "exact_ip" = 0L) on.exit(.Call(R_igraph_finalizer)) # Function call @@ -3023,7 +3023,7 @@ feedback_vertex_set_impl <- function( R_igraph_feedback_vertex_set, graph, weights, - algo + algorithm ) if (igraph_opt("return.vs.es")) { res <- create_vs(graph, res) @@ -6695,7 +6695,7 @@ write_graph_pajek_impl <- function( write_graph_gml_impl <- function( graph, outstream, - options = 0L, + options = DEFAULT, id, creator = NULL ) { @@ -9384,12 +9384,12 @@ random_spanning_tree_impl <- function( tree_game_impl <- function( n, directed = FALSE, - method = c("lerw", "prufer") + algorithm = c("lerw", "prufer") ) { # Argument checks n <- as.numeric(n) directed <- as.logical(directed) - method <- switch_igraph_arg(method, "prufer" = 0L, "lerw" = 1L) + algorithm <- switch_igraph_arg(algorithm, "prufer" = 0L, "lerw" = 1L) on.exit(.Call(R_igraph_finalizer)) # Function call @@ -9397,7 +9397,7 @@ tree_game_impl <- function( R_igraph_tree_game, n, directed, - method + algorithm ) res diff --git a/R/centrality.R b/R/centrality.R index a79e3410bed..76cf015a49f 100644 --- a/R/centrality.R +++ b/R/centrality.R @@ -30,19 +30,28 @@ subgraph.centrality <- function(graph, diag = FALSE) { #' @export page.rank <- function( graph, - algo = c("prpack", "arpack"), + algo = deprecated(), vids = V(graph), directed = TRUE, damping = 0.85, personalized = NULL, weights = NULL, - options = NULL + options = NULL, + algorithm = c("prpack", "arpack") ) { # nocov start lifecycle::deprecate_soft("2.0.0", "page.rank()", "page_rank()") + + if (lifecycle::is_present(algo)) { + lifecycle::deprecate_warn("2.1.0", "page.rank(algo = )", "page.rank(algorithm = )") + if (missing(algorithm)) { + algorithm <- algo + } + } + page_rank( graph = graph, - algo = algo, + algorithm = algorithm, vids = vids, directed = directed, damping = damping, @@ -1645,7 +1654,7 @@ hub_score <- function( #' increase at all. #' #' @param graph The graph object. -#' @param algo Character scalar, which implementation to use to carry out the +#' @param algorithm Character scalar, which implementation to use to carry out the #' calculation. The default is `"prpack"`, which uses the PRPACK library #' () to calculate PageRank scores #' by solving a set of linear equations. This is a new implementation in igraph @@ -1653,6 +1662,7 @@ hub_score <- function( #' for all but small graphs. `"arpack"` uses the ARPACK library, the #' default implementation from igraph version 0.5 until version 0.7. It computes #' PageRank scores by solving an eingevalue problem. +#' @param algo `r lifecycle::badge("deprecated")` Use `algorithm` instead. #' @param vids The vertices of interest. #' @param directed Logical, if true directed paths will be considered for #' directed graphs. It is ignored for undirected graphs. @@ -1713,17 +1723,39 @@ hub_score <- function( #' @cdocs igraph_personalized_pagerank page_rank <- function( graph, - algo = c("prpack", "arpack"), + algo = deprecated(), vids = V(graph), directed = TRUE, damping = 0.85, personalized = NULL, weights = NULL, - options = NULL + options = NULL, + algorithm = c("prpack", "arpack") ) { + if (lifecycle::is_present(algo)) { + lifecycle::deprecate_warn("2.1.0", "page_rank(algo = )", "page_rank(algorithm = )") + if (missing(algorithm)) { + algorithm <- algo + } + } + + # Don't call personalized_pagerank_impl directly due to a Stimulus bug + # where renamed parameters aren't properly handled in conditional logic. + # Instead, replicate the logic here. + + # Handle options initialization based on algorithm (before conversion to integer) + if (is.null(options)) { + algorithm_val <- match.arg(algorithm) + if (algorithm_val == "arpack") { + options <- arpack_defaults() + } else if (algorithm_val == "prpack") { + options <- list(niter=1000, eps=0.001) + } + } + personalized_pagerank_impl( graph = graph, - algo = algo, + algorithm = algorithm, vids = vids, directed = directed, damping = damping, diff --git a/R/games.R b/R/games.R index 57a106e4d9e..62635bb31be 100644 --- a/R/games.R +++ b/R/games.R @@ -350,7 +350,8 @@ establishment.game <- function( degree.sequence.game <- function( out.deg, in.deg = NULL, - method = c("simple", "vl", "simple.no.multiple", "simple.no.multiple.uniform") + method = c("simple", "vl", "simple.no.multiple", "simple.no.multiple.uniform"), + algorithm = deprecated() ) { # nocov start lifecycle::deprecate_soft( @@ -358,7 +359,19 @@ degree.sequence.game <- function( "degree.sequence.game()", "sample_degseq()" ) - sample_degseq(out.deg = out.deg, in.deg = in.deg, method = method) + + # Handle parameter renaming + if (!missing(method) && lifecycle::is_present(algorithm)) { + cli::cli_abort("Cannot specify both {.arg method} and {.arg algorithm}.") + } + + if (!missing(method)) { + sample_degseq(out.deg = out.deg, in.deg = in.deg, method = method) + } else if (lifecycle::is_present(algorithm)) { + sample_degseq(out.deg = out.deg, in.deg = in.deg, algorithm = algorithm) + } else { + sample_degseq(out.deg = out.deg, in.deg = in.deg) + } } # nocov end #' Neighborhood of graph vertices @@ -1226,7 +1239,8 @@ random.graph.game <- function( #' `in.deg`. #' @param in.deg For directed graph, the in-degree sequence. By default this is #' `NULL` and an undirected graph is created. -#' @param method Character, the method for generating the graph. See Details. +#' @param algorithm Character, the algorithm for generating the graph. See Details. +#' @param method `r lifecycle::badge("deprecated")` Use `algorithm` instead. #' @return The new graph object. #' @author Gabor Csardi \email{csardi.gabor@@gmail.com} #' @seealso @@ -1248,7 +1262,7 @@ random.graph.game <- function( #' degree(directed_graph, mode = "in") #' #' ## The vl generator -#' vl_graph <- sample_degseq(rep(2, 100), method = "vl") +#' vl_graph <- sample_degseq(rep(2, 100), algorithm = "vl") #' degree(vl_graph) #' is_simple(vl_graph) # always TRUE #' @@ -1273,7 +1287,7 @@ random.graph.game <- function( #' if (is_exponential_degrees_sum_odd) { #' exponential_degrees[1] <- exponential_degrees[1] + 1 #' } -#' exp_vl_graph <- sample_degseq(exponential_degrees, method = "vl") +#' exp_vl_graph <- sample_degseq(exponential_degrees, algorithm = "vl") #' all(degree(exp_vl_graph) == exponential_degrees) #' #' ## An example that does not work @@ -1295,7 +1309,7 @@ random.graph.game <- function( #' if (is_exponential_degrees_sum_odd) { #' exponential_degrees[1] <- exponential_degrees[1] + 1 #' } -#' exp_vl_graph <- sample_degseq(exponential_degrees, method = "vl") +#' exp_vl_graph <- sample_degseq(exponential_degrees, algorithm = "vl") #' #' @examples #' ## Power-law degree distribution @@ -1319,7 +1333,7 @@ random.graph.game <- function( #' if (is_exponential_degrees_sum_odd) { #' powerlaw_degrees[1] <- powerlaw_degrees[1] + 1 #' } -#' powerlaw_vl_graph <- sample_degseq(powerlaw_degrees, method = "vl") +#' powerlaw_vl_graph <- sample_degseq(powerlaw_degrees, algorithm = "vl") #' all(degree(powerlaw_vl_graph) == powerlaw_degrees) #' #' ## An example that does not work @@ -1341,13 +1355,14 @@ random.graph.game <- function( #' if (is_exponential_degrees_sum_odd) { #' powerlaw_degrees[1] <- powerlaw_degrees[1] + 1 #' } -#' powerlaw_vl_graph <- sample_degseq(powerlaw_degrees, method = "vl") +#' powerlaw_vl_graph <- sample_degseq(powerlaw_degrees, algorithm = "vl") #' all(degree(powerlaw_vl_graph) == powerlaw_degrees) #' sample_degseq <- function( out.deg, in.deg = NULL, - method = c( + method = deprecated(), + algorithm = c( "configuration", "vl", "fast.heur.simple", @@ -1355,11 +1370,18 @@ sample_degseq <- function( "edge.switching.simple" ) ) { - if (missing(method)) { - method <- method[1] + if (lifecycle::is_present(method)) { + lifecycle::deprecate_warn("2.1.0", "sample_degseq(method = )", "sample_degseq(algorithm = )") + if (missing(algorithm)) { + algorithm <- method + } + } + + if (missing(algorithm)) { + algorithm <- algorithm[1] } - method <- igraph.match.arg( - method, + algorithm <- igraph.match.arg( + algorithm, values = c( "configuration", "vl", @@ -1372,33 +1394,33 @@ sample_degseq <- function( ) ) - if (method == "simple") { + if (algorithm == "simple") { lifecycle::deprecate_warn( "2.1.0", - "sample_degseq(method = 'must be configuration instead of simple')" + "sample_degseq(algorithm = 'must be configuration instead of simple')" ) - method <- "configuration" + algorithm <- "configuration" } - if (method == "simple.no.multiple") { + if (algorithm == "simple.no.multiple") { lifecycle::deprecate_warn( "2.1.0", - "sample_degseq(method = 'must be fast.heur.simple instead of simple.no.multiple')" + "sample_degseq(algorithm = 'must be fast.heur.simple instead of simple.no.multiple')" ) - method <- "fast.heur.simple" + algorithm <- "fast.heur.simple" } - if (method == "simple.no.multiple.uniform") { + if (algorithm == "simple.no.multiple.uniform") { lifecycle::deprecate_warn( "2.1.0", - "sample_degseq(method = 'must be configuration.simple instead of simple.no.multiple.uniform')" + "sample_degseq(algorithm = 'must be configuration.simple instead of simple.no.multiple.uniform')" ) - method <- "configuration.simple" + algorithm <- "configuration.simple" } # numbers from https://github.com/igraph/igraph/blob/640083c88bf85fd322ff7b748b9b4e16ebe32aa2/include/igraph_constants.h#L94 method1 <- switch( - method, + algorithm, "configuration" = 0, "vl" = 1, "fast.heur.simple" = 2, diff --git a/R/make.R b/R/make.R index cd46268f9c2..a00b3770ccf 100644 --- a/R/make.R +++ b/R/make.R @@ -2122,27 +2122,40 @@ make_tree <- function(n, children = 2, mode = c("out", "in", "undirected")) { #' @param n The number of nodes in the tree #' @param directed Whether to create a directed tree. The edges of the tree are #' oriented away from the root. -#' @param method The algorithm to use to generate the tree. \sQuote{prufer} +#' @param algorithm The algorithm to use to generate the tree. \sQuote{prufer} #' samples Prüfer sequences uniformly and then converts the sampled sequence to #' a tree. \sQuote{lerw} performs a loop-erased random walk on the complete #' graph to uniformly sampleits spanning trees. (This is also known as Wilson's -#' algorithm). The default is \sQuote{lerw}. Note that the method based on +#' algorithm). The default is \sQuote{lerw}. Note that the algorithm based on #' Prüfer sequences does not support directed trees at the moment. +#' @param method `r lifecycle::badge("deprecated")` Use `algorithm` instead. #' @return A graph object. #' #' @family games #' @keywords graphs #' @examples #' -#' g <- sample_tree(100, method = "lerw") +#' g <- sample_tree(100, algorithm = "lerw") #' #' @export #' @cdocs igraph_tree_game -sample_tree <- function(n, directed = FALSE, method = c("lerw", "prufer")) { +sample_tree <- function( + n, + directed = FALSE, + method = deprecated(), + algorithm = c("lerw", "prufer") +) { + if (lifecycle::is_present(method)) { + lifecycle::deprecate_warn("2.1.0", "sample_tree(method = )", "sample_tree(algorithm = )") + if (missing(algorithm)) { + algorithm <- method + } + } + tree_game_impl( n = n, directed = directed, - method = method + algorithm = algorithm ) } @@ -2860,7 +2873,8 @@ graph_from_lcf <- function( #' `in.deg`. #' @param in.deg For directed graph, the in-degree sequence. By default this is #' `NULL` and an undirected graph is created. -#' @param method Character, the method for generating the graph; see below. +#' @param algorithm Character, the algorithm for generating the graph; see below. +#' @param method `r lifecycle::badge("deprecated")` Use `algorithm` instead. #' @param allowed.edge.types Character, specifies the types of allowed edges. #' \dQuote{simple} allows simple graphs only (no loops, no multiple edges). #' \dQuote{multiple} allows multiple edges but disallows loop. @@ -2903,7 +2917,7 @@ graph_from_lcf <- function( #' if (sum(degs) %% 2 != 0) { #' degs[1] <- degs[1] + 1 #' } -#' g4 <- realize_degseq(degs, method = "largest", allowed.edge.types = "all") +#' g4 <- realize_degseq(degs, algorithm = "largest", allowed.edge.types = "all") #' all(degree(g4) == degs) #' #' ## Power-law degree distribution, no loops allowed but multiple edges @@ -2920,13 +2934,21 @@ realize_degseq <- function( out.deg, in.deg = NULL, allowed.edge.types = c("simple", "loops", "multi", "all"), - method = c("smallest", "largest", "index") + method = deprecated(), + algorithm = c("smallest", "largest", "index") ) { + if (lifecycle::is_present(method)) { + lifecycle::deprecate_warn("2.1.0", "realize_degseq(method = )", "realize_degseq(algorithm = )") + if (missing(algorithm)) { + algorithm <- method + } + } + realize_degree_sequence_impl( out.deg = out.deg, in.deg = in.deg, allowed.edge.types = allowed.edge.types, - method = method + algorithm = algorithm ) } @@ -2963,7 +2985,8 @@ realize_degseq <- function( #' @param allowed.edge.types Character, specifies the types of allowed edges. #' \dQuote{simple} allows simple graphs only (no multiple edges). #' \dQuote{multiple} allows multiple edges. -#' @param method Character, the method for generating the graph; see below. +#' @param algorithm Character, the algorithm for generating the graph; see below. +#' @param method `r lifecycle::badge("deprecated")` Use `algorithm` instead. #' @inheritParams rlang::args_dots_empty #' @seealso [realize_degseq()] to create a not necessarily bipartite graph. #' @export @@ -2977,16 +3000,25 @@ realize_bipartite_degseq <- function( degrees2, ..., allowed.edge.types = c("simple", "multiple"), - method = c("smallest", "largest", "index") + method = deprecated(), + algorithm = c("smallest", "largest", "index") ) { check_dots_empty() + + if (lifecycle::is_present(method)) { + lifecycle::deprecate_warn("2.1.0", "realize_bipartite_degseq(method = )", "realize_bipartite_degseq(algorithm = )") + if (missing(algorithm)) { + algorithm <- method + } + } + allowed.edge.types <- igraph.match.arg(allowed.edge.types) - method <- igraph.match.arg(method) + algorithm <- igraph.match.arg(algorithm) g <- realize_bipartite_degree_sequence_impl( degrees1 = degrees1, degrees2 = degrees2, allowed.edge.types = allowed.edge.types, - method = method + algorithm = algorithm ) V(g)$type <- c(rep(TRUE, length(degrees1)), rep(FALSE, length(degrees2))) diff --git a/R/structural-properties.R b/R/structural-properties.R index 71f8bc54bbe..cd32dc647e5 100644 --- a/R/structural-properties.R +++ b/R/structural-properties.R @@ -2333,13 +2333,14 @@ topo_sort <- function(graph, mode = c("out", "all", "in")) { #' `NULL`, then the edge attribute is used automatically. The goal of #' the feedback arc set problem is to find a feedback arc set with the smallest #' total weight. -#' @param algo Specifies the algorithm to use. \dQuote{`exact_ip`} solves +#' @param algorithm Specifies the algorithm to use. \dQuote{`exact_ip`} solves #' the feedback arc set problem with an exact integer programming algorithm that #' guarantees that the total weight of the removed edges is as small as possible. #' \dQuote{`approx_eades`} uses a fast (linear-time) approximation #' algorithm from Eades, Lin and Smyth. \dQuote{`exact`} is an alias to #' \dQuote{`exact_ip`} while \dQuote{`approx`} is an alias to #' \dQuote{`approx_eades`}. +#' @param algo `r lifecycle::badge("deprecated")` Use `algorithm` instead. #' @return An edge sequence (by default, but see the `return.vs.es` option #' of [igraph_options()]) containing the feedback arc set. #' @references Peter Eades, Xuemin Lin and W.F.Smyth: A fast and effective @@ -2353,17 +2354,25 @@ topo_sort <- function(graph, mode = c("out", "all", "in")) { #' #' g <- sample_gnm(20, 40, directed = TRUE) #' feedback_arc_set(g) -#' feedback_arc_set(g, algo = "approx_eades") +#' feedback_arc_set(g, algorithm = "approx_eades") #' @cdocs igraph_feedback_arc_set feedback_arc_set <- function( graph, weights = NULL, - algo = c("approx_eades", "exact_ip") + algo = deprecated(), + algorithm = c("approx_eades", "exact_ip") ) { + if (lifecycle::is_present(algo)) { + lifecycle::deprecate_warn("2.1.0", "feedback_arc_set(algo = )", "feedback_arc_set(algorithm = )") + if (missing(algorithm)) { + algorithm <- algo + } + } + feedback_arc_set_impl( graph = graph, weights = weights, - algo = algo + algorithm = algorithm ) } @@ -2382,9 +2391,10 @@ feedback_arc_set <- function( #' `NULL`, then the vertex attribute is used automatically. The goal of #' the feedback vertex set problem is to find a feedback vertex set with #' the smallest total weight. -#' @param algo Specifies the algorithm to use. Currently, \dQuote{`exact_ip`}, +#' @param algorithm Specifies the algorithm to use. Currently, \dQuote{`exact_ip`}, #' which solves the feedback vertex set problem with an exact integer #' programming approach, is the only option. +#' @param algo `r lifecycle::badge("deprecated")` Use `algorithm` instead. #' @return A vertex sequence (by default, but see the `return.vs.es` option #' of [igraph_options()]) containing the feedback vertex set. #' @keywords graphs @@ -2396,11 +2406,23 @@ feedback_arc_set <- function( #' g <- make_lattice(c(3,3)) #' feedback_vertex_set(g) #' @cdocs igraph_feedback_vertex_set -feedback_vertex_set <- function(graph, weights = NULL, algo = c("exact_ip")) { +feedback_vertex_set <- function( + graph, + weights = NULL, + algo = deprecated(), + algorithm = c("exact_ip") +) { + if (lifecycle::is_present(algo)) { + lifecycle::deprecate_warn("2.1.0", "feedback_vertex_set(algo = )", "feedback_vertex_set(algorithm = )") + if (missing(algorithm)) { + algorithm <- algo + } + } + feedback_vertex_set_impl( graph = graph, weights = weights, - algo = algo + algorithm = algorithm ) } diff --git a/man/degree.sequence.game.Rd b/man/degree.sequence.game.Rd index b9db2f89511..be07765f791 100644 --- a/man/degree.sequence.game.Rd +++ b/man/degree.sequence.game.Rd @@ -7,7 +7,8 @@ degree.sequence.game( out.deg, in.deg = NULL, - method = c("simple", "vl", "simple.no.multiple", "simple.no.multiple.uniform") + method = c("simple", "vl", "simple.no.multiple", "simple.no.multiple.uniform"), + algorithm = deprecated() ) } \arguments{ @@ -19,7 +20,9 @@ should be even. For directed graphs its sum should be the same as the sum of \item{in.deg}{For directed graph, the in-degree sequence. By default this is \code{NULL} and an undirected graph is created.} -\item{method}{Character, the method for generating the graph. See Details.} +\item{method}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Use \code{algorithm} instead.} + +\item{algorithm}{Character, the algorithm for generating the graph. See Details.} } \description{ \ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} diff --git a/man/feedback_arc_set.Rd b/man/feedback_arc_set.Rd index 59a41641f6a..e57872230ab 100644 --- a/man/feedback_arc_set.Rd +++ b/man/feedback_arc_set.Rd @@ -4,7 +4,12 @@ \alias{feedback_arc_set} \title{Finding a feedback arc set in a graph} \usage{ -feedback_arc_set(graph, weights = NULL, algo = c("approx_eades", "exact_ip")) +feedback_arc_set( + graph, + weights = NULL, + algo = deprecated(), + algorithm = c("approx_eades", "exact_ip") +) } \arguments{ \item{graph}{The input graph} @@ -15,7 +20,9 @@ attribute called \sQuote{\code{weight}}, and this argument is the feedback arc set problem is to find a feedback arc set with the smallest total weight.} -\item{algo}{Specifies the algorithm to use. \dQuote{\code{exact_ip}} solves +\item{algo}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Use \code{algorithm} instead.} + +\item{algorithm}{Specifies the algorithm to use. \dQuote{\code{exact_ip}} solves the feedback arc set problem with an exact integer programming algorithm that guarantees that the total weight of the removed edges is as small as possible. \dQuote{\code{approx_eades}} uses a fast (linear-time) approximation @@ -42,7 +49,7 @@ component is a tree). g <- sample_gnm(20, 40, directed = TRUE) feedback_arc_set(g) -feedback_arc_set(g, algo = "approx_eades") +feedback_arc_set(g, algorithm = "approx_eades") } \references{ Peter Eades, Xuemin Lin and W.F.Smyth: A fast and effective diff --git a/man/feedback_vertex_set.Rd b/man/feedback_vertex_set.Rd index 06f635f7ee5..f3f45f9afa6 100644 --- a/man/feedback_vertex_set.Rd +++ b/man/feedback_vertex_set.Rd @@ -4,7 +4,12 @@ \alias{feedback_vertex_set} \title{Finding a feedback vertex set in a graph} \usage{ -feedback_vertex_set(graph, weights = NULL, algo = c("exact_ip")) +feedback_vertex_set( + graph, + weights = NULL, + algo = deprecated(), + algorithm = c("exact_ip") +) } \arguments{ \item{graph}{The input graph} @@ -15,7 +20,9 @@ attribute called \sQuote{\code{weight}}, and this argument is the feedback vertex set problem is to find a feedback vertex set with the smallest total weight.} -\item{algo}{Specifies the algorithm to use. Currently, \dQuote{\code{exact_ip}}, +\item{algo}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Use \code{algorithm} instead.} + +\item{algorithm}{Specifies the algorithm to use. Currently, \dQuote{\code{exact_ip}}, which solves the feedback vertex set problem with an exact integer programming approach, is the only option.} } diff --git a/man/page.rank.Rd b/man/page.rank.Rd index 69075bee792..2f577d544b1 100644 --- a/man/page.rank.Rd +++ b/man/page.rank.Rd @@ -6,26 +6,20 @@ \usage{ page.rank( graph, - algo = c("prpack", "arpack"), + algo = deprecated(), vids = V(graph), directed = TRUE, damping = 0.85, personalized = NULL, weights = NULL, - options = NULL + options = NULL, + algorithm = c("prpack", "arpack") ) } \arguments{ \item{graph}{The graph object.} -\item{algo}{Character scalar, which implementation to use to carry out the -calculation. The default is \code{"prpack"}, which uses the PRPACK library -(\url{https://github.com/dgleich/prpack}) to calculate PageRank scores -by solving a set of linear equations. This is a new implementation in igraph -version 0.7, and the suggested one, as it is the most stable and the fastest -for all but small graphs. \code{"arpack"} uses the ARPACK library, the -default implementation from igraph version 0.5 until version 0.7. It computes -PageRank scores by solving an eingevalue problem.} +\item{algo}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Use \code{algorithm} instead.} \item{vids}{The vertices of interest.} @@ -53,6 +47,15 @@ selected by the surfer.} \item{options}{A named list, to override some ARPACK options. See \code{\link[=arpack]{arpack()}} for details. This argument is ignored if the PRPACK implementation is used.} + +\item{algorithm}{Character scalar, which implementation to use to carry out the +calculation. The default is \code{"prpack"}, which uses the PRPACK library +(\url{https://github.com/dgleich/prpack}) to calculate PageRank scores +by solving a set of linear equations. This is a new implementation in igraph +version 0.7, and the suggested one, as it is the most stable and the fastest +for all but small graphs. \code{"arpack"} uses the ARPACK library, the +default implementation from igraph version 0.5 until version 0.7. It computes +PageRank scores by solving an eingevalue problem.} } \description{ \ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} diff --git a/man/page_rank.Rd b/man/page_rank.Rd index 182032cf711..25eef528d2b 100644 --- a/man/page_rank.Rd +++ b/man/page_rank.Rd @@ -6,26 +6,20 @@ \usage{ page_rank( graph, - algo = c("prpack", "arpack"), + algo = deprecated(), vids = V(graph), directed = TRUE, damping = 0.85, personalized = NULL, weights = NULL, - options = NULL + options = NULL, + algorithm = c("prpack", "arpack") ) } \arguments{ \item{graph}{The graph object.} -\item{algo}{Character scalar, which implementation to use to carry out the -calculation. The default is \code{"prpack"}, which uses the PRPACK library -(\url{https://github.com/dgleich/prpack}) to calculate PageRank scores -by solving a set of linear equations. This is a new implementation in igraph -version 0.7, and the suggested one, as it is the most stable and the fastest -for all but small graphs. \code{"arpack"} uses the ARPACK library, the -default implementation from igraph version 0.5 until version 0.7. It computes -PageRank scores by solving an eingevalue problem.} +\item{algo}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Use \code{algorithm} instead.} \item{vids}{The vertices of interest.} @@ -53,6 +47,15 @@ selected by the surfer.} \item{options}{A named list, to override some ARPACK options. See \code{\link[=arpack]{arpack()}} for details. This argument is ignored if the PRPACK implementation is used.} + +\item{algorithm}{Character scalar, which implementation to use to carry out the +calculation. The default is \code{"prpack"}, which uses the PRPACK library +(\url{https://github.com/dgleich/prpack}) to calculate PageRank scores +by solving a set of linear equations. This is a new implementation in igraph +version 0.7, and the suggested one, as it is the most stable and the fastest +for all but small graphs. \code{"arpack"} uses the ARPACK library, the +default implementation from igraph version 0.5 until version 0.7. It computes +PageRank scores by solving an eingevalue problem.} } \value{ A named list with entries: diff --git a/man/realize_bipartite_degseq.Rd b/man/realize_bipartite_degseq.Rd index 873e9d12c04..c6e131b199a 100644 --- a/man/realize_bipartite_degseq.Rd +++ b/man/realize_bipartite_degseq.Rd @@ -9,7 +9,8 @@ realize_bipartite_degseq( degrees2, ..., allowed.edge.types = c("simple", "multiple"), - method = c("smallest", "largest", "index") + method = deprecated(), + algorithm = c("smallest", "largest", "index") ) } \arguments{ @@ -23,7 +24,9 @@ realize_bipartite_degseq( \dQuote{simple} allows simple graphs only (no multiple edges). \dQuote{multiple} allows multiple edges.} -\item{method}{Character, the method for generating the graph; see below.} +\item{method}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Use \code{algorithm} instead.} + +\item{algorithm}{Character, the algorithm for generating the graph; see below.} } \value{ The new graph object. diff --git a/man/realize_degseq.Rd b/man/realize_degseq.Rd index 8b2e2fcad2b..3ea61f81203 100644 --- a/man/realize_degseq.Rd +++ b/man/realize_degseq.Rd @@ -8,7 +8,8 @@ realize_degseq( out.deg, in.deg = NULL, allowed.edge.types = c("simple", "loops", "multi", "all"), - method = c("smallest", "largest", "index") + method = deprecated(), + algorithm = c("smallest", "largest", "index") ) } \arguments{ @@ -27,7 +28,9 @@ should be even. For directed graphs its sum should be the same as the sum of unimplemented). \dQuote{all} allows all types of edges. The default is \dQuote{simple}.} -\item{method}{Character, the method for generating the graph; see below.} +\item{method}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Use \code{algorithm} instead.} + +\item{algorithm}{Character, the algorithm for generating the graph; see below.} } \value{ The new graph object. @@ -73,7 +76,7 @@ degs <- sample(1:100, 100, replace = TRUE, prob = exp(-0.5 * (1:100))) if (sum(degs) \%\% 2 != 0) { degs[1] <- degs[1] + 1 } -g4 <- realize_degseq(degs, method = "largest", allowed.edge.types = "all") +g4 <- realize_degseq(degs, algorithm = "largest", allowed.edge.types = "all") all(degree(g4) == degs) ## Power-law degree distribution, no loops allowed but multiple edges diff --git a/man/sample_degseq.Rd b/man/sample_degseq.Rd index 0f381f59d6d..6068f30440e 100644 --- a/man/sample_degseq.Rd +++ b/man/sample_degseq.Rd @@ -8,7 +8,8 @@ sample_degseq( out.deg, in.deg = NULL, - method = c("configuration", "vl", "fast.heur.simple", "configuration.simple", + method = deprecated(), + algorithm = c("configuration", "vl", "fast.heur.simple", "configuration.simple", "edge.switching.simple") ) @@ -23,7 +24,9 @@ should be even. For directed graphs its sum should be the same as the sum of \item{in.deg}{For directed graph, the in-degree sequence. By default this is \code{NULL} and an undirected graph is created.} -\item{method}{Character, the method for generating the graph. See Details.} +\item{method}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Use \code{algorithm} instead.} + +\item{algorithm}{Character, the algorithm for generating the graph. See Details.} \item{...}{Passed to \code{realize_degseq()} if \sQuote{deterministic} is true, or to \code{sample_degseq()} otherwise.} @@ -94,7 +97,7 @@ degree(directed_graph, mode = "out") degree(directed_graph, mode = "in") ## The vl generator -vl_graph <- sample_degseq(rep(2, 100), method = "vl") +vl_graph <- sample_degseq(rep(2, 100), algorithm = "vl") degree(vl_graph) is_simple(vl_graph) # always TRUE @@ -119,7 +122,7 @@ is_exponential_degrees_sum_odd <- (sum(exponential_degrees) \%\% 2 != 0) if (is_exponential_degrees_sum_odd) { exponential_degrees[1] <- exponential_degrees[1] + 1 } -exp_vl_graph <- sample_degseq(exponential_degrees, method = "vl") +exp_vl_graph <- sample_degseq(exponential_degrees, algorithm = "vl") all(degree(exp_vl_graph) == exponential_degrees) ## An example that does not work @@ -141,7 +144,7 @@ is_exponential_degrees_sum_odd <- (sum(exponential_degrees) \%\% 2 != 0) if (is_exponential_degrees_sum_odd) { exponential_degrees[1] <- exponential_degrees[1] + 1 } -exp_vl_graph <- sample_degseq(exponential_degrees, method = "vl") +exp_vl_graph <- sample_degseq(exponential_degrees, algorithm = "vl") \dontshow{\}) # examplesIf} ## Power-law degree distribution ## We fix the seed as there's no guarantee @@ -164,7 +167,7 @@ is_exponential_degrees_sum_odd <- (sum(powerlaw_degrees) \%\% 2 != 0) if (is_exponential_degrees_sum_odd) { powerlaw_degrees[1] <- powerlaw_degrees[1] + 1 } -powerlaw_vl_graph <- sample_degseq(powerlaw_degrees, method = "vl") +powerlaw_vl_graph <- sample_degseq(powerlaw_degrees, algorithm = "vl") all(degree(powerlaw_vl_graph) == powerlaw_degrees) ## An example that does not work @@ -186,7 +189,7 @@ is_exponential_degrees_sum_odd <- (sum(powerlaw_degrees) \%\% 2 != 0) if (is_exponential_degrees_sum_odd) { powerlaw_degrees[1] <- powerlaw_degrees[1] + 1 } -powerlaw_vl_graph <- sample_degseq(powerlaw_degrees, method = "vl") +powerlaw_vl_graph <- sample_degseq(powerlaw_degrees, algorithm = "vl") all(degree(powerlaw_vl_graph) == powerlaw_degrees) \dontshow{\}) # examplesIf} } diff --git a/man/sample_tree.Rd b/man/sample_tree.Rd index f2e025926a5..9b90e80e8c7 100644 --- a/man/sample_tree.Rd +++ b/man/sample_tree.Rd @@ -4,7 +4,12 @@ \alias{sample_tree} \title{Sample trees randomly and uniformly} \usage{ -sample_tree(n, directed = FALSE, method = c("lerw", "prufer")) +sample_tree( + n, + directed = FALSE, + method = deprecated(), + algorithm = c("lerw", "prufer") +) } \arguments{ \item{n}{The number of nodes in the tree} @@ -12,11 +17,13 @@ sample_tree(n, directed = FALSE, method = c("lerw", "prufer")) \item{directed}{Whether to create a directed tree. The edges of the tree are oriented away from the root.} -\item{method}{The algorithm to use to generate the tree. \sQuote{prufer} +\item{method}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Use \code{algorithm} instead.} + +\item{algorithm}{The algorithm to use to generate the tree. \sQuote{prufer} samples Prüfer sequences uniformly and then converts the sampled sequence to a tree. \sQuote{lerw} performs a loop-erased random walk on the complete graph to uniformly sampleits spanning trees. (This is also known as Wilson's -algorithm). The default is \sQuote{lerw}. Note that the method based on +algorithm). The default is \sQuote{lerw}. Note that the algorithm based on Prüfer sequences does not support directed trees at the moment.} } \value{ @@ -32,7 +39,7 @@ given number of nodes with the same probability. } \examples{ -g <- sample_tree(100, method = "lerw") +g <- sample_tree(100, algorithm = "lerw") } \seealso{ diff --git a/src/cpp11.dd b/src/cpp11.dd index 9abbae1fcad..de42af19ba0 100644 --- a/src/cpp11.dd +++ b/src/cpp11.dd @@ -2,3 +2,255 @@ cpp11.o: \ cpp11.cpp \ igraph_types.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/R.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/altrep.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/as.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/attribute_proxy.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/data_frame.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/declarations.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/doubles.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/environment.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/external_pointer.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/function.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/integers.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/list.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/list_of.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/logicals.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/matrix.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/named_arg.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/protect.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/r_bool.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/r_string.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/r_vector.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/raws.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/sexp.hpp \ + /home/runner/work/_temp/Library/cpp11/include/cpp11/strings.hpp \ + /opt/R/4.5.1/lib/R/include/R_ext/Arith.h \ + /opt/R/4.5.1/lib/R/include/R_ext/Boolean.h \ + /opt/R/4.5.1/lib/R/include/R_ext/Complex.h \ + /opt/R/4.5.1/lib/R/include/R_ext/Error.h \ + /opt/R/4.5.1/lib/R/include/R_ext/Memory.h \ + /opt/R/4.5.1/lib/R/include/R_ext/Print.h \ + /opt/R/4.5.1/lib/R/include/R_ext/Rdynload.h \ + /opt/R/4.5.1/lib/R/include/R_ext/Utils.h \ + /opt/R/4.5.1/lib/R/include/R_ext/Visibility.h \ + /opt/R/4.5.1/lib/R/include/R_ext/libextern.h \ + /opt/R/4.5.1/lib/R/include/Rconfig.h \ + /opt/R/4.5.1/lib/R/include/Rinternals.h \ + /opt/R/4.5.1/lib/R/include/Rversion.h \ + /usr/include/asm-generic/errno.h \ + /usr/include/c++/13/algorithm \ + /usr/include/c++/13/backward/auto_ptr.h \ + /usr/include/c++/13/backward/binders.h \ + /usr/include/c++/13/bits/algorithmfwd.h \ + /usr/include/c++/13/bits/align.h \ + /usr/include/c++/13/bits/alloc_traits.h \ + /usr/include/c++/13/bits/allocated_ptr.h \ + /usr/include/c++/13/bits/allocator.h \ + /usr/include/c++/13/bits/atomic_base.h \ + /usr/include/c++/13/bits/atomic_lockfree_defines.h \ + /usr/include/c++/13/bits/basic_ios.h \ + /usr/include/c++/13/bits/basic_ios.tcc \ + /usr/include/c++/13/bits/basic_string.h \ + /usr/include/c++/13/bits/basic_string.tcc \ + /usr/include/c++/13/bits/char_traits.h \ + /usr/include/c++/13/bits/charconv.h \ + /usr/include/c++/13/bits/concept_check.h \ + /usr/include/c++/13/bits/cpp_type_traits.h \ + /usr/include/c++/13/bits/cxxabi_forced.h \ + /usr/include/c++/13/bits/cxxabi_init_exception.h \ + /usr/include/c++/13/bits/exception.h \ + /usr/include/c++/13/bits/exception_defines.h \ + /usr/include/c++/13/bits/exception_ptr.h \ + /usr/include/c++/13/bits/functexcept.h \ + /usr/include/c++/13/bits/functional_hash.h \ + /usr/include/c++/13/bits/hash_bytes.h \ + /usr/include/c++/13/bits/locale_classes.h \ + /usr/include/c++/13/bits/locale_classes.tcc \ + /usr/include/c++/13/bits/locale_facets.h \ + /usr/include/c++/13/bits/locale_facets.tcc \ + /usr/include/c++/13/bits/localefwd.h \ + /usr/include/c++/13/bits/memory_resource.h \ + /usr/include/c++/13/bits/memoryfwd.h \ + /usr/include/c++/13/bits/move.h \ + /usr/include/c++/13/bits/nested_exception.h \ + /usr/include/c++/13/bits/new_allocator.h \ + /usr/include/c++/13/bits/ostream.tcc \ + /usr/include/c++/13/bits/ostream_insert.h \ + /usr/include/c++/13/bits/postypes.h \ + /usr/include/c++/13/bits/predefined_ops.h \ + /usr/include/c++/13/bits/ptr_traits.h \ + /usr/include/c++/13/bits/range_access.h \ + /usr/include/c++/13/bits/refwrap.h \ + /usr/include/c++/13/bits/requires_hosted.h \ + /usr/include/c++/13/bits/shared_ptr.h \ + /usr/include/c++/13/bits/shared_ptr_atomic.h \ + /usr/include/c++/13/bits/shared_ptr_base.h \ + /usr/include/c++/13/bits/specfun.h \ + /usr/include/c++/13/bits/std_abs.h \ + /usr/include/c++/13/bits/stl_algobase.h \ + /usr/include/c++/13/bits/stl_bvector.h \ + /usr/include/c++/13/bits/stl_construct.h \ + /usr/include/c++/13/bits/stl_function.h \ + /usr/include/c++/13/bits/stl_heap.h \ + /usr/include/c++/13/bits/stl_iterator.h \ + /usr/include/c++/13/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/13/bits/stl_iterator_base_types.h \ + /usr/include/c++/13/bits/stl_pair.h \ + /usr/include/c++/13/bits/stl_raw_storage_iter.h \ + /usr/include/c++/13/bits/stl_vector.h \ + /usr/include/c++/13/bits/stream_iterator.h \ + /usr/include/c++/13/bits/streambuf.tcc \ + /usr/include/c++/13/bits/streambuf_iterator.h \ + /usr/include/c++/13/bits/string_view.tcc \ + /usr/include/c++/13/bits/uniform_int_dist.h \ + /usr/include/c++/13/bits/uses_allocator.h \ + /usr/include/c++/13/bits/uses_allocator_args.h \ + /usr/include/c++/13/bits/vector.tcc \ + /usr/include/c++/13/cctype \ + /usr/include/c++/13/clocale \ + /usr/include/c++/13/compare \ + /usr/include/c++/13/csetjmp \ + /usr/include/c++/13/cstdint \ + /usr/include/c++/13/cstdio \ + /usr/include/c++/13/cstring \ + /usr/include/c++/13/debug/assertions.h \ + /usr/include/c++/13/ext/aligned_buffer.h \ + /usr/include/c++/13/ext/alloc_traits.h \ + /usr/include/c++/13/ext/atomicity.h \ + /usr/include/c++/13/ext/concurrence.h \ + /usr/include/c++/13/ext/numeric_traits.h \ + /usr/include/c++/13/ext/string_conversions.h \ + /usr/include/c++/13/ext/type_traits.h \ + /usr/include/c++/13/initializer_list \ + /usr/include/c++/13/limits \ + /usr/include/c++/13/math.h \ + /usr/include/c++/13/memory \ + /usr/include/c++/13/ostream \ + /usr/include/c++/13/pstl/execution_defs.h \ + /usr/include/c++/13/pstl/glue_algorithm_defs.h \ + /usr/include/c++/13/pstl/glue_memory_defs.h \ + /usr/include/c++/13/pstl/pstl_config.h \ + /usr/include/c++/13/streambuf \ + /usr/include/c++/13/string \ + /usr/include/c++/13/system_error \ + /usr/include/c++/13/tr1/bessel_function.tcc \ + /usr/include/c++/13/tr1/beta_function.tcc \ + /usr/include/c++/13/tr1/ell_integral.tcc \ + /usr/include/c++/13/tr1/exp_integral.tcc \ + /usr/include/c++/13/tr1/hypergeometric.tcc \ + /usr/include/c++/13/tr1/legendre_function.tcc \ + /usr/include/c++/13/tr1/modified_bessel_func.tcc \ + /usr/include/c++/13/tr1/poly_hermite.tcc \ + /usr/include/c++/13/tr1/poly_laguerre.tcc \ + /usr/include/c++/13/tr1/riemann_zeta.tcc \ + /usr/include/c++/13/tr1/special_function_util.h \ + /usr/include/c++/13/utility \ + /usr/include/c++/13/vector \ + /usr/include/errno.h \ + /usr/include/features-time64.h \ + /usr/include/inttypes.h \ + /usr/include/limits.h \ + /usr/include/linux/errno.h \ + /usr/include/linux/limits.h \ + /usr/include/pthread.h \ + /usr/include/wchar.h \ + /usr/include/wctype.h \ + /usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/x86_64-linux-gnu/bits/cpu-set.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endianness.h \ + /usr/include/x86_64-linux-gnu/bits/floatn-common.h \ + /usr/include/x86_64-linux-gnu/bits/floatn.h \ + /usr/include/x86_64-linux-gnu/bits/flt-eval-method.h \ + /usr/include/x86_64-linux-gnu/bits/fp-fast.h \ + /usr/include/x86_64-linux-gnu/bits/fp-logb.h \ + /usr/include/x86_64-linux-gnu/bits/iscanonical.h \ + /usr/include/x86_64-linux-gnu/bits/libc-header-start.h \ + /usr/include/x86_64-linux-gnu/bits/libm-simd-decl-stubs.h \ + /usr/include/x86_64-linux-gnu/bits/local_lim.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h \ + /usr/include/x86_64-linux-gnu/bits/long-double.h \ + /usr/include/x86_64-linux-gnu/bits/math-vector.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls-narrow.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls.h \ + /usr/include/x86_64-linux-gnu/bits/posix2_lim.h \ + /usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/x86_64-linux-gnu/bits/stdint-intn.h \ + /usr/include/x86_64-linux-gnu/bits/stdint-least.h \ + /usr/include/x86_64-linux-gnu/bits/stdint-uintn.h \ + /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ + /usr/include/x86_64-linux-gnu/bits/stdlib-float.h \ + /usr/include/x86_64-linux-gnu/bits/struct_mutex.h \ + /usr/include/x86_64-linux-gnu/bits/struct_rwlock.h \ + /usr/include/x86_64-linux-gnu/bits/thread-shared-types.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/bits/time64.h \ + /usr/include/x86_64-linux-gnu/bits/timesize.h \ + /usr/include/x86_64-linux-gnu/bits/timex.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/types/FILE.h \ + /usr/include/x86_64-linux-gnu/bits/types/__FILE.h \ + /usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/__locale_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/clock_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/clockid_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/error_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/locale_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/mbstate_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/sigset_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h \ + /usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h \ + /usr/include/x86_64-linux-gnu/bits/types/struct_itimerspec.h \ + /usr/include/x86_64-linux-gnu/bits/types/struct_sched_param.h \ + /usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h \ + /usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h \ + /usr/include/x86_64-linux-gnu/bits/types/struct_tm.h \ + /usr/include/x86_64-linux-gnu/bits/types/time_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/timer_t.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h \ + /usr/include/x86_64-linux-gnu/bits/uintn-identity.h \ + /usr/include/x86_64-linux-gnu/bits/uio_lim.h \ + /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/bits/xopen_lim.h \ + /usr/include/x86_64-linux-gnu/c++/13/bits/atomic_word.h \ + /usr/include/x86_64-linux-gnu/c++/13/bits/c++allocator.h \ + /usr/include/x86_64-linux-gnu/c++/13/bits/c++config.h \ + /usr/include/x86_64-linux-gnu/c++/13/bits/c++locale.h \ + /usr/include/x86_64-linux-gnu/c++/13/bits/cpu_defines.h \ + /usr/include/x86_64-linux-gnu/c++/13/bits/ctype_base.h \ + /usr/include/x86_64-linux-gnu/c++/13/bits/ctype_inline.h \ + /usr/include/x86_64-linux-gnu/c++/13/bits/error_constants.h \ + /usr/include/x86_64-linux-gnu/c++/13/bits/gthr-default.h \ + /usr/include/x86_64-linux-gnu/c++/13/bits/gthr.h \ + /usr/include/x86_64-linux-gnu/c++/13/bits/os_defines.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/sys/single_threaded.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/lib/gcc/x86_64-linux-gnu/13/include/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/13/include/stdarg.h \ + /usr/lib/gcc/x86_64-linux-gnu/13/include/stdbool.h \ + /usr/lib/gcc/x86_64-linux-gnu/13/include/stddef.h \ + /usr/lib/gcc/x86_64-linux-gnu/13/include/stdint.h \ + /usr/lib/gcc/x86_64-linux-gnu/13/include/syslimits.h \ + vendor/cigraph/include/igraph_decls.h \ + vendor/cigraph/include/igraph_types.h \ + vendor/igraph_config.h \ diff --git a/src/rinterface.dd b/src/rinterface.dd index 4e60bfc2463..571daf68b19 100644 --- a/src/rinterface.dd +++ b/src/rinterface.dd @@ -2,3 +2,111 @@ rinterface.o: \ rinterface.c \ rinterface.h \ + /opt/R/4.5.1/lib/R/include/R_ext/Arith.h \ + /opt/R/4.5.1/lib/R/include/R_ext/Boolean.h \ + /opt/R/4.5.1/lib/R/include/R_ext/Complex.h \ + /opt/R/4.5.1/lib/R/include/R_ext/Constants.h \ + /opt/R/4.5.1/lib/R/include/R_ext/Error.h \ + /opt/R/4.5.1/lib/R/include/R_ext/Memory.h \ + /opt/R/4.5.1/lib/R/include/R_ext/Print.h \ + /opt/R/4.5.1/lib/R/include/R_ext/RS.h \ + /opt/R/4.5.1/lib/R/include/R_ext/Random.h \ + /opt/R/4.5.1/lib/R/include/R_ext/Rdynload.h \ + /opt/R/4.5.1/lib/R/include/R_ext/Utils.h \ + /opt/R/4.5.1/lib/R/include/R_ext/libextern.h \ + /opt/R/4.5.1/lib/R/include/Rconfig.h \ + /opt/R/4.5.1/lib/R/include/Rdefines.h \ + /opt/R/4.5.1/lib/R/include/Rinternals.h \ + vendor/cigraph/include/igraph_adjlist.h \ + vendor/cigraph/include/igraph_arpack.h \ + vendor/cigraph/include/igraph_array.h \ + vendor/cigraph/include/igraph_array_pmt.h \ + vendor/cigraph/include/igraph_attributes.h \ + vendor/cigraph/include/igraph_attributes.h \ + vendor/cigraph/include/igraph_bipartite.h \ + vendor/cigraph/include/igraph_bitset.h \ + vendor/cigraph/include/igraph_bitset_list.h \ + vendor/cigraph/include/igraph_blas.h \ + vendor/cigraph/include/igraph_centrality.h \ + vendor/cigraph/include/igraph_cliques.h \ + vendor/cigraph/include/igraph_cocitation.h \ + vendor/cigraph/include/igraph_cohesive_blocks.h \ + vendor/cigraph/include/igraph_coloring.h \ + vendor/cigraph/include/igraph_community.h \ + vendor/cigraph/include/igraph_complex.h \ + vendor/cigraph/include/igraph_components.h \ + vendor/cigraph/include/igraph_constants.h \ + vendor/cigraph/include/igraph_constants.h \ + vendor/cigraph/include/igraph_constructors.h \ + vendor/cigraph/include/igraph_conversion.h \ + vendor/cigraph/include/igraph_cycles.h \ + vendor/cigraph/include/igraph_datatype.h \ + vendor/cigraph/include/igraph_datatype.h \ + vendor/cigraph/include/igraph_decls.h \ + vendor/cigraph/include/igraph_dqueue.h \ + vendor/cigraph/include/igraph_dqueue_pmt.h \ + vendor/cigraph/include/igraph_eigen.h \ + vendor/cigraph/include/igraph_embedding.h \ + vendor/cigraph/include/igraph_epidemics.h \ + vendor/cigraph/include/igraph_error.h \ + vendor/cigraph/include/igraph_error.h \ + vendor/cigraph/include/igraph_eulerian.h \ + vendor/cigraph/include/igraph_flow.h \ + vendor/cigraph/include/igraph_foreign.h \ + vendor/cigraph/include/igraph_games.h \ + vendor/cigraph/include/igraph_graph_list.h \ + vendor/cigraph/include/igraph_graphicality.h \ + vendor/cigraph/include/igraph_graphlets.h \ + vendor/cigraph/include/igraph_heap.h \ + vendor/cigraph/include/igraph_heap_pmt.h \ + vendor/cigraph/include/igraph_hrg.h \ + vendor/cigraph/include/igraph_interface.h \ + vendor/cigraph/include/igraph_interrupt.h \ + vendor/cigraph/include/igraph_iterators.h \ + vendor/cigraph/include/igraph_lapack.h \ + vendor/cigraph/include/igraph_layout.h \ + vendor/cigraph/include/igraph_lsap.h \ + vendor/cigraph/include/igraph_matching.h \ + vendor/cigraph/include/igraph_matrix.h \ + vendor/cigraph/include/igraph_matrix_list.h \ + vendor/cigraph/include/igraph_matrix_pmt.h \ + vendor/cigraph/include/igraph_microscopic_update.h \ + vendor/cigraph/include/igraph_mixing.h \ + vendor/cigraph/include/igraph_motifs.h \ + vendor/cigraph/include/igraph_neighborhood.h \ + vendor/cigraph/include/igraph_nongraph.h \ + vendor/cigraph/include/igraph_operators.h \ + vendor/cigraph/include/igraph_paths.h \ + vendor/cigraph/include/igraph_pmt.h \ + vendor/cigraph/include/igraph_pmt_off.h \ + vendor/cigraph/include/igraph_progress.h \ + vendor/cigraph/include/igraph_psumtree.h \ + vendor/cigraph/include/igraph_qsort.h \ + vendor/cigraph/include/igraph_random.h \ + vendor/cigraph/include/igraph_reachability.h \ + vendor/cigraph/include/igraph_scan.h \ + vendor/cigraph/include/igraph_separators.h \ + vendor/cigraph/include/igraph_sparsemat.h \ + vendor/cigraph/include/igraph_stack.h \ + vendor/cigraph/include/igraph_stack_pmt.h \ + vendor/cigraph/include/igraph_statusbar.h \ + vendor/cigraph/include/igraph_structural.h \ + vendor/cigraph/include/igraph_strvector.h \ + vendor/cigraph/include/igraph_strvector.h \ + vendor/cigraph/include/igraph_topology.h \ + vendor/cigraph/include/igraph_transitivity.h \ + vendor/cigraph/include/igraph_typed_list_pmt.h \ + vendor/cigraph/include/igraph_types.h \ + vendor/cigraph/include/igraph_types.h \ + vendor/cigraph/include/igraph_vector.h \ + vendor/cigraph/include/igraph_vector.h \ + vendor/cigraph/include/igraph_vector_list.h \ + vendor/cigraph/include/igraph_vector_pmt.h \ + vendor/cigraph/include/igraph_vector_ptr.h \ + vendor/cigraph/include/igraph_vector_type.h \ + vendor/cigraph/include/igraph_visitor.h \ + vendor/cigraph/src/graph/attributes.h \ + vendor/cigraph/src/graph/internal.h \ + vendor/igraph_config.h \ + vendor/igraph_export.h \ + vendor/igraph_version.h \ diff --git a/tests/testthat/_snaps/games.md b/tests/testthat/_snaps/games.md index 922ef9a505f..6bd92ed31ed 100644 --- a/tests/testthat/_snaps/games.md +++ b/tests/testthat/_snaps/games.md @@ -3,6 +3,9 @@ Code sample_degseq(exponential_degrees, method = "vl") Condition + Warning: + The `method` argument of `sample_degseq()` is deprecated as of igraph 2.1.0. + i Please use the `algorithm` argument instead. Error in `sample_degseq()`: ! At vendor/cigraph/src/games/degree_sequence_vl/gengraph_mr-connected.cpp: : Cannot make a connected graph from the given degree sequence. Invalid value @@ -11,6 +14,9 @@ Code sample_degseq(powerlaw_degrees, method = "vl") Condition + Warning: + The `method` argument of `sample_degseq()` is deprecated as of igraph 2.1.0. + i Please use the `algorithm` argument instead. Error in `sample_degseq()`: ! At vendor/cigraph/src/games/degree_sequence_vl/gengraph_mr-connected.cpp: : Cannot realize the given degree sequence as an undirected, simple graph. Invalid value diff --git a/tools/stimulus/functions-R.yaml b/tools/stimulus/functions-R.yaml index 672f3318818..b82baf76152 100644 --- a/tools/stimulus/functions-R.yaml +++ b/tools/stimulus/functions-R.yaml @@ -83,6 +83,10 @@ igraph_ring: igraph_kary_tree: IGNORE: RR, RC +igraph_tree_game: + PARAM_NAMES: + method: algorithm + igraph_full: IGNORE: RR, RC @@ -106,16 +110,20 @@ igraph_realize_degree_sequence: PARAMS: |- OUT GRAPH graph, VECTOR_INT out_deg, OPTIONAL VECTOR_INT in_deg, EDGE_TYPE_SW allowed_edge_types=SIMPLE, REALIZE_DEGSEQ_METHOD method=SMALLEST + PARAM_NAMES: + method: algorithm R: GATTR: name: Graph from degree sequence - GATTR-PARAM: out_deg, in_deg, allowed_edge_types, method + GATTR-PARAM: out_deg, in_deg, allowed_edge_types, algorithm igraph_realize_bipartite_degree_sequence: + PARAM_NAMES: + method: algorithm R: GATTR: name: Bipartite graph from degree sequence - GATTR-PARAM: degrees1, degrees2, allowed_edge_types, method + GATTR-PARAM: degrees1, degrees2, allowed_edge_types, algorithm igraph_full_multipartite: DEPS: types ON res$graph @@ -361,7 +369,13 @@ igraph_harmonic_centrality: igraph_pagerank: IGNORE: RR, RC, RInit +igraph_personalized_pagerank: + PARAM_NAMES: + algo: algorithm + igraph_personalized_pagerank_vs: + PARAM_NAMES: + algo: algorithm DEPS: vids ON graph, weights ON graph, vector ON graph vids, options ON algo, reset_vids ON graph @@ -951,6 +965,14 @@ igraph_eigen_matrix_symmetric: # Finding cycles ####################################### +igraph_feedback_arc_set: + PARAM_NAMES: + algo: algorithm + +igraph_feedback_vertex_set: + PARAM_NAMES: + algo: algorithm + igraph_simple_cycles_callback: IGNORE: RR, RC