From 0af9996bf1064bd1f8987cf97fc359601a1df084 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Sun, 26 Oct 2025 18:00:39 +0100 Subject: [PATCH] feat: All arguments in calls to `_impl()` functions are named --- R/assortativity.R | 15 +- R/centrality.R | 2 +- R/centralization.R | 6 +- R/cliques.R | 12 +- R/community.R | 15 +- R/components.R | 16 +- R/conversion.R | 5 +- R/cycles.R | 9 +- R/embedding.R | 9 +- R/eulerian.R | 10 +- R/flow.R | 8 +- R/games.R | 18 +- R/hrg.R | 8 +- R/interface.R | 10 +- R/layout.R | 48 +- R/make.R | 36 +- R/motifs.R | 17 +- R/other.R | 4 +- R/paths.R | 33 +- R/random_walk.R | 20 +- R/similarity.R | 20 +- R/structural-properties.R | 22 +- R/trees.R | 11 +- tests/testthat/_snaps/aaa-auto.md | 1042 +++--- tests/testthat/test-aaa-auto.R | 5223 ++++++++++++++++++++++------- tools/ensure-impl-named.R | 74 + 26 files changed, 4893 insertions(+), 1800 deletions(-) create mode 100644 tools/ensure-impl-named.R diff --git a/R/assortativity.R b/R/assortativity.R index e6f9c98ca93..b33f9a7395d 100644 --- a/R/assortativity.R +++ b/R/assortativity.R @@ -212,7 +212,13 @@ assortativity <- function( values.in <- types2 } - assortativity_impl(graph, values, values.in, directed, normalized) + assortativity_impl( + graph = graph, + values = values, + values.in = values.in, + directed = directed, + normalized = normalized + ) } assortativity_legacy <- function( @@ -221,7 +227,12 @@ assortativity_legacy <- function( types2 = NULL, directed = TRUE ) { - assortativity_impl(graph, types1, types2, directed) + assortativity_impl( + graph = graph, + values = types1, + values.in = types2, + directed = directed + ) } #' @param types Vector giving the vertex types. They as assumed to be integer diff --git a/R/centrality.R b/R/centrality.R index 54f9c4bbb00..52933d5b67d 100644 --- a/R/centrality.R +++ b/R/centrality.R @@ -1245,7 +1245,7 @@ spectrum <- function( } eigen_adjacency_impl( - graph, + graph = graph, algorithm = algorithm, which = which, options = options diff --git a/R/centralization.R b/R/centralization.R index 6fa6678fdc5..681db87cdac 100644 --- a/R/centralization.R +++ b/R/centralization.R @@ -424,7 +424,7 @@ centr_degree_tmax <- function( # Function call res <- centralization_degree_tmax_impl( - graph, + graph = graph, nodes = nodes, mode = mode, loops = loops @@ -676,9 +676,9 @@ centr_eigen <- function( centralization_eigenvector_centrality_impl( graph = graph, directed = directed, + scale = TRUE, options = options, - normalized = normalized, - scale = TRUE + normalized = normalized ) } diff --git a/R/cliques.R b/R/cliques.R index ec3ee54fdd8..0a32a9aabbd 100644 --- a/R/cliques.R +++ b/R/cliques.R @@ -611,9 +611,17 @@ independence_number <- ivs_size #' @cdocs igraph_clique_size_hist clique_size_counts <- function(graph, min = 0, max = 0, maximal = FALSE) { if (maximal) { - maximal_cliques_hist_impl(graph, min, max) + maximal_cliques_hist_impl( + graph = graph, + min.size = min, + max.size = max + ) } else { - clique_size_hist_impl(graph, min, max) + clique_size_hist_impl( + graph = graph, + min.size = min, + max.size = max + ) } } diff --git a/R/community.R b/R/community.R index af6497a92c6..75a79a4b47d 100644 --- a/R/community.R +++ b/R/community.R @@ -1698,9 +1698,8 @@ cluster_leiden <- function( membership <- initial_membership if (n_iterations > 0) { res <- community_leiden_impl( - graph, + graph = graph, weights = weights, - # FIXME: Also check below, might not be covered by tests vertex.weights = vertex_weights, resolution = resolution, beta = beta, @@ -1708,6 +1707,7 @@ cluster_leiden <- function( n.iterations = n_iterations, membership = membership ) + membership <- res$membership } else { prev_quality <- -Inf @@ -1715,9 +1715,8 @@ cluster_leiden <- function( while (prev_quality < quality) { prev_quality <- quality res <- community_leiden_impl( - graph, + graph = graph, weights = weights, - # FIXME: Also check above, might not be covered by tests vertex.weights = vertex_weights, resolution = resolution, beta = beta, @@ -1725,6 +1724,7 @@ cluster_leiden <- function( n.iterations = 1, membership = membership ) + membership <- res$membership quality <- res$quality } @@ -2413,12 +2413,13 @@ cluster_label_prop0 <- function( # Function call membership <- community_label_propagation_impl( - graph, + graph = graph, mode = mode, weights = weights, initial = initial, fixed = fixed ) + res <- list() if (igraph_opt("add.vertex.names") && is_named(graph)) { res$names <- V(graph)$name @@ -2605,9 +2606,10 @@ cluster_optimal <- function(graph, weights = NULL) { # Function call res <- community_optimal_modularity_impl( - graph, + graph = graph, weights = weights ) + if (igraph_opt("add.vertex.names") && is_named(graph)) { res$names <- V(graph)$name } @@ -3304,7 +3306,6 @@ voronoi_cells <- function( voronoi_impl( graph = graph, generators = generators, - ..., weights = weights, mode = mode, tiebreaker = tiebreaker diff --git a/R/components.R b/R/components.R index 8e3ccb8fed9..bd8a0bbb785 100644 --- a/R/components.R +++ b/R/components.R @@ -258,14 +258,18 @@ decompose <- function( #' @export #' @cdocs igraph_articulation_points articulation_points <- function(graph) { - articulation_points_impl(graph = graph) + articulation_points_impl( + graph = graph + ) } #' @rdname articulation_points #' @export #' @cdocs igraph_bridges bridges <- function(graph) { - bridges_impl(graph = graph) + bridges_impl( + graph = graph + ) } @@ -319,7 +323,9 @@ bridges <- function(graph) { #' @cdocs igraph_biconnected_components biconnected_components <- function(graph) { # Function call - res <- biconnected_components_impl(graph) + res <- biconnected_components_impl( + graph = graph + ) # TODO: Clean up after fixing "." / "_" problem. # See https://github.com/igraph/rigraph/issues/1203 @@ -388,7 +394,9 @@ biconnected_components <- function(graph) { #' @export #' @cdocs igraph_is_biconnected is_biconnected <- function(graph) { - is_biconnected_impl(graph = graph) + is_biconnected_impl( + graph = graph + ) } diff --git a/R/conversion.R b/R/conversion.R index 534d772770b..4de5467dd4c 100644 --- a/R/conversion.R +++ b/R/conversion.R @@ -965,7 +965,10 @@ get.incidence.dense <- function( ) { if (is.null(attr)) { ## Function call - res <- get_biadjacency_impl(graph, types) + res <- get_biadjacency_impl( + graph = graph, + types = types + ) if (names && "name" %in% vertex_attr_names(graph)) { rownames(res$res) <- V(graph)$name[res$row_ids] diff --git a/R/cycles.R b/R/cycles.R index e74e3fd9465..af003d8310f 100644 --- a/R/cycles.R +++ b/R/cycles.R @@ -97,5 +97,12 @@ simple_cycles <- function( # Argument checks ensure_igraph(graph) - simple_cycles_impl(graph, mode, min %||% -1, max %||% -1) + simple_cycles_impl( + graph = graph, + mode = mode, + min.cycle.length = min %||% + -1, + max.cycle.length = max %||% + -1 + ) } diff --git a/R/embedding.R b/R/embedding.R index da8c4ad1557..406f7338aa9 100644 --- a/R/embedding.R +++ b/R/embedding.R @@ -183,7 +183,9 @@ embed_adjacency_matrix <- function( #' @export #' @cdocs igraph_dim_select dim_select <- function(sv) { - dim_select_impl(sv = sv) + dim_select_impl( + sv = sv + ) } @@ -398,5 +400,8 @@ sample_sphere_volume <- function(dim, n = 1, radius = 1, positive = TRUE) { #' colSums(lpvs.dir) sample_dirichlet <- function(n, alpha) { # Use the _impl function - sample_dirichlet_impl(n = n, alpha = alpha) + sample_dirichlet_impl( + n = n, + alpha = alpha + ) } diff --git a/R/eulerian.R b/R/eulerian.R index baf9ea992fa..592209653b6 100644 --- a/R/eulerian.R +++ b/R/eulerian.R @@ -68,14 +68,20 @@ #' @export #' @cdocs igraph_is_eulerian has_eulerian_path <- function(graph) { - is_eulerian_impl(graph)$has_path + res <- is_eulerian_impl( + graph = graph + ) + res$has_path } #' @rdname has_eulerian_path #' @export #' @cdocs igraph_is_eulerian has_eulerian_cycle <- function(graph) { - is_eulerian_impl(graph)$has_cycle + res <- is_eulerian_impl( + graph = graph + ) + res$has_cycle } #' @rdname has_eulerian_path diff --git a/R/flow.R b/R/flow.R index a4a221d283b..6881b9ab5e6 100644 --- a/R/flow.R +++ b/R/flow.R @@ -978,7 +978,9 @@ dominator_tree <- function(graph, root, mode = c("out", "in", "all", "total")) { #' @family flow #' @cdocs igraph_all_minimal_st_separators min_st_separators <- function(graph) { - all_minimal_st_separators_impl(graph = graph) + all_minimal_st_separators_impl( + graph = graph + ) } @@ -1214,5 +1216,7 @@ is_min_separator <- function(graph, candidate) { #' min_separators(camp) #' @cdocs igraph_minimum_size_separators min_separators <- function(graph) { - minimum_size_separators_impl(graph = graph) + minimum_size_separators_impl( + graph = graph + ) } diff --git a/R/games.R b/R/games.R index 0d848daabca..9e79b4dcb2a 100644 --- a/R/games.R +++ b/R/games.R @@ -1469,7 +1469,6 @@ sample_growing <- function(n, m = 1, ..., directed = TRUE, citation = FALSE) { growing_random_game_impl( n = n, m = m, - ..., directed = directed, citation = citation ) @@ -2576,7 +2575,13 @@ sample_hierarchical_sbm <- function(n, m, rho, C, p) { commonlen <- unique(c(mlen, rholen, Clen)) if (length(commonlen) == 1 && commonlen == 1) { - hsbm_game_impl(n, m, rho, C, p) + hsbm_game_impl( + n = n, + m = m, + rho = rho, + C = C, + p = p + ) } else { commonlen <- setdiff(commonlen, 1) if (length(commonlen) != 1) { @@ -2593,7 +2598,13 @@ sample_hierarchical_sbm <- function(n, m, rho, C, p) { } else { rep(list(C), length.out = commonlen) } - hsbm_list_game_impl(n, m, rho, C, p) + hsbm_list_game_impl( + n = n, + mlist = m, + rholist = rho, + Clist = C, + p = p + ) } } @@ -2900,7 +2911,6 @@ sample_chung_lu <- function( chung_lu_game_impl( out.weights = out.weights, in.weights = in.weights, - ..., loops = loops, variant = variant ) diff --git a/R/hrg.R b/R/hrg.R index 7532b814e1b..3606f41b158 100644 --- a/R/hrg.R +++ b/R/hrg.R @@ -357,7 +357,9 @@ hrg_tree <- function(hrg) { ) } - out <- from_hrg_dendrogram_impl(hrg) + out <- from_hrg_dendrogram_impl( + hrg = hrg + ) g <- out$graph set_vertex_attr(g, "probability", value = out$prob) @@ -382,7 +384,9 @@ sample_hrg <- function(hrg) { ) } - hrg_game_impl(hrg) + hrg_game_impl( + hrg = hrg + ) } #' Predict edges based on a hierarchical random graph model #' diff --git a/R/interface.R b/R/interface.R index 44e0efc67c0..2866284a20d 100644 --- a/R/interface.R +++ b/R/interface.R @@ -356,7 +356,11 @@ neighbors <- function(graph, v, mode = c("out", "in", "all", "total")) { stop("No vertex was specified") } - neighbors_impl(graph, vid = v, mode = mode) + neighbors_impl( + graph = graph, + vid = v, + mode = mode + ) } #' Incident edges of a vertex in a graph @@ -613,7 +617,9 @@ get.edge.ids <- function( #' vcount(g) #' @cdocs igraph_vcount vcount <- function(graph) { - as.numeric(vcount_impl(graph)) + as.numeric(vcount_impl( + graph = graph + )) } #' @export diff --git a/R/layout.R b/R/layout.R index 53aa268cee4..67f3a086c78 100644 --- a/R/layout.R +++ b/R/layout.R @@ -608,7 +608,13 @@ layout_as_bipartite <- function( ## Argument checks ensure_igraph(graph) # Use the _impl function - layout_bipartite_impl(graph, types, hgap, vgap, maxiter) + layout_bipartite_impl( + graph = graph, + types = types, + hgap = hgap, + vgap = vgap, + maxiter = maxiter + ) } @@ -658,7 +664,11 @@ layout_as_star <- function(graph, center = V(graph)[1], order = NULL) { return(layout_in_circle(graph)) } # Use the _impl function - layout_star_impl(graph, center, order) + layout_star_impl( + graph = graph, + center = center, + order = order + ) } @@ -823,7 +833,10 @@ layout.reingold.tilford <- function(..., params = list()) { #' plot(karate, layout = coords) layout_in_circle <- function(graph, order = V(graph)) { # Use the _impl function - layout_circle_impl(graph, order) + layout_circle_impl( + graph = graph, + order = order + ) } #' @rdname layout_in_circle @@ -1013,9 +1026,16 @@ layout_on_grid <- function(graph, width = 0, height = 0, dim = 2) { # Function call if (dim == 2) { - layout_grid_impl(graph, width) + layout_grid_impl( + graph = graph, + width = width + ) } else { - layout_grid_3d_impl(graph, width, height) + layout_grid_3d_impl( + graph = graph, + width = width, + height = height + ) } } @@ -1061,7 +1081,9 @@ layout.grid.3d <- function(graph, width = 0, height = 0) { #' @family graph layouts layout_on_sphere <- function(graph) { # Use the _impl function - layout_sphere_impl(graph) + layout_sphere_impl( + graph = graph + ) } @@ -1110,9 +1132,13 @@ layout_randomly <- function(graph, dim = c(2, 3)) { dim <- igraph.match.arg(dim) if (dim == 2) { - layout_random_impl(graph) + layout_random_impl( + graph = graph + ) } else if (dim == 3) { - layout_random_3d_impl(graph) + layout_random_3d_impl( + graph = graph + ) } } @@ -2043,7 +2069,11 @@ layout_with_mds <- function( dim <- as.numeric(dim) # Function call - layout_mds_impl(graph, dist, dim) + layout_mds_impl( + graph = graph, + dist = dist, + dim = dim + ) } diff --git a/R/make.R b/R/make.R index 7547b44e593..dedafc629e3 100644 --- a/R/make.R +++ b/R/make.R @@ -384,7 +384,11 @@ graph.lcf <- function(n, shifts, repeats = 1) { # nocov start lifecycle::deprecate_soft("2.1.0", "graph.lcf()", "graph_from_lcf()") # Use the _impl function - lcf_vector_impl(n = n, shifts = shifts, repeats = repeats) + lcf_vector_impl( + n = n, + shifts = shifts, + repeats = repeats + ) } # nocov end #' Create a lattice graph @@ -438,7 +442,14 @@ graph.lattice <- function( } on.exit(.Call(R_igraph_finalizer)) - res <- square_lattice_impl(dimvector, nei, directed, mutual, periodic) + res <- square_lattice_impl( + dimvector = dimvector, + nei = nei, + directed = directed, + mutual = mutual, + periodic = periodic + ) + if (igraph_opt("add.params")) { res$name <- "Lattice graph" res$dimvector <- dimvector @@ -1595,7 +1606,10 @@ make_empty_graph <- function(n = 0, directed = TRUE) { "{.arg directed} must be a logical, not {.obj_type_friendly {directed}}." ) } - empty_impl(n, directed) + empty_impl( + n = n, + directed = directed + ) } #' @rdname make_empty_graph @@ -1983,7 +1997,14 @@ make_lattice <- function( } on.exit(.Call(R_igraph_finalizer)) - res <- square_lattice_impl(dimvector, nei, directed, mutual, periodic) + res <- square_lattice_impl( + dimvector = dimvector, + nei = nei, + directed = directed, + mutual = mutual, + periodic = periodic + ) + if (igraph_opt("add.params")) { res$name <- "Lattice graph" res$dimvector <- dimvector @@ -2637,7 +2658,11 @@ graph_from_lcf <- function( ) } - lcf_vector_impl(n = n, shifts = shifts, repeats = repeats) + lcf_vector_impl( + n = n, + shifts = shifts, + repeats = repeats + ) } ## ----------------------------------------------------------------- @@ -2803,6 +2828,7 @@ realize_bipartite_degseq <- function( allowed.edge.types = allowed.edge.types, method = method ) + V(g)$type <- c(rep(TRUE, length(degrees1)), rep(FALSE, length(degrees2))) g } diff --git a/R/motifs.R b/R/motifs.R index cca68c34749..49b697dcd04 100644 --- a/R/motifs.R +++ b/R/motifs.R @@ -156,10 +156,11 @@ motifs <- function(graph, size = 3, cut.prob = NULL) { } res <- motifs_randesu_impl( - graph, + graph = graph, size = size, cut.prob = cut.prob ) + res[is.nan(res)] <- NA res } @@ -197,7 +198,7 @@ count_motifs <- function(graph, size = 3, cut.prob = NULL) { } motifs_randesu_no_impl( - graph, + graph = graph, size = size, cut.prob = cut.prob ) @@ -258,11 +259,11 @@ sample_motifs <- function( } motifs_randesu_estimate_impl( - graph, + graph = graph, size = size, cut.prob = cut.prob, sample.size = sample.size, - sample + sample = sample ) } @@ -309,7 +310,9 @@ dyad_census <- function(graph) { warn("`dyad_census()` requires a directed graph.") } - dyad_census_impl(graph) + dyad_census_impl( + graph = graph + ) } @@ -395,5 +398,7 @@ dyad_census <- function(graph) { #' @export #' @cdocs igraph_triad_census triad_census <- function(graph) { - triad_census_impl(graph = graph) + triad_census_impl( + graph = graph + ) } diff --git a/R/other.R b/R/other.R index a28d2cf8c8c..a11c8ae8932 100644 --- a/R/other.R +++ b/R/other.R @@ -224,5 +224,7 @@ igraph.i.spMatrix <- function(M) { #' @export #' @cdocs igraph_convex_hull convex_hull <- function(data) { - convex_hull_2d_impl(data = data) + convex_hull_2d_impl( + data = data + ) } diff --git a/R/paths.R b/R/paths.R index 857bbf8bf04..972bcc136b7 100644 --- a/R/paths.R +++ b/R/paths.R @@ -120,7 +120,7 @@ all_simple_paths <- function( res <- with_igraph_opt( list(return.vs.es = FALSE), get_all_simple_paths_impl( - graph, + graph = graph, from = from, to = to, cutoff = cutoff, @@ -161,7 +161,9 @@ all_simple_paths <- function( #' @export #' @cdocs igraph_is_dag is_dag <- function(graph) { - is_dag_impl(graph = graph) + is_dag_impl( + graph = graph + ) } #' Acyclic graphs @@ -186,7 +188,9 @@ is_dag <- function(graph) { #' @export #' @cdocs igraph_is_acyclic is_acyclic <- function(graph) { - is_acyclic_impl(graph = graph) + is_acyclic_impl( + graph = graph + ) } #' Maximum cardinality search @@ -245,7 +249,9 @@ is_acyclic <- function(graph) { #' @family chordal #' @cdocs igraph_maximum_cardinality_search max_cardinality <- function(graph) { - maximum_cardinality_search_impl(graph = graph) + maximum_cardinality_search_impl( + graph = graph + ) } @@ -300,7 +306,12 @@ eccentricity <- function( } } - eccentricity_dijkstra_impl(graph, vids = vids, weights = weights, mode = mode) + eccentricity_dijkstra_impl( + graph = graph, + vids = vids, + weights = weights, + mode = mode + ) } @@ -354,7 +365,11 @@ radius <- function( } } - radius_dijkstra_impl(graph, weights = weights, mode = mode) + radius_dijkstra_impl( + graph = graph, + weights = weights, + mode = mode + ) } #' Central vertices of a graph @@ -392,7 +407,6 @@ graph_center <- function( ) { graph_center_dijkstra_impl( graph = graph, - ..., weights = weights, mode = mode ) @@ -404,5 +418,8 @@ graph_center <- function( #' @export #' @cdocs igraph_path_length_hist distance_table <- function(graph, directed = TRUE) { - path_length_hist_impl(graph = graph, directed = directed) + path_length_hist_impl( + graph = graph, + directed = directed + ) } diff --git a/R/random_walk.R b/R/random_walk.R index 3df2c6edd8a..bb78e0e5175 100644 --- a/R/random_walk.R +++ b/R/random_walk.R @@ -58,7 +58,15 @@ random_walk <- function( ) { mode <- match.arg(mode) stuck <- match.arg(stuck) - out <- random_walk_impl(graph, start, steps, weights, mode, stuck) + out <- random_walk_impl( + graph = graph, + start = start, + steps = steps, + weights = weights, + mode = mode, + stuck = stuck + ) + # FIXME: Support returning the full structure out$vertices } @@ -76,7 +84,15 @@ random_edge_walk <- function( ) { mode <- match.arg(mode) stuck <- match.arg(stuck) - out <- random_walk_impl(graph, start, steps, weights, mode, stuck) + out <- random_walk_impl( + graph = graph, + start = start, + steps = steps, + weights = weights, + mode = mode, + stuck = stuck + ) + # FIXME: Support returning the full structure out$edges } diff --git a/R/similarity.R b/R/similarity.R index b86fd2f9c3e..0577c12dd6d 100644 --- a/R/similarity.R +++ b/R/similarity.R @@ -68,11 +68,25 @@ similarity <- function( ) { method <- igraph.match.arg(method) if (method == "jaccard") { - similarity_jaccard_impl(graph, vids, mode, loops) + similarity_jaccard_impl( + graph = graph, + vids = vids, + mode = mode, + loops = loops + ) } else if (method == "dice") { - similarity_dice_impl(graph, vids, mode, loops) + similarity_dice_impl( + graph = graph, + vids = vids, + mode = mode, + loops = loops + ) } else if (method == "invlogweighted") { - similarity_inverse_log_weighted_impl(graph, vids, mode) + similarity_inverse_log_weighted_impl( + graph = graph, + vids = vids, + mode = mode + ) } } diff --git a/R/structural-properties.R b/R/structural-properties.R index b99ba9e37f5..45cdcb07deb 100644 --- a/R/structural-properties.R +++ b/R/structural-properties.R @@ -905,11 +905,12 @@ degree <- function( mode <- igraph.match.arg(mode) res <- degree_impl( - graph, + graph = graph, vids = v, mode = mode, loops = loops ) + if (normalized) { res <- res / (vcount(graph) - 1) } @@ -1371,14 +1372,14 @@ all_shortest_paths <- function( if (is.null(weights)) { res <- get_all_shortest_paths_impl( - graph, + graph = graph, from = from, to = to, mode = mode ) } else { res <- get_all_shortest_paths_dijkstra_impl( - graph, + graph = graph, from = from, to = to, weights = weights, @@ -1447,7 +1448,6 @@ k_shortest_paths <- function( from = from, to = to, k = k, - ..., weights = weights, mode = mode ) @@ -3260,9 +3260,19 @@ laplacian_matrix <- function( on.exit(.Call(R_igraph_finalizer)) # Function call if (sparse) { - res <- get_laplacian_sparse_impl(graph, "out", normalization, weights) + res <- get_laplacian_sparse_impl( + graph = graph, + mode = "out", + normalization = normalization, + weights = weights + ) } else { - res <- get_laplacian_impl(graph, "out", normalization, weights) + res <- get_laplacian_impl( + graph = graph, + mode = "out", + normalization = normalization, + weights = weights + ) } if (sparse) { res <- igraph.i.spMatrix(res) diff --git a/R/trees.R b/R/trees.R index 49e0e3d45f7..32eeb8669e0 100644 --- a/R/trees.R +++ b/R/trees.R @@ -46,7 +46,12 @@ is_tree <- function( mode = c("out", "in", "all", "total"), details = FALSE ) { - out <- is_tree_impl(graph, mode, details) + out <- is_tree_impl( + graph = graph, + mode = mode, + details = details + ) + if (isTRUE(details) && !out$res && vcount(graph) > 0) { out$root <- V(graph)[1] } @@ -134,7 +139,9 @@ is_forest <- function( #' @export #' @cdocs igraph_to_prufer to_prufer <- function(graph) { - to_prufer_impl(graph = graph) + to_prufer_impl( + graph = graph + ) } #' Samples from the spanning trees of a graph randomly and uniformly diff --git a/tests/testthat/_snaps/aaa-auto.md b/tests/testthat/_snaps/aaa-auto.md index b820114a9e0..8fdfd147c22 100644 --- a/tests/testthat/_snaps/aaa-auto.md +++ b/tests/testthat/_snaps/aaa-auto.md @@ -9,7 +9,7 @@ --- Code - empty_impl(5, directed = FALSE) + empty_impl(n = 5, directed = FALSE) Output IGRAPH U--- 5 0 -- + edges: @@ -25,7 +25,7 @@ # add_edges_impl basic Code - add_edges_impl(g, c(0, 1, 1, 2)) + add_edges_impl(graph = g, edges = c(0, 1, 1, 2)) Output IGRAPH D--- 3 2 -- + edges: @@ -42,7 +42,7 @@ # copy_impl basic Code - copy_impl(g) + copy_impl(from = g) Output IGRAPH D--- 2 0 -- + edges: @@ -58,7 +58,7 @@ # delete_vertices_idx_impl basic Code - delete_vertices_idx_impl(g, 1) + delete_vertices_idx_impl(graph = g, vertices = 1) Output $graph IGRAPH D--- 2 0 -- @@ -82,7 +82,7 @@ # vcount_impl basic Code - vcount_impl(g) + vcount_impl(graph = g) Output [1] 4 @@ -97,14 +97,14 @@ # degree_impl basic Code - degree_impl(g) + degree_impl(graph = g) Output [1] 0 0 0 --- Code - degree_impl(g, mode = "in") + degree_impl(graph = g, mode = "in") Output [1] 0 0 0 @@ -119,7 +119,7 @@ # get_all_eids_between_impl basic Code - get_all_eids_between_impl(g, 1, 2) + get_all_eids_between_impl(graph = g, from = 1, to = 2) Output + 0/0 edges: @@ -134,7 +134,7 @@ # wheel_impl basic Code - wheel_impl(5) + wheel_impl(n = 5) Output IGRAPH D--- 5 8 -- + edges: @@ -143,7 +143,7 @@ --- Code - wheel_impl(5, mode = "in", center = 2) + wheel_impl(n = 5, mode = "in", center = 2) Output IGRAPH D--- 5 8 -- + edges: @@ -160,7 +160,7 @@ # hypercube_impl basic Code - hypercube_impl(3) + hypercube_impl(n = 3) Output IGRAPH U--- 8 12 -- + edges: @@ -169,7 +169,7 @@ --- Code - hypercube_impl(3, directed = TRUE) + hypercube_impl(n = 3, directed = TRUE) Output IGRAPH D--- 8 12 -- + edges: @@ -186,7 +186,7 @@ # square_lattice_impl basic Code - square_lattice_impl(c(2, 2)) + square_lattice_impl(dimvector = c(2, 2)) Output IGRAPH U--- 4 4 -- + edges: @@ -195,8 +195,8 @@ --- Code - square_lattice_impl(c(2, 2), nei = 2, directed = TRUE, mutual = TRUE, periodic = c( - TRUE, TRUE)) + square_lattice_impl(dimvector = c(2, 2), nei = 2, directed = TRUE, mutual = TRUE, + periodic = c(TRUE, TRUE)) Output IGRAPH D--- 4 10 -- + edges: @@ -213,7 +213,7 @@ # triangular_lattice_impl basic Code - triangular_lattice_impl(c(2, 2)) + triangular_lattice_impl(dimvector = c(2, 2)) Output IGRAPH U--- 4 5 -- + edges: @@ -222,7 +222,7 @@ --- Code - triangular_lattice_impl(c(2, 2), directed = TRUE, mutual = TRUE) + triangular_lattice_impl(dimvector = c(2, 2), directed = TRUE, mutual = TRUE) Output IGRAPH D--- 4 10 -- + edges: @@ -239,7 +239,7 @@ # path_graph_impl basic Code - path_graph_impl(5) + path_graph_impl(n = 5) Output IGRAPH U--- 5 4 -- + edges: @@ -248,7 +248,7 @@ --- Code - path_graph_impl(5, directed = TRUE, mutual = TRUE) + path_graph_impl(n = 5, directed = TRUE, mutual = TRUE) Output IGRAPH D--- 5 8 -- + edges: @@ -265,7 +265,7 @@ # cycle_graph_impl basic Code - cycle_graph_impl(5) + cycle_graph_impl(n = 5) Output IGRAPH U--- 5 5 -- + edges: @@ -274,7 +274,7 @@ --- Code - cycle_graph_impl(5, directed = TRUE, mutual = TRUE) + cycle_graph_impl(n = 5, directed = TRUE, mutual = TRUE) Output IGRAPH D--- 5 10 -- + edges: @@ -291,7 +291,7 @@ # symmetric_tree_impl basic Code - symmetric_tree_impl(3) + symmetric_tree_impl(branches = 3) Output IGRAPH D--- 4 3 -- + edges: @@ -300,7 +300,7 @@ --- Code - symmetric_tree_impl(3, type = "in") + symmetric_tree_impl(branches = 3, type = "in") Output IGRAPH D--- 4 3 -- + edges: @@ -317,7 +317,7 @@ # regular_tree_impl basic Code - regular_tree_impl(2) + regular_tree_impl(h = 2) Output IGRAPH U--- 10 9 -- + edges: @@ -326,7 +326,7 @@ --- Code - regular_tree_impl(2, k = 4, type = "in") + regular_tree_impl(h = 2, k = 4, type = "in") Output IGRAPH D--- 17 16 -- + edges: @@ -344,7 +344,7 @@ # full_citation_impl basic Code - full_citation_impl(5) + full_citation_impl(n = 5) Output IGRAPH D--- 5 10 -- + edges: @@ -353,7 +353,7 @@ --- Code - full_citation_impl(5, directed = FALSE) + full_citation_impl(n = 5, directed = FALSE) Output IGRAPH U--- 5 10 -- + edges: @@ -370,7 +370,7 @@ # atlas_impl basic Code - atlas_impl(0) + atlas_impl(number = 0) Output IGRAPH U--- 0 0 -- + edges: @@ -378,7 +378,7 @@ --- Code - atlas_impl(5) + atlas_impl(number = 5) Output IGRAPH U--- 3 1 -- + edge: @@ -395,7 +395,7 @@ # extended_chordal_ring_impl basic Code - extended_chordal_ring_impl(5, matrix(c(1, 2))) + extended_chordal_ring_impl(nodes = 5, W = matrix(c(1, 2))) Output IGRAPH U--- 5 15 -- + edges: @@ -404,7 +404,7 @@ --- Code - extended_chordal_ring_impl(5, matrix(c(1, 2)), directed = TRUE) + extended_chordal_ring_impl(nodes = 5, W = matrix(c(1, 2)), directed = TRUE) Output IGRAPH D--- 5 15 -- + edges: @@ -421,7 +421,7 @@ # graph_power_impl basic Code - graph_power_impl(g, 2) + graph_power_impl(graph = g, order = 2) Output IGRAPH U--- 5 7 -- + edges: @@ -430,7 +430,7 @@ --- Code - graph_power_impl(g, 2, directed = TRUE) + graph_power_impl(graph = g, order = 2, directed = TRUE) Output IGRAPH U--- 5 7 -- + edges: @@ -447,7 +447,7 @@ # linegraph_impl basic Code - linegraph_impl(g) + linegraph_impl(graph = g) Output IGRAPH U--- 4 3 -- + edges: @@ -464,7 +464,7 @@ # de_bruijn_impl basic Code - de_bruijn_impl(2, 3) + de_bruijn_impl(m = 2, n = 3) Output IGRAPH D--- 8 16 -- + edges: @@ -482,7 +482,7 @@ # kautz_impl basic Code - kautz_impl(2, 3) + kautz_impl(m = 2, n = 3) Output IGRAPH D--- 24 48 -- + edges: @@ -503,7 +503,7 @@ # lcf_vector_impl basic Code - lcf_vector_impl(10, c(3, -3, 4), 2) + lcf_vector_impl(n = 10, shifts = c(3, -3, 4), repeats = 2) Output IGRAPH U--- 10 16 -- LCF graph + attr: name (g/c) @@ -522,7 +522,7 @@ # mycielski_graph_impl basic Code - mycielski_graph_impl(3) + mycielski_graph_impl(k = 3) Output IGRAPH U--- 5 5 -- + edges: @@ -539,7 +539,7 @@ # adjlist_impl basic Code - adjlist_impl(list(c(2, 3), c(1), c(1)), mode = "out") + adjlist_impl(adjlist = list(c(2, 3), c(1), c(1)), mode = "out") Output IGRAPH D--- 3 4 -- + edges: @@ -556,7 +556,7 @@ # full_bipartite_impl basic Code - full_bipartite_impl(2, 3) + full_bipartite_impl(n1 = 2, n2 = 3) Output $graph IGRAPH U--- 5 6 -- @@ -570,7 +570,7 @@ --- Code - full_bipartite_impl(2, 3, directed = TRUE, mode = "in") + full_bipartite_impl(n1 = 2, n2 = 3, directed = TRUE, mode = "in") Output $graph IGRAPH D--- 5 6 -- @@ -592,7 +592,7 @@ # full_multipartite_impl basic Code - full_multipartite_impl(c(2, 3, 4)) + full_multipartite_impl(n = c(2, 3, 4)) Output $graph IGRAPH U--- 9 26 -- @@ -607,7 +607,7 @@ --- Code - full_multipartite_impl(c(2, 3, 4), directed = TRUE, mode = "in") + full_multipartite_impl(n = c(2, 3, 4), directed = TRUE, mode = "in") Output $graph IGRAPH D--- 9 26 -- @@ -630,7 +630,7 @@ # realize_degree_sequence_impl basic Code - realize_degree_sequence_impl(c(2, 2, 2)) + realize_degree_sequence_impl(out.deg = c(2, 2, 2)) Output IGRAPH U--- 3 3 -- Graph from degree sequence + attr: name (g/c), out.deg (g/n), in.deg (g/x), allowed.edge.types @@ -641,8 +641,8 @@ --- Code - realize_degree_sequence_impl(c(2, 2, 2), c(2, 2, 2), allowed.edge.types = "simple", - method = "largest") + realize_degree_sequence_impl(out.deg = c(2, 2, 2), in.deg = c(2, 2, 2), + allowed.edge.types = "simple", method = "largest") Output IGRAPH D--- 3 6 -- Graph from degree sequence + attr: name (g/c), out.deg (g/n), in.deg (g/n), allowed.edge.types @@ -661,7 +661,7 @@ # realize_bipartite_degree_sequence_impl basic Code - realize_bipartite_degree_sequence_impl(c(2, 2), c(2, 2)) + realize_bipartite_degree_sequence_impl(degrees1 = c(2, 2), degrees2 = c(2, 2)) Output IGRAPH U--- 4 4 -- Bipartite graph from degree sequence + attr: name (g/c), degrees1 (g/n), degrees2 (g/n), allowed.edge.types @@ -672,8 +672,8 @@ --- Code - realize_bipartite_degree_sequence_impl(c(2, 2), c(2, 2), allowed.edge.types = "loops", - method = "largest") + realize_bipartite_degree_sequence_impl(degrees1 = c(2, 2), degrees2 = c(2, 2), + allowed.edge.types = "loops", method = "largest") Output IGRAPH U--- 4 4 -- Bipartite graph from degree sequence + attr: name (g/c), degrees1 (g/n), degrees2 (g/n), allowed.edge.types @@ -692,7 +692,7 @@ # circulant_impl basic Code - circulant_impl(5, c(1, 2)) + circulant_impl(n = 5, shifts = c(1, 2)) Output IGRAPH U--- 5 10 -- + edges: @@ -701,7 +701,7 @@ --- Code - circulant_impl(5, c(1, 2), directed = TRUE) + circulant_impl(n = 5, shifts = c(1, 2), directed = TRUE) Output IGRAPH D--- 5 10 -- + edges: @@ -718,7 +718,7 @@ # generalized_petersen_impl basic Code - generalized_petersen_impl(5, 2) + generalized_petersen_impl(n = 5, k = 2) Output IGRAPH U--- 10 15 -- + edges: @@ -736,7 +736,7 @@ # turan_impl basic Code - turan_impl(5, 2) + turan_impl(n = 5, r = 2) Output $graph IGRAPH U--- 5 6 -- @@ -758,7 +758,7 @@ # erdos_renyi_game_gnp_impl basic Code - erdos_renyi_game_gnp_impl(5, 0.5) + erdos_renyi_game_gnp_impl(n = 5, p = 0.5) Output IGRAPH U--- 5 7 -- + edges: @@ -767,7 +767,7 @@ --- Code - erdos_renyi_game_gnp_impl(5, 0.5, directed = TRUE, loops = TRUE) + erdos_renyi_game_gnp_impl(n = 5, p = 0.5, directed = TRUE, loops = TRUE) Output IGRAPH D--- 5 12 -- + edges: @@ -784,7 +784,7 @@ # erdos_renyi_game_gnm_impl basic Code - erdos_renyi_game_gnm_impl(5, 3) + erdos_renyi_game_gnm_impl(n = 5, m = 3) Output IGRAPH U--- 5 3 -- + edges: @@ -793,7 +793,7 @@ --- Code - erdos_renyi_game_gnm_impl(5, 3, directed = TRUE, loops = TRUE) + erdos_renyi_game_gnm_impl(n = 5, m = 3, directed = TRUE, loops = TRUE) Output IGRAPH D--- 5 3 -- + edges: @@ -810,7 +810,7 @@ # growing_random_game_impl basic Code - growing_random_game_impl(5, 2) + growing_random_game_impl(n = 5, m = 2) Output IGRAPH D--- 5 8 -- Growing random graph + attr: name (g/c), m (g/n), citation (g/l) @@ -820,7 +820,7 @@ --- Code - growing_random_game_impl(5, 2, directed = FALSE, citation = TRUE) + growing_random_game_impl(n = 5, m = 2, directed = FALSE, citation = TRUE) Output IGRAPH U--- 5 8 -- Growing random graph + attr: name (g/c), m (g/n), citation (g/l) @@ -838,8 +838,8 @@ # preference_game_impl basic Code - preference_game_impl(5, 2, c(0.5, 0.5), FALSE, matrix(c(0.5, 0.5, 0.5, 0.5), 2, - 2)) + preference_game_impl(nodes = 5, types = 2, type.dist = c(0.5, 0.5), + fixed.sizes = FALSE, pref.matrix = matrix(c(0.5, 0.5, 0.5, 0.5), 2, 2)) Output $graph IGRAPH U--- 5 4 -- @@ -861,8 +861,9 @@ # asymmetric_preference_game_impl basic Code - asymmetric_preference_game_impl(5, 2, 2, matrix(c(0.5, 0.5, 0.5, 0.5), 2, 2), - matrix(c(0.5, 0.5, 0.5, 0.5), 2, 2)) + asymmetric_preference_game_impl(nodes = 5, out.types = 2, in.types = 2, + type.dist.matrix = matrix(c(0.5, 0.5, 0.5, 0.5), 2, 2), pref.matrix = matrix( + c(0.5, 0.5, 0.5, 0.5), 2, 2)) Output $graph IGRAPH D--- 5 9 -- @@ -887,7 +888,7 @@ # rewire_edges_impl basic Code - rewire_edges_impl(g, 0.5) + rewire_edges_impl(graph = g, prob = 0.5) Output IGRAPH U--- 5 4 -- + edges: @@ -904,7 +905,7 @@ # rewire_directed_edges_impl basic Code - rewire_directed_edges_impl(g, 0.5) + rewire_directed_edges_impl(graph = g, prob = 0.5) Output IGRAPH D--- 5 4 -- + edges: @@ -921,7 +922,7 @@ # forest_fire_game_impl basic Code - forest_fire_game_impl(5, 0.5) + forest_fire_game_impl(nodes = 5, fw.prob = 0.5) Output IGRAPH D--- 5 9 -- Forest fire model + attr: name (g/c), fw.prob (g/n), bw.factor (g/n), ambs (g/n) @@ -931,7 +932,8 @@ --- Code - forest_fire_game_impl(5, 0.5, bw.factor = 0.2, ambs = 2, directed = FALSE) + forest_fire_game_impl(nodes = 5, fw.prob = 0.5, bw.factor = 0.2, ambs = 2, + directed = FALSE) Output IGRAPH U--- 5 4 -- Forest fire model + attr: name (g/c), fw.prob (g/n), bw.factor (g/n), ambs (g/n) @@ -949,7 +951,8 @@ # simple_interconnected_islands_game_impl basic Code - simple_interconnected_islands_game_impl(2, 3, 0.5, 1) + simple_interconnected_islands_game_impl(islands.n = 2, islands.size = 3, + islands.pin = 0.5, n.inter = 1) Output IGRAPH U--- 6 5 -- Interconnected islands model + attr: name (g/c), islands.n (g/n), islands.size (g/n), islands.pin @@ -968,7 +971,7 @@ # chung_lu_game_impl basic Code - chung_lu_game_impl(c(2, 2, 2)) + chung_lu_game_impl(out.weights = c(2, 2, 2)) Output IGRAPH U--- 3 5 -- Chung-Lu model + attr: name (g/c), variant (g/n) @@ -978,7 +981,8 @@ --- Code - chung_lu_game_impl(c(1, 2, 3), c(1, 2, 3), loops = FALSE, variant = "maxent") + chung_lu_game_impl(out.weights = c(1, 2, 3), in.weights = c(1, 2, 3), loops = FALSE, + variant = "maxent") Output IGRAPH D--- 3 1 -- Chung-Lu model + attr: name (g/c), variant (g/n) @@ -996,7 +1000,7 @@ # static_fitness_game_impl basic Code - static_fitness_game_impl(3, c(1, 2, 3)) + static_fitness_game_impl(no.of.edges = 3, fitness.out = c(1, 2, 3)) Output IGRAPH U--- 3 3 -- Static fitness model + attr: name (g/c), loops (g/l), multiple (g/l) @@ -1006,7 +1010,8 @@ --- Code - static_fitness_game_impl(3, c(1, 2, 3), c(1, 2, 3), loops = TRUE, multiple = TRUE) + static_fitness_game_impl(no.of.edges = 3, fitness.out = c(1, 2, 3), fitness.in = c( + 1, 2, 3), loops = TRUE, multiple = TRUE) Output IGRAPH D--- 3 3 -- Static fitness model + attr: name (g/c), loops (g/l), multiple (g/l) @@ -1024,7 +1029,7 @@ # static_power_law_game_impl basic Code - static_power_law_game_impl(5, 4, 2.5) + static_power_law_game_impl(no.of.nodes = 5, no.of.edges = 4, exponent.out = 2.5) Output IGRAPH U--- 5 4 -- Static power law model + attr: name (g/c), exponent.out (g/n), exponent.in (g/n), loops (g/l), @@ -1035,8 +1040,8 @@ --- Code - static_power_law_game_impl(5, 4, 2.5, exponent.in = 2, loops = TRUE, multiple = TRUE, - finite.size.correction = FALSE) + static_power_law_game_impl(no.of.nodes = 5, no.of.edges = 4, exponent.out = 2.5, + exponent.in = 2, loops = TRUE, multiple = TRUE, finite.size.correction = FALSE) Output IGRAPH D--- 5 4 -- Static power law model + attr: name (g/c), exponent.out (g/n), exponent.in (g/n), loops (g/l), @@ -1055,7 +1060,7 @@ # k_regular_game_impl basic Code - k_regular_game_impl(5, 2) + k_regular_game_impl(no.of.nodes = 5, k = 2) Output IGRAPH U--- 5 5 -- k-regular graph + attr: name (g/c), k (g/n) @@ -1065,7 +1070,7 @@ --- Code - k_regular_game_impl(5, 2, directed = TRUE, multiple = TRUE) + k_regular_game_impl(no.of.nodes = 5, k = 2, directed = TRUE, multiple = TRUE) Output IGRAPH D--- 5 10 -- k-regular graph + attr: name (g/c), k (g/n) @@ -1083,7 +1088,7 @@ # sbm_game_impl basic Code - sbm_game_impl(5, matrix(0.5, 2, 2), c(2, 3)) + sbm_game_impl(n = 5, pref.matrix = matrix(0.5, 2, 2), block.sizes = c(2, 3)) Output IGRAPH U--- 5 6 -- Stochastic block model + attr: name (g/c), loops (g/l) @@ -1093,7 +1098,8 @@ --- Code - sbm_game_impl(5, matrix(0.5, 2, 2), c(2, 3), directed = TRUE, loops = TRUE) + sbm_game_impl(n = 5, pref.matrix = matrix(0.5, 2, 2), block.sizes = c(2, 3), + directed = TRUE, loops = TRUE) Output IGRAPH D--- 5 14 -- Stochastic block model + attr: name (g/c), loops (g/l) @@ -1111,7 +1117,7 @@ # hsbm_game_impl basic Code - hsbm_game_impl(6, 2, c(0.5, 0.5), matrix(1, 2, 2), 0.5) + hsbm_game_impl(n = 6, m = 2, rho = c(0.5, 0.5), C = matrix(1, 2, 2), p = 0.5) Output IGRAPH U--- 6 9 -- Hierarchical stochastic block model + attr: name (g/c), m (g/n), rho (g/n), C (g/n), p (g/n) @@ -1129,8 +1135,8 @@ # hsbm_list_game_impl basic Code - hsbm_list_game_impl(100, list(50, 50), rho = list(c(3, 3, 4) / 10), C = list(C), - p = 1 / 20) + hsbm_list_game_impl(n = 100, mlist = list(50, 50), rholist = list(c(3, 3, 4) / + 10), Clist = list(C), p = 1 / 20) Output IGRAPH U--- 100 783 -- Hierarchical stochastic block model + attr: name (g/c), p (g/n) @@ -1156,7 +1162,7 @@ # correlated_game_impl basic Code - correlated_game_impl(g, 0.5) + correlated_game_impl(old.graph = g, corr = 0.5) Output IGRAPH U--- 5 3 -- Correlated random graph + attr: name (g/c), corr (g/n), p (g/n) @@ -1174,7 +1180,7 @@ # correlated_pair_game_impl basic Code - correlated_pair_game_impl(5, 0.5, 0.5) + correlated_pair_game_impl(n = 5, corr = 0.5, p = 0.5) Output $graph1 IGRAPH U--- 5 7 -- @@ -1190,7 +1196,7 @@ --- Code - correlated_pair_game_impl(5, 0.5, 0.5, directed = TRUE) + correlated_pair_game_impl(n = 5, corr = 0.5, p = 0.5, directed = TRUE) Output $graph1 IGRAPH D--- 5 10 -- @@ -1214,7 +1220,7 @@ # dot_product_game_impl basic Code - dot_product_game_impl(matrix(0.5, 5, 2)) + dot_product_game_impl(vecs = matrix(0.5, 5, 2)) Condition Warning in `dot_product_game_impl()`: At vendor/cigraph/src/games/dotproduct.c:90 : Greater than 1 connection probability in dot-product graph. @@ -1226,7 +1232,7 @@ --- Code - dot_product_game_impl(matrix(0.5, 5, 2), directed = TRUE) + dot_product_game_impl(vecs = matrix(0.5, 5, 2), directed = TRUE) Condition Warning in `dot_product_game_impl()`: At vendor/cigraph/src/games/dotproduct.c:90 : Greater than 1 connection probability in dot-product graph. @@ -1246,7 +1252,7 @@ # sample_sphere_surface_impl basic Code - sample_sphere_surface_impl(3, 5) + sample_sphere_surface_impl(dim = 3, n = 5) Output [,1] [,2] [,3] [,4] [,5] [1,] 0.87877523 0.8206548 0.1430028 0.6349227 0.99933629 @@ -1256,7 +1262,7 @@ --- Code - sample_sphere_surface_impl(3, 5, radius = 2, positive = FALSE) + sample_sphere_surface_impl(dim = 3, n = 5, radius = 2, positive = FALSE) Output [,1] [,2] [,3] [,4] [,5] [1,] -0.4904253 -1.4825368 -0.5141332 1.95644246 0.369407 @@ -1274,7 +1280,7 @@ # sample_sphere_volume_impl basic Code - sample_sphere_volume_impl(3, 5) + sample_sphere_volume_impl(dim = 3, n = 5) Output [,1] [,2] [,3] [,4] [,5] [1,] 0.67165090 0.6105364 0.09806950 0.4132698 0.73325518 @@ -1284,7 +1290,7 @@ --- Code - sample_sphere_volume_impl(3, 5, radius = 2, positive = FALSE) + sample_sphere_volume_impl(dim = 3, n = 5, radius = 2, positive = FALSE) Output [,1] [,2] [,3] [,4] [,5] [1,] 1.903629152 -1.3795904 -1.2061886 0.9035986 -1.1692436 @@ -1302,7 +1308,7 @@ # sample_dirichlet_impl basic Code - sample_dirichlet_impl(5, c(1, 1, 1)) + sample_dirichlet_impl(n = 5, alpha = c(1, 1, 1)) Output [,1] [,2] [,3] [,4] [,5] [1,] 0.6298008 0.4168413 0.29594281 0.2432340 0.1516815 @@ -1320,7 +1326,7 @@ # are_adjacent_impl basic Code - are_adjacent_impl(g, 1, 2) + are_adjacent_impl(graph = g, v1 = 1, v2 = 2) Output [1] TRUE @@ -1335,7 +1341,7 @@ # closeness_impl basic Code - closeness_impl(g) + closeness_impl(graph = g) Output $res [1] 0.3333333 0.5000000 0.3333333 @@ -1350,7 +1356,7 @@ --- Code - closeness_impl(g, mode = "in", normalized = TRUE) + closeness_impl(graph = g, mode = "in", normalized = TRUE) Output $res [1] 0.6666667 1.0000000 0.6666667 @@ -1373,7 +1379,7 @@ # closeness_cutoff_impl basic Code - closeness_cutoff_impl(g, cutoff = 2) + closeness_cutoff_impl(graph = g, cutoff = 2) Output $res [1] 0.3333333 0.5000000 0.3333333 @@ -1388,7 +1394,7 @@ --- Code - closeness_cutoff_impl(g, mode = "in", normalized = TRUE, cutoff = 1) + closeness_cutoff_impl(graph = g, mode = "in", normalized = TRUE, cutoff = 1) Output $res [1] 1 1 1 @@ -1411,7 +1417,7 @@ # get_shortest_path_impl basic Code - get_shortest_path_impl(g, 1, 3) + get_shortest_path_impl(graph = g, from = 1, to = 3) Output $vertices + 3/3 vertices: @@ -1433,7 +1439,7 @@ # get_shortest_path_bellman_ford_impl basic Code - get_shortest_path_bellman_ford_impl(g, 1, 3) + get_shortest_path_bellman_ford_impl(graph = g, from = 1, to = 3) Output $vertices + 3/3 vertices: @@ -1455,7 +1461,7 @@ # get_shortest_path_dijkstra_impl basic Code - get_shortest_path_dijkstra_impl(g, 1, 3) + get_shortest_path_dijkstra_impl(graph = g, from = 1, to = 3) Output $vertices + 3/3 vertices: @@ -1477,7 +1483,7 @@ # get_all_shortest_paths_impl basic Code - get_all_shortest_paths_impl(g, 1, 3) + get_all_shortest_paths_impl(graph = g, from = 1, to = 3) Output $vpaths $vpaths[[1]] @@ -1506,7 +1512,7 @@ # get_all_shortest_paths_dijkstra_impl basic Code - get_all_shortest_paths_dijkstra_impl(g, 1, 3) + get_all_shortest_paths_dijkstra_impl(graph = g, from = 1, to = 3) Output $vpaths $vpaths[[1]] @@ -1535,7 +1541,7 @@ # voronoi_impl basic Code - voronoi_impl(g, 1) + voronoi_impl(graph = g, generators = 1) Output $membership [1] 0 0 0 @@ -1547,7 +1553,7 @@ --- Code - voronoi_impl(g, 1, mode = "in", tiebreaker = "first") + voronoi_impl(graph = g, generators = 1, mode = "in", tiebreaker = "first") Output $membership [1] 0 0 0 @@ -1567,7 +1573,7 @@ # get_all_simple_paths_impl basic Code - get_all_simple_paths_impl(g, 1, 3) + get_all_simple_paths_impl(graph = g, from = 1, to = 3) Output + 3/3 vertices: [1] 1 2 3 @@ -1583,7 +1589,7 @@ # get_k_shortest_paths_impl basic Code - get_k_shortest_paths_impl(g, 1, 3, k = 2) + get_k_shortest_paths_impl(graph = g, from = 1, to = 3, k = 2) Output $vpaths $vpaths[[1]] @@ -1609,7 +1615,7 @@ # get_widest_path_impl basic Code - get_widest_path_impl(g, 1, 3, weights = c(1, 2)) + get_widest_path_impl(graph = g, from = 1, to = 3, weights = c(1, 2)) Output $vertices + 3/3 vertices: @@ -1631,7 +1637,7 @@ # get_widest_paths_impl basic Code - get_widest_paths_impl(g, 1, 3, weights = c(1, 2)) + get_widest_paths_impl(graph = g, from = 1, to = 3, weights = c(1, 2)) Output $vertices $vertices[[1]] @@ -1663,7 +1669,7 @@ # spanner_impl basic Code - spanner_impl(g, 2) + spanner_impl(graph = g, stretch = 2) Output + 2/2 edges: [1] 1--2 2--3 @@ -1679,7 +1685,7 @@ # betweenness_cutoff_impl basic Code - betweenness_cutoff_impl(g, cutoff = 2) + betweenness_cutoff_impl(graph = g, cutoff = 2) Output [1] 0 1 0 @@ -1694,7 +1700,7 @@ # betweenness_subset_impl basic Code - betweenness_subset_impl(g) + betweenness_subset_impl(graph = g) Output [1] 0 1 0 @@ -1709,7 +1715,7 @@ # edge_betweenness_impl basic Code - edge_betweenness_impl(g) + edge_betweenness_impl(graph = g) Output [1] 2 2 @@ -1724,7 +1730,7 @@ # edge_betweenness_cutoff_impl basic Code - edge_betweenness_cutoff_impl(g, cutoff = 2) + edge_betweenness_cutoff_impl(graph = g, cutoff = 2) Output [1] 2 2 @@ -1739,7 +1745,7 @@ # edge_betweenness_subset_impl basic Code - edge_betweenness_subset_impl(g) + edge_betweenness_subset_impl(graph = g) Output [1] 2 2 @@ -1754,7 +1760,7 @@ # harmonic_centrality_cutoff_impl basic Code - harmonic_centrality_cutoff_impl(g, cutoff = 2) + harmonic_centrality_cutoff_impl(graph = g, cutoff = 2) Output [1] 1.5 2.0 1.5 @@ -1769,7 +1775,7 @@ # personalized_pagerank_impl basic Code - personalized_pagerank_impl(g) + personalized_pagerank_impl(graph = g) Output $vector [1] 0.2567568 0.4864865 0.2567568 @@ -1784,7 +1790,7 @@ --- Code - personalized_pagerank_impl(g, algo = "arpack", damping = 0.9) + personalized_pagerank_impl(graph = g, algo = "arpack", damping = 0.9) Output $vector [1] 0.2543860 0.4912281 0.2543860 @@ -1866,14 +1872,15 @@ # personalized_pagerank_vs_impl basic Code - personalized_pagerank_vs_impl(g, reset.vids = 1) + personalized_pagerank_vs_impl(graph = g, reset.vids = 1) Output [1] 0.3452703 0.4594595 0.1952703 --- Code - personalized_pagerank_vs_impl(g, algo = "arpack", reset.vids = 1, details = TRUE) + personalized_pagerank_vs_impl(graph = g, algo = "arpack", reset.vids = 1, + details = TRUE) Output $vector [1] 0.3452703 0.4594595 0.1952703 @@ -1955,7 +1962,7 @@ # induced_subgraph_impl basic Code - induced_subgraph_impl(g, 1:2) + induced_subgraph_impl(graph = g, vids = 1:2) Output IGRAPH U--- 2 1 -- + edge: @@ -1972,7 +1979,7 @@ # subgraph_from_edges_impl basic Code - subgraph_from_edges_impl(g, 1) + subgraph_from_edges_impl(graph = g, eids = 1) Output IGRAPH U--- 2 1 -- + edge: @@ -1989,7 +1996,7 @@ # reverse_edges_impl basic Code - reverse_edges_impl(g) + reverse_edges_impl(graph = g) Output IGRAPH U--- 3 2 -- + edges: @@ -2006,7 +2013,7 @@ # path_length_hist_impl basic Code - path_length_hist_impl(g) + path_length_hist_impl(graph = g) Output $res [1] 2 1 @@ -2018,7 +2025,7 @@ --- Code - path_length_hist_impl(g, directed = FALSE) + path_length_hist_impl(graph = g, directed = FALSE) Output $res [1] 2 1 @@ -2038,7 +2045,7 @@ # simplify_impl basic Code - simplify_impl(g) + simplify_impl(graph = g) Output IGRAPH U--- 3 2 -- + edges: @@ -2047,7 +2054,7 @@ --- Code - simplify_impl(g, remove.multiple = FALSE, remove.loops = FALSE) + simplify_impl(graph = g, remove.multiple = FALSE, remove.loops = FALSE) Output IGRAPH U--- 3 2 -- + edges: @@ -2064,14 +2071,14 @@ # transitivity_undirected_impl basic Code - transitivity_undirected_impl(g) + transitivity_undirected_impl(graph = g) Output [1] 0 --- Code - transitivity_undirected_impl(g, mode = "zero") + transitivity_undirected_impl(graph = g, mode = "zero") Output [1] 0 @@ -2086,14 +2093,14 @@ # transitivity_local_undirected_impl basic Code - transitivity_local_undirected_impl(g) + transitivity_local_undirected_impl(graph = g) Output [1] NaN 0 NaN --- Code - transitivity_local_undirected_impl(g, mode = "zero") + transitivity_local_undirected_impl(graph = g, mode = "zero") Output [1] 0 0 0 @@ -2108,14 +2115,14 @@ # transitivity_avglocal_undirected_impl basic Code - transitivity_avglocal_undirected_impl(g) + transitivity_avglocal_undirected_impl(graph = g) Output [1] 0 --- Code - transitivity_avglocal_undirected_impl(g, mode = "zero") + transitivity_avglocal_undirected_impl(graph = g, mode = "zero") Output [1] 0 @@ -2130,7 +2137,7 @@ # transitivity_barrat_impl basic Code - transitivity_barrat_impl(g) + transitivity_barrat_impl(graph = g) Condition Warning in `transitivity_barrat_impl()`: At vendor/cigraph/src/properties/triangles.c:913 : No weights given for Barrat's transitivity, unweighted version is used. @@ -2140,7 +2147,7 @@ --- Code - transitivity_barrat_impl(g, mode = "zero") + transitivity_barrat_impl(graph = g, mode = "zero") Condition Warning in `transitivity_barrat_impl()`: At vendor/cigraph/src/properties/triangles.c:913 : No weights given for Barrat's transitivity, unweighted version is used. @@ -2158,14 +2165,14 @@ # ecc_impl basic Code - ecc_impl(g) + ecc_impl(graph = g) Output [1] NaN 0 NaN --- Code - ecc_impl(g, k = 3, offset = TRUE, normalize = FALSE) + ecc_impl(graph = g, k = 3, offset = TRUE, normalize = FALSE) Output [1] 1 1 1 @@ -2180,14 +2187,14 @@ # reciprocity_impl basic Code - reciprocity_impl(g) + reciprocity_impl(graph = g) Output [1] 1 --- Code - reciprocity_impl(g, ignore.loops = FALSE, mode = "ratio") + reciprocity_impl(graph = g, ignore.loops = FALSE, mode = "ratio") Output [1] 1 @@ -2202,14 +2209,14 @@ # maxdegree_impl basic Code - maxdegree_impl(g) + maxdegree_impl(graph = g) Output [1] 2 --- Code - maxdegree_impl(g, mode = "in", loops = FALSE) + maxdegree_impl(graph = g, mode = "in", loops = FALSE) Output [1] 2 @@ -2224,14 +2231,14 @@ # density_impl basic Code - density_impl(g) + density_impl(graph = g) Output [1] 0.6666667 --- Code - density_impl(g, loops = TRUE) + density_impl(graph = g, loops = TRUE) Output [1] 0.3333333 @@ -2246,14 +2253,14 @@ # mean_degree_impl basic Code - mean_degree_impl(g) + mean_degree_impl(graph = g) Output [1] 1.333333 --- Code - mean_degree_impl(g, loops = FALSE) + mean_degree_impl(graph = g, loops = FALSE) Output [1] 1.333333 @@ -2268,14 +2275,14 @@ # feedback_arc_set_impl basic Code - feedback_arc_set_impl(g) + feedback_arc_set_impl(graph = g) Output + 0/2 edges: --- Code - feedback_arc_set_impl(g, algo = "exact_ip") + feedback_arc_set_impl(graph = g, algo = "exact_ip") Output + 0/2 edges: @@ -2290,7 +2297,7 @@ # feedback_vertex_set_impl basic Code - feedback_vertex_set_impl(g) + feedback_vertex_set_impl(graph = g) Output + 0/3 vertices: @@ -2305,7 +2312,7 @@ # is_loop_impl basic Code - is_loop_impl(g) + is_loop_impl(graph = g) Output [1] FALSE FALSE @@ -2320,7 +2327,7 @@ # is_dag_impl basic Code - is_dag_impl(g) + is_dag_impl(graph = g) Output [1] FALSE @@ -2335,7 +2342,7 @@ # is_acyclic_impl basic Code - is_acyclic_impl(g) + is_acyclic_impl(graph = g) Output [1] TRUE @@ -2350,7 +2357,7 @@ # is_simple_impl basic Code - is_simple_impl(g) + is_simple_impl(graph = g) Output [1] TRUE @@ -2365,7 +2372,7 @@ # is_multiple_impl basic Code - is_multiple_impl(g) + is_multiple_impl(graph = g) Output [1] FALSE FALSE @@ -2380,7 +2387,7 @@ # has_loop_impl basic Code - has_loop_impl(g) + has_loop_impl(graph = g) Output [1] FALSE @@ -2395,7 +2402,7 @@ # has_multiple_impl basic Code - has_multiple_impl(g) + has_multiple_impl(graph = g) Output [1] FALSE @@ -2410,7 +2417,7 @@ # count_loops_impl basic Code - count_loops_impl(g) + count_loops_impl(graph = g) Output [1] 0 @@ -2425,7 +2432,7 @@ # count_multiple_impl basic Code - count_multiple_impl(g) + count_multiple_impl(graph = g) Output [1] 1 1 @@ -2440,7 +2447,7 @@ # is_perfect_impl basic Code - is_perfect_impl(g) + is_perfect_impl(graph = g) Output [1] TRUE @@ -2455,7 +2462,7 @@ # eigenvector_centrality_impl basic Code - eigenvector_centrality_impl(g) + eigenvector_centrality_impl(graph = g) Output $vector [1] 0.7071068 1.0000000 0.7071068 @@ -2529,7 +2536,7 @@ --- Code - eigenvector_centrality_impl(g, directed = TRUE, scale = FALSE) + eigenvector_centrality_impl(graph = g, directed = TRUE, scale = FALSE) Output $vector [1] 0.5000000 0.7071068 0.5000000 @@ -2611,7 +2618,7 @@ # hub_and_authority_scores_impl basic Code - hub_and_authority_scores_impl(g) + hub_and_authority_scores_impl(graph = g) Output $hub [1] 1 1 1 1 1 @@ -2688,7 +2695,7 @@ --- Code - hub_and_authority_scores_impl(g, scale = FALSE) + hub_and_authority_scores_impl(graph = g, scale = FALSE) Output $hub [1] 0.4472136 0.4472136 0.4472136 0.4472136 0.4472136 @@ -2773,7 +2780,7 @@ # unfold_tree_impl basic Code - unfold_tree_impl(g, roots = 1) + unfold_tree_impl(graph = g, roots = 1) Output $tree IGRAPH U--- 3 2 -- @@ -2787,7 +2794,7 @@ --- Code - unfold_tree_impl(g, mode = "in", roots = 1) + unfold_tree_impl(graph = g, mode = "in", roots = 1) Output $tree IGRAPH U--- 3 2 -- @@ -2809,14 +2816,14 @@ # is_mutual_impl basic Code - is_mutual_impl(g) + is_mutual_impl(graph = g) Output [1] TRUE TRUE --- Code - is_mutual_impl(g, loops = FALSE) + is_mutual_impl(graph = g, loops = FALSE) Output [1] TRUE TRUE @@ -2831,14 +2838,14 @@ # has_mutual_impl basic Code - has_mutual_impl(g) + has_mutual_impl(graph = g) Output [1] TRUE --- Code - has_mutual_impl(g, loops = FALSE) + has_mutual_impl(graph = g, loops = FALSE) Output [1] TRUE @@ -2853,7 +2860,7 @@ # maximum_cardinality_search_impl basic Code - maximum_cardinality_search_impl(g) + maximum_cardinality_search_impl(graph = g) Output $alpha [1] 3 2 1 @@ -2874,7 +2881,7 @@ # avg_nearest_neighbor_degree_impl basic Code - avg_nearest_neighbor_degree_impl(g) + avg_nearest_neighbor_degree_impl(graph = g) Output $knn [1] 2 1 2 @@ -2886,7 +2893,7 @@ --- Code - avg_nearest_neighbor_degree_impl(g, mode = "in", neighbor.degree.mode = "out") + avg_nearest_neighbor_degree_impl(graph = g, mode = "in", neighbor.degree.mode = "out") Output $knn [1] 2 1 2 @@ -2906,14 +2913,14 @@ # degree_correlation_vector_impl basic Code - degree_correlation_vector_impl(g) + degree_correlation_vector_impl(graph = g) Output [1] NaN 2 1 --- Code - degree_correlation_vector_impl(g, from.mode = "in", to.mode = "out", + degree_correlation_vector_impl(graph = g, from.mode = "in", to.mode = "out", directed.neighbors = FALSE) Output [1] NaN 2 1 @@ -2929,15 +2936,15 @@ # rich_club_sequence_impl basic Code - rich_club_sequence_impl(g, vertex.order = 1:3) + rich_club_sequence_impl(graph = g, vertex.order = 1:3) Output [1] 0.6666667 1.0000000 NaN --- Code - rich_club_sequence_impl(g, vertex.order = 1:3, normalized = FALSE, loops = TRUE, - directed = FALSE) + rich_club_sequence_impl(graph = g, vertex.order = 1:3, normalized = FALSE, + loops = TRUE, directed = FALSE) Output [1] 2 1 0 @@ -2952,14 +2959,14 @@ # strength_impl basic Code - strength_impl(g) + strength_impl(graph = g) Output [1] 1 2 1 --- Code - strength_impl(g, mode = "in", loops = FALSE) + strength_impl(graph = g, mode = "in", loops = FALSE) Output [1] 1 2 1 @@ -2974,14 +2981,14 @@ # centralization_impl basic Code - centralization_impl(c(1, 2, 3)) + centralization_impl(scores = c(1, 2, 3)) Output [1] Inf --- Code - centralization_impl(c(1, 2, 3), theoretical.max = 2, normalized = FALSE) + centralization_impl(scores = c(1, 2, 3), theoretical.max = 2, normalized = FALSE) Output [1] 3 @@ -2996,7 +3003,7 @@ # centralization_degree_impl basic Code - centralization_degree_impl(g) + centralization_degree_impl(graph = g) Output $res [1] 1 2 1 @@ -3011,7 +3018,7 @@ --- Code - centralization_degree_impl(g, mode = "in", loops = FALSE, normalized = FALSE) + centralization_degree_impl(graph = g, mode = "in", loops = FALSE, normalized = FALSE) Output $res [1] 1 2 1 @@ -3056,7 +3063,7 @@ # centralization_betweenness_impl basic Code - centralization_betweenness_impl(g) + centralization_betweenness_impl(graph = g) Output $res [1] 0 1 0 @@ -3071,7 +3078,7 @@ --- Code - centralization_betweenness_impl(g, directed = FALSE, normalized = FALSE) + centralization_betweenness_impl(graph = g, directed = FALSE, normalized = FALSE) Output $res [1] 0 1 0 @@ -3116,7 +3123,7 @@ # centralization_closeness_impl basic Code - centralization_closeness_impl(g) + centralization_closeness_impl(graph = g) Output $res [1] 0.6666667 1.0000000 0.6666667 @@ -3131,7 +3138,7 @@ --- Code - centralization_closeness_impl(g, mode = "in", normalized = FALSE) + centralization_closeness_impl(graph = g, mode = "in", normalized = FALSE) Output $res [1] 0.6666667 1.0000000 0.6666667 @@ -3176,7 +3183,7 @@ # centralization_eigenvector_centrality_impl basic Code - centralization_eigenvector_centrality_impl(g) + centralization_eigenvector_centrality_impl(graph = g) Output $vector [1] 0.7071068 1.0000000 0.7071068 @@ -3256,7 +3263,8 @@ --- Code - centralization_eigenvector_centrality_impl(g, directed = TRUE, normalized = FALSE) + centralization_eigenvector_centrality_impl(graph = g, directed = TRUE, + normalized = FALSE) Output $vector [1] 0.7071068 1.0000000 0.7071068 @@ -3366,14 +3374,15 @@ # assortativity_nominal_impl basic Code - assortativity_nominal_impl(g, c(1, 2, 1)) + assortativity_nominal_impl(graph = g, types = c(1, 2, 1)) Output [1] -1 --- Code - assortativity_nominal_impl(g, c(1, 2, 1), directed = FALSE, normalized = FALSE) + assortativity_nominal_impl(graph = g, types = c(1, 2, 1), directed = FALSE, + normalized = FALSE) Output [1] -0.5 @@ -3388,14 +3397,15 @@ # assortativity_impl basic Code - assortativity_impl(g, c(1, 2, 1)) + assortativity_impl(graph = g, values = c(1, 2, 1)) Output [1] -1 --- Code - assortativity_impl(g, c(1, 2, 1), directed = FALSE, normalized = FALSE) + assortativity_impl(graph = g, values = c(1, 2, 1), directed = FALSE, + normalized = FALSE) Output [1] -0.25 @@ -3410,14 +3420,14 @@ # assortativity_degree_impl basic Code - assortativity_degree_impl(g) + assortativity_degree_impl(graph = g) Output [1] -1 --- Code - assortativity_degree_impl(g, directed = FALSE) + assortativity_degree_impl(graph = g, directed = FALSE) Output [1] -1 @@ -3432,7 +3442,7 @@ # joint_degree_matrix_impl basic Code - joint_degree_matrix_impl(g) + joint_degree_matrix_impl(graph = g) Output [,1] [,2] [1,] 0 2 @@ -3441,7 +3451,7 @@ --- Code - joint_degree_matrix_impl(g, max.out.degree = 2, max.in.degree = 2) + joint_degree_matrix_impl(graph = g, max.out.degree = 2, max.in.degree = 2) Output [,1] [,2] [1,] 0 2 @@ -3458,7 +3468,7 @@ # joint_degree_distribution_impl basic Code - joint_degree_distribution_impl(g) + joint_degree_distribution_impl(graph = g) Output [,1] [,2] [,3] [1,] 0 0.0 0.0 @@ -3468,7 +3478,7 @@ --- Code - joint_degree_distribution_impl(g, from.mode = "in", to.mode = "out", + joint_degree_distribution_impl(graph = g, from.mode = "in", to.mode = "out", directed.neighbors = FALSE, normalized = FALSE, max.from.degree = 2, max.to.degree = 2) Output @@ -3488,7 +3498,7 @@ # joint_type_distribution_impl basic Code - joint_type_distribution_impl(g, from.types = c(1, 2, 1)) + joint_type_distribution_impl(graph = g, from.types = c(1, 2, 1)) Output [,1] [,2] [1,] 0.0 0.5 @@ -3497,8 +3507,8 @@ --- Code - joint_type_distribution_impl(g, from.types = c(1, 2, 1), to.types = c(1, 2, 1), - directed = FALSE, normalized = FALSE) + joint_type_distribution_impl(graph = g, from.types = c(1, 2, 1), to.types = c(1, + 2, 1), directed = FALSE, normalized = FALSE) Output [,1] [,2] [1,] 0 2 @@ -3515,7 +3525,7 @@ # contract_vertices_impl basic Code - contract_vertices_impl(g, c(1, 1, 2)) + contract_vertices_impl(graph = g, mapping = c(1, 1, 2)) Output IGRAPH U--- 2 2 -- + edges: @@ -3532,14 +3542,14 @@ # eccentricity_dijkstra_impl basic Code - eccentricity_dijkstra_impl(g) + eccentricity_dijkstra_impl(graph = g) Output [1] 2 1 2 --- Code - eccentricity_dijkstra_impl(g, mode = "in") + eccentricity_dijkstra_impl(graph = g, mode = "in") Output [1] 2 1 2 @@ -3554,7 +3564,7 @@ # graph_center_dijkstra_impl basic Code - graph_center_dijkstra_impl(g) + graph_center_dijkstra_impl(graph = g) Output + 1/3 vertex: [1] 2 @@ -3562,7 +3572,7 @@ --- Code - graph_center_dijkstra_impl(g, mode = "in") + graph_center_dijkstra_impl(graph = g, mode = "in") Output + 1/3 vertex: [1] 2 @@ -3578,14 +3588,14 @@ # radius_dijkstra_impl basic Code - radius_dijkstra_impl(g) + radius_dijkstra_impl(graph = g) Output [1] 1 --- Code - radius_dijkstra_impl(g, mode = "in") + radius_dijkstra_impl(graph = g, mode = "in") Output [1] 1 @@ -3600,7 +3610,7 @@ # pseudo_diameter_impl basic Code - pseudo_diameter_impl(g, 1) + pseudo_diameter_impl(graph = g, start.vid = 1) Output $diameter [1] 2 @@ -3615,7 +3625,7 @@ --- Code - pseudo_diameter_impl(g, 1, directed = FALSE, unconnected = FALSE) + pseudo_diameter_impl(graph = g, start.vid = 1, directed = FALSE, unconnected = FALSE) Output $diameter [1] 2 @@ -3638,7 +3648,7 @@ # pseudo_diameter_dijkstra_impl basic Code - pseudo_diameter_dijkstra_impl(g, start.vid = 1) + pseudo_diameter_dijkstra_impl(graph = g, start.vid = 1) Output $diameter [1] 2 @@ -3653,7 +3663,8 @@ --- Code - pseudo_diameter_dijkstra_impl(g, start.vid = 1, directed = FALSE, unconnected = FALSE) + pseudo_diameter_dijkstra_impl(graph = g, start.vid = 1, directed = FALSE, + unconnected = FALSE) Output $diameter [1] 2 @@ -3676,7 +3687,7 @@ # diversity_impl basic Code - diversity_impl(g) + diversity_impl(graph = g) Output [1] 0.0000000 0.9182958 0.0000000 @@ -3691,7 +3702,7 @@ # random_walk_impl basic Code - random_walk_impl(g, 1, 2) + random_walk_impl(graph = g, start = 1, steps = 2) Output $vertices + 3/3 vertices: @@ -3705,7 +3716,7 @@ --- Code - random_walk_impl(g, 1, 2, mode = "in", stuck = "error") + random_walk_impl(graph = g, start = 1, steps = 2, mode = "in", stuck = "error") Output $vertices + 3/3 vertices: @@ -3727,14 +3738,14 @@ # global_efficiency_impl basic Code - global_efficiency_impl(g) + global_efficiency_impl(graph = g) Output [1] 0.8333333 --- Code - global_efficiency_impl(g, directed = FALSE) + global_efficiency_impl(graph = g, directed = FALSE) Output [1] 0.8333333 @@ -3749,14 +3760,14 @@ # local_efficiency_impl basic Code - local_efficiency_impl(g) + local_efficiency_impl(graph = g) Output [1] 0 0 0 --- Code - local_efficiency_impl(g, directed = FALSE, mode = "in") + local_efficiency_impl(graph = g, directed = FALSE, mode = "in") Output [1] 0 0 0 @@ -3771,14 +3782,14 @@ # average_local_efficiency_impl basic Code - average_local_efficiency_impl(g) + average_local_efficiency_impl(graph = g) Output [1] 0 --- Code - average_local_efficiency_impl(g, directed = FALSE, mode = "in") + average_local_efficiency_impl(graph = g, directed = FALSE, mode = "in") Output [1] 0 @@ -3793,7 +3804,7 @@ # transitive_closure_dag_impl basic Code - transitive_closure_dag_impl(g) + transitive_closure_dag_impl(graph = g) Output IGRAPH D--- 3 3 -- + edges: @@ -3810,7 +3821,7 @@ # transitive_closure_impl basic Code - transitive_closure_impl(g) + transitive_closure_impl(graph = g) Output IGRAPH U--- 3 3 -- + edges: @@ -3827,7 +3838,7 @@ # trussness_impl basic Code - trussness_impl(g) + trussness_impl(graph = g) Output [1] 2 2 @@ -3842,14 +3853,15 @@ # is_graphical_impl basic Code - is_graphical_impl(c(2, 2, 2)) + is_graphical_impl(out.deg = c(2, 2, 2)) Output [1] TRUE --- Code - is_graphical_impl(c(2, 2, 2), c(1, 1, 1), allowed.edge.types = "all") + is_graphical_impl(out.deg = c(2, 2, 2), in.deg = c(1, 1, 1), + allowed.edge.types = "all") Output [1] FALSE @@ -3866,7 +3878,7 @@ # bfs_simple_impl basic Code - bfs_simple_impl(g, 1) + bfs_simple_impl(graph = g, root = 1) Output $order + 3/3 vertices: @@ -3882,7 +3894,7 @@ --- Code - bfs_simple_impl(g, 1, mode = "in") + bfs_simple_impl(graph = g, root = 1, mode = "in") Output $order + 3/3 vertices: @@ -3906,7 +3918,7 @@ # bipartite_projection_size_impl basic Code - bipartite_projection_size_impl(g) + bipartite_projection_size_impl(graph = g) Output $vcount1 [1] 2 @@ -3932,7 +3944,7 @@ # biadjacency_impl basic Code - biadjacency_impl(m) + biadjacency_impl(incidence = m) Output $graph IGRAPH U--- 5 4 -- @@ -3946,7 +3958,7 @@ --- Code - biadjacency_impl(m, directed = TRUE, mode = "in", multiple = TRUE) + biadjacency_impl(incidence = m, directed = TRUE, mode = "in", multiple = TRUE) Output $graph IGRAPH D--- 5 4 -- @@ -3970,7 +3982,7 @@ # get_biadjacency_impl basic Code - get_biadjacency_impl(g, c(TRUE, FALSE, TRUE)) + get_biadjacency_impl(graph = g, types = c(TRUE, FALSE, TRUE)) Output $res [,1] [,2] @@ -3994,7 +4006,7 @@ # is_bipartite_impl basic Code - is_bipartite_impl(g) + is_bipartite_impl(graph = g) Output $res [1] TRUE @@ -4014,7 +4026,7 @@ # bipartite_game_gnp_impl basic Code - bipartite_game_gnp_impl(2, 2, 0.5) + bipartite_game_gnp_impl(n1 = 2, n2 = 2, p = 0.5) Output $graph IGRAPH U--- 4 4 -- @@ -4028,7 +4040,7 @@ --- Code - bipartite_game_gnp_impl(2, 2, 0.5, directed = TRUE, mode = "in") + bipartite_game_gnp_impl(n1 = 2, n2 = 2, p = 0.5, directed = TRUE, mode = "in") Output $graph IGRAPH D--- 4 1 -- @@ -4050,7 +4062,7 @@ # bipartite_game_gnm_impl basic Code - bipartite_game_gnm_impl(2, 2, 1) + bipartite_game_gnm_impl(n1 = 2, n2 = 2, m = 1) Output $graph IGRAPH U--- 4 1 -- @@ -4064,7 +4076,7 @@ --- Code - bipartite_game_gnm_impl(2, 2, 1, directed = TRUE, mode = "in") + bipartite_game_gnm_impl(n1 = 2, n2 = 2, m = 1, directed = TRUE, mode = "in") Output $graph IGRAPH D--- 4 1 -- @@ -4086,7 +4098,7 @@ # get_laplacian_impl basic Code - get_laplacian_impl(g) + get_laplacian_impl(graph = g) Output [,1] [,2] [,3] [1,] 1 -1 0 @@ -4096,8 +4108,8 @@ --- Code - get_laplacian_impl(g, mode = "in", normalization = "symmetric", weights = c(1, - 2)) + get_laplacian_impl(graph = g, mode = "in", normalization = "symmetric", + weights = c(1, 2)) Output [,1] [,2] [,3] [1,] 1.0000000 -0.5773503 0.0000000 @@ -4115,7 +4127,7 @@ # get_laplacian_sparse_impl basic Code - get_laplacian_sparse_impl(g) + get_laplacian_sparse_impl(graph = g) Output $type [1] "triplet" @@ -4138,8 +4150,8 @@ --- Code - get_laplacian_sparse_impl(g, mode = "in", normalization = "symmetric", weights = c( - 1, 2)) + get_laplacian_sparse_impl(graph = g, mode = "in", normalization = "symmetric", + weights = c(1, 2)) Output $type [1] "triplet" @@ -4170,14 +4182,14 @@ # connected_components_impl basic Code - connected_components_impl(g) + connected_components_impl(graph = g) Output [1] 0 0 0 --- Code - connected_components_impl(g, mode = "strong", details = TRUE) + connected_components_impl(graph = g, mode = "strong", details = TRUE) Output $membership [1] 0 0 0 @@ -4200,14 +4212,14 @@ # is_connected_impl basic Code - is_connected_impl(g) + is_connected_impl(graph = g) Output [1] TRUE --- Code - is_connected_impl(g, mode = "strong") + is_connected_impl(graph = g, mode = "strong") Output [1] TRUE @@ -4222,7 +4234,7 @@ # articulation_points_impl basic Code - articulation_points_impl(g) + articulation_points_impl(graph = g) Output + 1/3 vertex: [1] 2 @@ -4238,7 +4250,7 @@ # biconnected_components_impl basic Code - biconnected_components_impl(g) + biconnected_components_impl(graph = g) Output $no [1] 2 @@ -4293,7 +4305,7 @@ # bridges_impl basic Code - bridges_impl(g) + bridges_impl(graph = g) Output + 2/2 edges: [1] 2--3 1--2 @@ -4309,7 +4321,7 @@ # is_biconnected_impl basic Code - is_biconnected_impl(g) + is_biconnected_impl(graph = g) Output [1] FALSE @@ -4324,14 +4336,14 @@ # count_reachable_impl basic Code - count_reachable_impl(g, mode = "out") + count_reachable_impl(graph = g, mode = "out") Output [1] 5 5 5 5 5 --- Code - count_reachable_impl(g, mode = "in") + count_reachable_impl(graph = g, mode = "in") Output [1] 5 5 5 5 5 @@ -4346,7 +4358,7 @@ # bond_percolation_impl basic Code - bond_percolation_impl(g) + bond_percolation_impl(graph = g) Output $giant_size numeric(0) @@ -4366,7 +4378,7 @@ # site_percolation_impl basic Code - site_percolation_impl(g) + site_percolation_impl(graph = g) Output $giant_size numeric(0) @@ -4386,7 +4398,7 @@ # edgelist_percolation_impl basic Code - edgelist_percolation_impl(matrix(c(1, 2, 2, 3), ncol = 2)) + edgelist_percolation_impl(edges = matrix(c(1, 2, 2, 3), ncol = 2)) Output $giant_size [1] 2 3 @@ -4406,14 +4418,14 @@ # is_clique_impl basic Code - is_clique_impl(g, 1:2) + is_clique_impl(graph = g, candidate = 1:2) Output [1] TRUE --- Code - is_clique_impl(g, 1:2, directed = TRUE) + is_clique_impl(graph = g, candidate = 1:2, directed = TRUE) Output [1] TRUE @@ -4428,7 +4440,7 @@ # cliques_impl basic Code - cliques_impl(g) + cliques_impl(graph = g) Output [[1]] + 1/3 vertex: @@ -4454,7 +4466,7 @@ --- Code - cliques_impl(g, min = 2, max = 2) + cliques_impl(graph = g, min = 2, max = 2) Output [[1]] + 2/3 vertices: @@ -4476,14 +4488,14 @@ # clique_size_hist_impl basic Code - clique_size_hist_impl(g) + clique_size_hist_impl(graph = g) Output [1] 3 2 --- Code - clique_size_hist_impl(g, min.size = 2, max.size = 2) + clique_size_hist_impl(graph = g, min.size = 2, max.size = 2) Output [1] 0 2 @@ -4498,7 +4510,7 @@ # largest_cliques_impl basic Code - largest_cliques_impl(g) + largest_cliques_impl(graph = g) Output [[1]] + 2/3 vertices: @@ -4520,14 +4532,14 @@ # maximal_cliques_hist_impl basic Code - maximal_cliques_hist_impl(g) + maximal_cliques_hist_impl(graph = g) Output [1] 0 2 --- Code - maximal_cliques_hist_impl(g, min.size = 2, max.size = 2) + maximal_cliques_hist_impl(graph = g, min.size = 2, max.size = 2) Output [1] 0 2 @@ -4542,7 +4554,7 @@ # clique_number_impl basic Code - clique_number_impl(g) + clique_number_impl(graph = g) Output [1] 2 @@ -4557,7 +4569,7 @@ # weighted_cliques_impl basic Code - weighted_cliques_impl(g) + weighted_cliques_impl(graph = g) Output [[1]] + 1/3 vertex: @@ -4583,7 +4595,7 @@ --- Code - weighted_cliques_impl(g, vertex.weights = c(1, 2, 3), min.weight = 1, + weighted_cliques_impl(graph = g, vertex.weights = c(1, 2, 3), min.weight = 1, max.weight = 3, maximal = TRUE) Output [[1]] @@ -4602,7 +4614,7 @@ # largest_weighted_cliques_impl basic Code - largest_weighted_cliques_impl(g) + largest_weighted_cliques_impl(graph = g) Output [[1]] + 2/3 vertices: @@ -4616,7 +4628,7 @@ --- Code - largest_weighted_cliques_impl(g, vertex.weights = c(1, 2, 3)) + largest_weighted_cliques_impl(graph = g, vertex.weights = c(1, 2, 3)) Output [[1]] + 2/3 vertices: @@ -4634,14 +4646,14 @@ # weighted_clique_number_impl basic Code - weighted_clique_number_impl(g) + weighted_clique_number_impl(graph = g) Output [1] 2 --- Code - weighted_clique_number_impl(g, vertex.weights = c(1, 2, 3)) + weighted_clique_number_impl(graph = g, vertex.weights = c(1, 2, 3)) Output [1] 5 @@ -4656,7 +4668,7 @@ # is_independent_vertex_set_impl basic Code - is_independent_vertex_set_impl(g, 1:2) + is_independent_vertex_set_impl(graph = g, candidate = 1:2) Output [1] FALSE @@ -4671,7 +4683,7 @@ # layout_random_impl basic Code - layout_random_impl(g) + layout_random_impl(graph = g) Output [,1] [,2] [1,] 0.91714717 0.7003783 @@ -4689,7 +4701,7 @@ # layout_circle_impl basic Code - layout_circle_impl(g) + layout_circle_impl(graph = g) Output [,1] [,2] [1,] 1.0 0.0000000 @@ -4699,7 +4711,7 @@ --- Code - layout_circle_impl(g, order = 1:3) + layout_circle_impl(graph = g, order = 1:3) Output [,1] [,2] [1,] 1.0 0.0000000 @@ -4717,7 +4729,7 @@ # layout_star_impl basic Code - round(layout_star_impl(g), 4) + round(layout_star_impl(graph = g), 4) Output [,1] [,2] [1,] 0 0 @@ -4727,7 +4739,7 @@ --- Code - round(layout_star_impl(g, center = 1, order = 3:1), 4) + round(layout_star_impl(graph = g, center = 1, order = 3:1), 4) Output [,1] [,2] [1,] 0 0 @@ -4745,7 +4757,7 @@ # layout_grid_impl basic Code - layout_grid_impl(g) + layout_grid_impl(graph = g) Output [,1] [,2] [1,] 0 0 @@ -4755,7 +4767,7 @@ --- Code - layout_grid_impl(g, width = 2) + layout_grid_impl(graph = g, width = 2) Output [,1] [,2] [1,] 0 0 @@ -4773,7 +4785,7 @@ # layout_grid_3d_impl basic Code - layout_grid_3d_impl(g) + layout_grid_3d_impl(graph = g) Output [,1] [,2] [,3] [1,] 0 0 0 @@ -4783,7 +4795,7 @@ --- Code - layout_grid_3d_impl(g, width = 2, height = 2) + layout_grid_3d_impl(graph = g, width = 2, height = 2) Output [,1] [,2] [,3] [1,] 0 0 0 @@ -4801,7 +4813,7 @@ # roots_for_tree_layout_impl basic Code - roots_for_tree_layout_impl(g, mode = "out", heuristic = 1) + roots_for_tree_layout_impl(graph = g, mode = "out", heuristic = 1) Output + 1/3 vertex: [1] 2 @@ -4817,7 +4829,7 @@ # layout_random_3d_impl basic Code - layout_random_3d_impl(g) + layout_random_3d_impl(graph = g) Output [,1] [,2] [,3] [1,] 0.91714717 0.7003783 0.7338074 @@ -4835,7 +4847,7 @@ # layout_sphere_impl basic Code - layout_sphere_impl(g) + layout_sphere_impl(graph = g) Output [,1] [,2] [,3] [1,] 0.0000000 0.0000000 -1 @@ -4853,7 +4865,7 @@ # layout_sugiyama_impl basic Code - layout_sugiyama_impl(g) + layout_sugiyama_impl(graph = g) Output $res [,1] [,2] @@ -4873,7 +4885,7 @@ --- Code - layout_sugiyama_impl(g, layers = 1:3, hgap = 2, vgap = 2, maxiter = 10, + layout_sugiyama_impl(graph = g, layers = 1:3, hgap = 2, vgap = 2, maxiter = 10, weights = c(1, 2)) Output $res @@ -4902,7 +4914,7 @@ # layout_mds_impl basic Code - layout_mds_impl(g) + layout_mds_impl(graph = g) Output [,1] [,2] [1,] 1 2.807594e-08 @@ -4912,7 +4924,7 @@ --- Code - layout_mds_impl(g, dist = matrix(1:9, nrow = 3), dim = 3) + layout_mds_impl(graph = g, dist = matrix(1:9, nrow = 3), dim = 3) Output [,1] [,2] [,3] [1,] -2.907521 2.32638426 1.444979 @@ -4930,7 +4942,7 @@ # layout_bipartite_impl basic Code - layout_bipartite_impl(g, types = c(TRUE, FALSE, TRUE)) + layout_bipartite_impl(graph = g, types = c(TRUE, FALSE, TRUE)) Output [,1] [,2] [1,] 0.0 0 @@ -4940,7 +4952,7 @@ --- Code - layout_bipartite_impl(g, types = c(TRUE, FALSE, TRUE), hgap = 2, vgap = 2, + layout_bipartite_impl(graph = g, types = c(TRUE, FALSE, TRUE), hgap = 2, vgap = 2, maxiter = 10) Output [,1] [,2] @@ -4959,7 +4971,7 @@ # layout_gem_impl basic Code - layout_gem_impl(g, res = matrix(0, nrow = 3, ncol = 2)) + layout_gem_impl(graph = g, res = matrix(0, nrow = 3, ncol = 2)) Output [,1] [,2] [1,] 200.18284 -69.23950 @@ -4969,7 +4981,7 @@ --- Code - layout_gem_impl(g, res = matrix(0, nrow = 3, ncol = 2), use.seed = TRUE, + layout_gem_impl(graph = g, res = matrix(0, nrow = 3, ncol = 2), use.seed = TRUE, maxiter = 10, temp.max = 2, temp.min = 0.1, temp.init = 1) Output [,1] [,2] @@ -4988,7 +5000,7 @@ # layout_davidson_harel_impl basic Code - layout_davidson_harel_impl(g, res = matrix(0, nrow = 3, ncol = 2)) + layout_davidson_harel_impl(graph = g, res = matrix(0, nrow = 3, ncol = 2)) Output [,1] [,2] [1,] 1.152116 0.9424808 @@ -4998,8 +5010,8 @@ --- Code - layout_davidson_harel_impl(g, res = matrix(0, nrow = 3, ncol = 2), use.seed = TRUE, - maxiter = 10, fineiter = 5, cool.fact = 0.5, weight.node.dist = 2, + layout_davidson_harel_impl(graph = g, res = matrix(0, nrow = 3, ncol = 2), + use.seed = TRUE, maxiter = 10, fineiter = 5, cool.fact = 0.5, weight.node.dist = 2, weight.border = 1, weight.edge.lengths = 0.1, weight.edge.crossings = 0.2, weight.node.edge.dist = 0.3) Output @@ -5019,7 +5031,7 @@ # layout_umap_impl basic Code - layout_umap_impl(g, res = matrix(0, nrow = 3, ncol = 2), use.seed = TRUE) + layout_umap_impl(graph = g, res = matrix(0, nrow = 3, ncol = 2), use.seed = TRUE) Output [,1] [,2] [1,] 0 0 @@ -5029,7 +5041,7 @@ --- Code - layout_umap_impl(g, res = matrix(0, nrow = 3, ncol = 2), use.seed = TRUE, + layout_umap_impl(graph = g, res = matrix(0, nrow = 3, ncol = 2), use.seed = TRUE, distances = 1:3, min.dist = 0.1, epochs = 10, distances.are.weights = TRUE) Output [,1] [,2] @@ -5048,7 +5060,7 @@ # layout_umap_3d_impl basic Code - layout_umap_3d_impl(g, res = matrix(0, nrow = 3, ncol = 3), use.see = TRUE) + layout_umap_3d_impl(graph = g, res = matrix(0, nrow = 3, ncol = 3), use.seed = TRUE) Output [,1] [,2] [,3] [1,] 0 0 0 @@ -5058,7 +5070,7 @@ --- Code - layout_umap_3d_impl(g, res = matrix(0, nrow = 3, ncol = 3), use.seed = TRUE, + layout_umap_3d_impl(graph = g, res = matrix(0, nrow = 3, ncol = 3), use.seed = TRUE, distances = 1:3, min.dist = 0.1, epochs = 10, distances.are.weights = TRUE) Output [,1] [,2] [,3] @@ -5077,7 +5089,7 @@ # layout_umap_compute_weights_impl basic Code - layout_umap_compute_weights_impl(g, distances = 1:2, weights = 1:3) + layout_umap_compute_weights_impl(graph = g, distances = 1:2, weights = 1:3) Output [1] 1 1 @@ -5092,7 +5104,7 @@ # layout_align_impl basic Code - layout_align_impl(g, layout = matrix(0, nrow = 3, ncol = 2)) + layout_align_impl(graph = g, layout = matrix(0, nrow = 3, ncol = 2)) Output [,1] [,2] [1,] 0 0 @@ -5110,7 +5122,7 @@ # similarity_dice_impl basic Code - similarity_dice_impl(g) + similarity_dice_impl(graph = g) Output [,1] [,2] [,3] [1,] 1 0 1 @@ -5120,7 +5132,7 @@ --- Code - similarity_dice_impl(g, vids = 1:2, mode = "in", loops = TRUE) + similarity_dice_impl(graph = g, vids = 1:2, mode = "in", loops = TRUE) Output [,1] [,2] [1,] 1.0 0.8 @@ -5137,14 +5149,14 @@ # similarity_dice_es_impl basic Code - similarity_dice_es_impl(g) + similarity_dice_es_impl(graph = g) Output [1] 0 0 --- Code - similarity_dice_es_impl(g, es = 1:2, mode = "in", loops = TRUE) + similarity_dice_es_impl(graph = g, es = 1:2, mode = "in", loops = TRUE) Output [1] 0.8 0.8 @@ -5159,15 +5171,15 @@ # similarity_dice_pairs_impl basic Code - similarity_dice_pairs_impl(g, pairs = matrix(c(1, 2, 2, 3), ncol = 2)) + similarity_dice_pairs_impl(graph = g, pairs = matrix(c(1, 2, 2, 3), ncol = 2)) Output [1] 0 0 --- Code - similarity_dice_pairs_impl(g, pairs = matrix(c(1, 2, 2, 3), ncol = 2), mode = "in", - loops = TRUE) + similarity_dice_pairs_impl(graph = g, pairs = matrix(c(1, 2, 2, 3), ncol = 2), + mode = "in", loops = TRUE) Output [1] 0.6666667 0.8000000 @@ -5182,7 +5194,7 @@ # similarity_inverse_log_weighted_impl basic Code - similarity_inverse_log_weighted_impl(g) + similarity_inverse_log_weighted_impl(graph = g) Output [,1] [,2] [,3] [1,] 0.000000 0 1.442695 @@ -5192,7 +5204,7 @@ --- Code - similarity_inverse_log_weighted_impl(g, vids = 1:2, mode = "in") + similarity_inverse_log_weighted_impl(graph = g, vids = 1:2, mode = "in") Output [,1] [,2] [,3] [1,] 0 0 1.442695 @@ -5209,7 +5221,7 @@ # similarity_jaccard_impl basic Code - similarity_jaccard_impl(g) + similarity_jaccard_impl(graph = g) Output [,1] [,2] [,3] [1,] 1 0 1 @@ -5219,7 +5231,7 @@ --- Code - similarity_jaccard_impl(g, vids = 1:2, mode = "in", loops = TRUE) + similarity_jaccard_impl(graph = g, vids = 1:2, mode = "in", loops = TRUE) Output [,1] [,2] [1,] 1.0000000 0.6666667 @@ -5236,14 +5248,14 @@ # similarity_jaccard_es_impl basic Code - similarity_jaccard_es_impl(g) + similarity_jaccard_es_impl(graph = g) Output [1] 0 0 --- Code - similarity_jaccard_es_impl(g, es = 1:2, mode = "in", loops = TRUE) + similarity_jaccard_es_impl(graph = g, es = 1:2, mode = "in", loops = TRUE) Output [1] 0.6666667 0.6666667 @@ -5258,15 +5270,15 @@ # similarity_jaccard_pairs_impl basic Code - similarity_jaccard_pairs_impl(g, pairs = matrix(c(1, 2, 2, 3), ncol = 2)) + similarity_jaccard_pairs_impl(graph = g, pairs = matrix(c(1, 2, 2, 3), ncol = 2)) Output [1] 0 0 --- Code - similarity_jaccard_pairs_impl(g, pairs = matrix(c(1, 2, 2, 3), ncol = 2), mode = "in", - loops = TRUE) + similarity_jaccard_pairs_impl(graph = g, pairs = matrix(c(1, 2, 2, 3), ncol = 2), + mode = "in", loops = TRUE) Output [1] 0.5000000 0.6666667 @@ -5281,14 +5293,14 @@ # compare_communities_impl basic Code - compare_communities_impl(c(1, 2, 1), c(2, 1, 2)) + compare_communities_impl(comm1 = c(1, 2, 1), comm2 = c(2, 1, 2)) Output [1] 0 --- Code - compare_communities_impl(c(1, 2, 1), c(2, 1, 2), method = "nmi") + compare_communities_impl(comm1 = c(1, 2, 1), comm2 = c(2, 1, 2), method = "nmi") Output [1] 1 @@ -5305,15 +5317,15 @@ # modularity_impl basic Code - modularity_impl(g, membership = c(1, 2, 1)) + modularity_impl(graph = g, membership = c(1, 2, 1)) Output [1] -0.5 --- Code - modularity_impl(g, membership = c(1, 2, 1), weights = c(1, 2), resolution = 0.5, - directed = FALSE) + modularity_impl(graph = g, membership = c(1, 2, 1), weights = c(1, 2), + resolution = 0.5, directed = FALSE) Output [1] -0.25 @@ -5328,7 +5340,7 @@ # modularity_matrix_impl basic Code - modularity_matrix_impl(g) + modularity_matrix_impl(graph = g) Output [,1] [,2] [,3] [1,] -0.25 0.5 -0.25 @@ -5338,7 +5350,8 @@ --- Code - modularity_matrix_impl(g, weights = c(1, 2), resolution = 0.5, directed = FALSE) + modularity_matrix_impl(graph = g, weights = c(1, 2), resolution = 0.5, + directed = FALSE) Output [,1] [,2] [,3] [1,] -0.08333333 0.75 -0.1666667 @@ -5356,7 +5369,7 @@ # community_fluid_communities_impl basic Code - community_fluid_communities_impl(g, no.of.communities = 2) + community_fluid_communities_impl(graph = g, no.of.communities = 2) Output [1] 1 0 0 @@ -5371,15 +5384,15 @@ # community_label_propagation_impl basic Code - community_label_propagation_impl(g) + community_label_propagation_impl(graph = g) Output [1] 0 0 0 --- Code - community_label_propagation_impl(g, mode = "in", weights = c(1, 2), initial = 1: - 3, fixed = c(TRUE, FALSE, TRUE)) + community_label_propagation_impl(graph = g, mode = "in", weights = c(1, 2), + initial = 1:3, fixed = c(TRUE, FALSE, TRUE)) Output [1] 0 1 1 @@ -5394,7 +5407,7 @@ # community_multilevel_impl basic Code - community_multilevel_impl(g) + community_multilevel_impl(graph = g) Output $membership [1] 0 0 0 @@ -5410,7 +5423,7 @@ --- Code - community_multilevel_impl(g, weights = c(1, 2), resolution = 0.5) + community_multilevel_impl(graph = g, weights = c(1, 2), resolution = 0.5) Output $membership [1] 0 0 0 @@ -5434,7 +5447,7 @@ # community_optimal_modularity_impl basic Code - community_optimal_modularity_impl(g) + community_optimal_modularity_impl(graph = g) Output $modularity [1] 0 @@ -5446,7 +5459,7 @@ --- Code - community_optimal_modularity_impl(g, weights = c(1, 2)) + community_optimal_modularity_impl(graph = g, weights = c(1, 2)) Output $modularity [1] 1.850372e-17 @@ -5466,7 +5479,7 @@ # community_leiden_impl basic Code - community_leiden_impl(g, weights = c(1, 2), vertex.weights = c(1, 2, 3), + community_leiden_impl(graph = g, weights = c(1, 2), vertex.weights = c(1, 2, 3), resolution = 0.5, beta = 0.1, start = TRUE, n.iterations = 1, membership = 1:3) Output $membership @@ -5490,7 +5503,7 @@ # split_join_distance_impl basic Code - split_join_distance_impl(c(1, 2, 1), c(2, 1, 2)) + split_join_distance_impl(comm1 = c(1, 2, 1), comm2 = c(2, 1, 2)) Output $distance12 [1] 0 @@ -5512,7 +5525,7 @@ # community_infomap_impl basic Code - community_infomap_impl(g) + community_infomap_impl(graph = g) Output $membership [1] 0 0 0 @@ -5524,7 +5537,7 @@ --- Code - community_infomap_impl(g, e.weights = c(1, 2), v.weights = c(1, 2, 3), + community_infomap_impl(graph = g, e.weights = c(1, 2), v.weights = c(1, 2, 3), nb.trials = 2) Output $membership @@ -5545,7 +5558,7 @@ # graphlets_impl basic Code - graphlets_impl(g) + graphlets_impl(graph = g) Output $cliques $cliques[[1]] @@ -5564,7 +5577,7 @@ --- Code - graphlets_impl(g, weights = c(3, 4), niter = 10) + graphlets_impl(graph = g, weights = c(3, 4), niter = 10) Output $cliques $cliques[[1]] @@ -5591,7 +5604,7 @@ # hrg_fit_impl basic Code - hrg_fit_impl(g1) + hrg_fit_impl(graph = g1) Output $left [1] -2 0 @@ -5620,7 +5633,7 @@ # hrg_sample_impl basic Code - hrg_sample_impl(hrg_model) + hrg_sample_impl(hrg = hrg_model) Output IGRAPH U--- 10 45 -- + edges: @@ -5641,7 +5654,7 @@ # hrg_sample_many_impl basic Code - hrg_sample_many_impl(hrg_model, num.samples = 2) + hrg_sample_many_impl(hrg = hrg_model, num.samples = 2) Output [[1]] IGRAPH U--- 10 45 -- @@ -5672,7 +5685,7 @@ # hrg_game_impl basic Code - hrg_game_impl(hrg_model) + hrg_game_impl(hrg = hrg_model) Output IGRAPH U--- 10 45 -- Hierarchical random graph model + attr: name (g/c) @@ -5710,7 +5723,7 @@ # hrg_create_impl basic Code - hrg_create_impl(g, prob = rep(0.5, 2)) + hrg_create_impl(graph = g, prob = rep(0.5, 2)) Output Hierarchical random graph, at level 3: g1 p=0.5 1 @@ -5727,7 +5740,7 @@ # hrg_resize_impl basic Code - hrg_resize_impl(hrg_model, newsize = 5) + hrg_resize_impl(hrg = hrg_model, newsize = 5) Output $left [1] 0 -9 -6 -2 @@ -5756,7 +5769,7 @@ # hrg_size_impl basic Code - hrg_size_impl(hrg_model) + hrg_size_impl(hrg = hrg_model) Output [1] 10 @@ -5771,7 +5784,7 @@ # from_hrg_dendrogram_impl basic Code - from_hrg_dendrogram_impl(hrg_model) + from_hrg_dendrogram_impl(hrg = hrg_model) Output $graph IGRAPH D--- 19 18 -- @@ -5794,7 +5807,7 @@ # get_adjacency_sparse_impl basic Code - get_adjacency_sparse_impl(g) + get_adjacency_sparse_impl(graph = g) Output $type [1] "triplet" @@ -5817,7 +5830,7 @@ --- Code - get_adjacency_sparse_impl(g, type = "upper", weights = c(1, 2), loops = "none") + get_adjacency_sparse_impl(graph = g, type = "upper", weights = c(1, 2), loops = "none") Output $type [1] "triplet" @@ -5848,7 +5861,7 @@ # get_stochastic_impl basic Code - get_stochastic_impl(g) + get_stochastic_impl(graph = g) Output [,1] [,2] [,3] [1,] 0.0 1 0.0 @@ -5858,7 +5871,7 @@ --- Code - get_stochastic_impl(g, column.wise = TRUE, weights = c(1, 2)) + get_stochastic_impl(graph = g, column.wise = TRUE, weights = c(1, 2)) Output [,1] [,2] [,3] [1,] 0 0.3333333 0 @@ -5876,7 +5889,7 @@ # get_stochastic_sparse_impl basic Code - get_stochastic_sparse_impl(g) + get_stochastic_sparse_impl(graph = g) Output $type [1] "triplet" @@ -5899,7 +5912,7 @@ --- Code - get_stochastic_sparse_impl(g, column.wise = TRUE, weights = c(1, 2)) + get_stochastic_sparse_impl(graph = g, column.wise = TRUE, weights = c(1, 2)) Output $type [1] "triplet" @@ -5930,7 +5943,7 @@ # to_directed_impl basic Code - to_directed_impl(g) + to_directed_impl(graph = g) Output IGRAPH D--- 3 4 -- + edges: @@ -5939,7 +5952,7 @@ --- Code - to_directed_impl(g, mode = "acyclic") + to_directed_impl(graph = g, mode = "acyclic") Output IGRAPH D--- 3 2 -- + edges: @@ -5956,7 +5969,7 @@ # to_undirected_impl basic Code - to_undirected_impl(g) + to_undirected_impl(graph = g) Output IGRAPH U--- 3 2 -- + edges: @@ -5965,7 +5978,7 @@ --- Code - to_undirected_impl(g, mode = "mutual", edge.attr.comb = "sum") + to_undirected_impl(graph = g, mode = "mutual", edge.attr.comb = "sum") Output IGRAPH U--- 3 2 -- + edges: @@ -5982,14 +5995,14 @@ # motifs_randesu_impl basic Code - motifs_randesu_impl(g) + motifs_randesu_impl(graph = g) Output [1] NaN NaN 1 0 --- Code - motifs_randesu_impl(g, size = 4, cut.prob = rep(0.1, 4)) + motifs_randesu_impl(graph = g, size = 4, cut.prob = rep(0.1, 4)) Output [1] NaN NaN NaN NaN 0 NaN 0 0 0 0 0 @@ -6004,15 +6017,15 @@ # motifs_randesu_estimate_impl basic Code - motifs_randesu_estimate_impl(g, size = 3, sample.size = 2) + motifs_randesu_estimate_impl(graph = g, size = 3, sample.size = 2) Output [1] 3 --- Code - motifs_randesu_estimate_impl(g, size = 4, cut.prob = rep(0.1, 4), sample.size = 2, - sample = 1:2) + motifs_randesu_estimate_impl(graph = g, size = 4, cut.prob = rep(0.1, 4), + sample.size = 2, sample = 1:2) Output [1] 3 @@ -6027,14 +6040,14 @@ # motifs_randesu_no_impl basic Code - motifs_randesu_no_impl(g) + motifs_randesu_no_impl(graph = g) Output [1] 1 --- Code - motifs_randesu_no_impl(g, size = 4, cut.prob = c(0.1, 0.1, 0.1, 0.1)) + motifs_randesu_no_impl(graph = g, size = 4, cut.prob = c(0.1, 0.1, 0.1, 0.1)) Output [1] 0 @@ -6049,7 +6062,7 @@ # dyad_census_impl basic Code - dyad_census_impl(g) + dyad_census_impl(graph = g) Output $mut [1] 2 @@ -6072,7 +6085,7 @@ # triad_census_impl basic Code - triad_census_impl(g) + triad_census_impl(graph = g) Condition Warning in `triad_census_impl()`: At vendor/cigraph/src/misc/motifs.c:1157 : Triad census called on an undirected graph. All connections will be treated as mutual. @@ -6090,14 +6103,14 @@ # count_adjacent_triangles_impl basic Code - count_adjacent_triangles_impl(g) + count_adjacent_triangles_impl(graph = g) Output [1] 0 0 0 --- Code - count_adjacent_triangles_impl(g, vids = 1:2) + count_adjacent_triangles_impl(graph = g, vids = 1:2) Output [1] 0 0 @@ -6112,7 +6125,7 @@ # count_triangles_impl basic Code - count_triangles_impl(g) + count_triangles_impl(graph = g) Output [1] 0 @@ -6127,14 +6140,14 @@ # local_scan_0_impl basic Code - local_scan_0_impl(g) + local_scan_0_impl(graph = g) Output [1] 1 2 1 --- Code - local_scan_0_impl(g, weights = c(1, 2), mode = "in") + local_scan_0_impl(graph = g, weights = c(1, 2), mode = "in") Output [1] 1 3 2 @@ -6149,14 +6162,14 @@ # local_scan_0_them_impl basic Code - local_scan_0_them_impl(g1, g2) + local_scan_0_them_impl(us = g1, them = g2) Output [1] 1 2 1 --- Code - local_scan_0_them_impl(g1, g2, weights.them = c(1, 2), mode = "in") + local_scan_0_them_impl(us = g1, them = g2, weights.them = c(1, 2), mode = "in") Output [1] 1 3 2 @@ -6171,14 +6184,14 @@ # local_scan_1_ecount_impl basic Code - local_scan_1_ecount_impl(g) + local_scan_1_ecount_impl(graph = g) Output [1] 1 2 1 --- Code - local_scan_1_ecount_impl(g, weights = c(1, 2), mode = "in") + local_scan_1_ecount_impl(graph = g, weights = c(1, 2), mode = "in") Output [1] 1 3 2 @@ -6193,14 +6206,14 @@ # local_scan_1_ecount_them_impl basic Code - local_scan_1_ecount_them_impl(g1, g2) + local_scan_1_ecount_them_impl(us = g1, them = g2) Output [1] 1 2 1 --- Code - local_scan_1_ecount_them_impl(g1, g2, weights.them = c(1, 2), mode = "in") + local_scan_1_ecount_them_impl(us = g1, them = g2, weights.them = c(1, 2), mode = "in") Output [1] 1 3 2 @@ -6215,14 +6228,14 @@ # local_scan_k_ecount_impl basic Code - local_scan_k_ecount_impl(g, k = 1) + local_scan_k_ecount_impl(graph = g, k = 1) Output [1] 1 2 1 --- Code - local_scan_k_ecount_impl(g, k = 1, weights = c(1, 2), mode = "in") + local_scan_k_ecount_impl(graph = g, k = 1, weights = c(1, 2), mode = "in") Output [1] 1 3 2 @@ -6237,14 +6250,15 @@ # local_scan_k_ecount_them_impl basic Code - local_scan_k_ecount_them_impl(g1, g2, k = 1) + local_scan_k_ecount_them_impl(us = g1, them = g2, k = 1) Output [1] 1 2 1 --- Code - local_scan_k_ecount_them_impl(g1, g2, k = 1, weights.them = c(1, 2), mode = "in") + local_scan_k_ecount_them_impl(us = g1, them = g2, k = 1, weights.them = c(1, 2), + mode = "in") Output [1] 1 3 2 @@ -6259,15 +6273,16 @@ # local_scan_neighborhood_ecount_impl basic Code - local_scan_neighborhood_ecount_impl(g, neighborhoods = list(1:2, 2:3, 2:4, 2)) + local_scan_neighborhood_ecount_impl(graph = g, neighborhoods = list(1:2, 2:3, 2: + 4, 2)) Output [1] 1 1 2 0 --- Code - local_scan_neighborhood_ecount_impl(g, weights = c(1, 2, 3), neighborhoods = list( - 1:2, 1:3, 2:4, 1)) + local_scan_neighborhood_ecount_impl(graph = g, weights = c(1, 2, 3), + neighborhoods = list(1:2, 1:3, 2:4, 1)) Output [1] 1 3 5 0 @@ -6282,15 +6297,15 @@ # local_scan_subset_ecount_impl basic Code - local_scan_subset_ecount_impl(g, subsets = list(c(1, 2), c(2, 3))) + local_scan_subset_ecount_impl(graph = g, subsets = list(c(1, 2), c(2, 3))) Output [1] 1 1 --- Code - local_scan_subset_ecount_impl(g, weights = c(1, 2, 3), subsets = list(c(1, 2), - c(2, 3))) + local_scan_subset_ecount_impl(graph = g, weights = c(1, 2, 3), subsets = list(c( + 1, 2), c(2, 3))) Output [1] 1 2 @@ -6305,7 +6320,7 @@ # list_triangles_impl basic Code - list_triangles_impl(g) + list_triangles_impl(graph = g) Output + 0/3 vertices: @@ -6320,7 +6335,7 @@ # join_impl basic Code - join_impl(g1, g2) + join_impl(left = g1, right = g2) Output IGRAPH U--- 6 13 -- + edges: @@ -6337,7 +6352,7 @@ # induced_subgraph_map_impl basic Code - induced_subgraph_map_impl(g, 1:2, impl = "auto") + induced_subgraph_map_impl(graph = g, vids = 1:2, impl = "auto") Output $res IGRAPH U--- 2 1 -- @@ -6354,7 +6369,7 @@ --- Code - induced_subgraph_map_impl(g, 1:2, impl = "copy_and_delete") + induced_subgraph_map_impl(graph = g, vids = 1:2, impl = "copy_and_delete") Output $res IGRAPH U--- 2 1 -- @@ -6379,7 +6394,7 @@ # mycielskian_impl basic Code - mycielskian_impl(g) + mycielskian_impl(graph = g) Output IGRAPH U--- 7 9 -- + edges: @@ -6388,7 +6403,7 @@ --- Code - mycielskian_impl(g, k = 2) + mycielskian_impl(graph = g, k = 2) Output IGRAPH U--- 15 34 -- + edges: @@ -6408,7 +6423,7 @@ # product_impl basic Code - product_impl(g1, g2) + product_impl(g1 = g1, g2 = g2) Output IGRAPH U--- 9 12 -- + edges: @@ -6417,7 +6432,7 @@ --- Code - product_impl(g1, g2, type = "tensor") + product_impl(g1 = g1, g2 = g2, type = "tensor") Output IGRAPH U--- 9 8 -- + edges: @@ -6434,7 +6449,7 @@ # rooted_product_impl basic Code - rooted_product_impl(g1, g2, root = 1) + rooted_product_impl(g1 = g1, g2 = g2, root = 1) Output IGRAPH U--- 9 8 -- + edges: @@ -6451,7 +6466,7 @@ # gomory_hu_tree_impl basic Code - gomory_hu_tree_impl(g) + gomory_hu_tree_impl(graph = g) Output $tree IGRAPH U--- 3 2 -- @@ -6465,7 +6480,7 @@ --- Code - gomory_hu_tree_impl(g, capacity = c(1, 2)) + gomory_hu_tree_impl(graph = g, capacity = c(1, 2)) Output $tree IGRAPH U--- 3 2 -- @@ -6487,7 +6502,7 @@ # maxflow_impl basic Code - maxflow_impl(g, source = 1, target = 3) + maxflow_impl(graph = g, source = 1, target = 3) Output $value [1] 1 @@ -6528,7 +6543,7 @@ --- Code - maxflow_impl(g, source = 1, target = 3, capacity = c(1, 2)) + maxflow_impl(graph = g, source = 1, target = 3, capacity = c(1, 2)) Output $value [1] 1 @@ -6577,7 +6592,7 @@ # residual_graph_impl basic Code - residual_graph_impl(g, capacity = c(1, 2), flow = c(1, 2)) + residual_graph_impl(graph = g, capacity = c(1, 2), flow = c(1, 2)) Output $residual IGRAPH D--- 3 0 -- @@ -6598,7 +6613,7 @@ # reverse_residual_graph_impl basic Code - reverse_residual_graph_impl(g, capacity = c(1, 2), flow = c(1, 2)) + reverse_residual_graph_impl(graph = g, capacity = c(1, 2), flow = c(1, 2)) Output IGRAPH D--- 3 2 -- + edges: @@ -6615,7 +6630,7 @@ # st_mincut_impl basic Code - st_mincut_impl(g, source = 1, target = 3) + st_mincut_impl(graph = g, source = 1, target = 3) Output $value [1] 1 @@ -6636,7 +6651,7 @@ --- Code - st_mincut_impl(g, source = 1, target = 3, capacity = c(1, 2)) + st_mincut_impl(graph = g, source = 1, target = 3, capacity = c(1, 2)) Output $value [1] 1 @@ -6665,7 +6680,7 @@ # dominator_tree_impl basic Code - dominator_tree_impl(g, root = 1) + dominator_tree_impl(graph = g, root = 1) Output $dom [1] 0 1 2 @@ -6682,7 +6697,7 @@ --- Code - dominator_tree_impl(g, root = 1, mode = "in") + dominator_tree_impl(graph = g, root = 1, mode = "in") Output $dom [1] 0 -1 -1 @@ -6707,7 +6722,7 @@ # all_st_cuts_impl basic Code - all_st_cuts_impl(g, source = 1, target = 3) + all_st_cuts_impl(graph = g, source = 1, target = 3) Output $cuts $cuts[[1]] @@ -6741,7 +6756,7 @@ # all_st_mincuts_impl basic Code - all_st_mincuts_impl(g, source = 1, target = 3) + all_st_mincuts_impl(graph = g, source = 1, target = 3) Output $value [1] 1 @@ -6770,7 +6785,7 @@ --- Code - all_st_mincuts_impl(g, source = 1, target = 3, capacity = c(1, 2)) + all_st_mincuts_impl(graph = g, source = 1, target = 3, capacity = c(1, 2)) Output $value [1] 1 @@ -6799,7 +6814,7 @@ # even_tarjan_reduction_impl basic Code - even_tarjan_reduction_impl(g) + even_tarjan_reduction_impl(graph = g) Output $graphbar IGRAPH D--- 6 7 -- @@ -6821,7 +6836,7 @@ # is_separator_impl basic Code - is_separator_impl(g, 1:2) + is_separator_impl(graph = g, candidate = 1:2) Output [1] FALSE @@ -6836,7 +6851,7 @@ # is_minimal_separator_impl basic Code - is_minimal_separator_impl(g, 1:2) + is_minimal_separator_impl(graph = g, candidate = 1:2) Output [1] FALSE @@ -6851,7 +6866,7 @@ # all_minimal_st_separators_impl basic Code - all_minimal_st_separators_impl(g) + all_minimal_st_separators_impl(graph = g) Output [[1]] + 1/3 vertex: @@ -6869,7 +6884,7 @@ # minimum_size_separators_impl basic Code - minimum_size_separators_impl(g) + minimum_size_separators_impl(graph = g) Output [[1]] + 1/3 vertex: @@ -6887,7 +6902,7 @@ # isoclass_impl basic Code - isoclass_impl(g) + isoclass_impl(graph = g) Output [1] 2 @@ -6902,7 +6917,7 @@ # isomorphic_impl basic Code - isomorphic_impl(g1, g2) + isomorphic_impl(graph1 = g1, graph2 = g2) Output [1] TRUE @@ -6917,7 +6932,7 @@ # isoclass_subgraph_impl basic Code - isoclass_subgraph_impl(g, c(1, 2, 3)) + isoclass_subgraph_impl(graph = g, vids = c(1, 2, 3)) Output [1] 2 @@ -6960,7 +6975,7 @@ # isomorphic_vf2_impl basic Code - isomorphic_vf2_impl(g1, g2) + isomorphic_vf2_impl(graph1 = g1, graph2 = g2) Output $iso [1] TRUE @@ -6975,8 +6990,8 @@ --- Code - isomorphic_vf2_impl(g1, g2, vertex.color1 = c(1, 2, 3), vertex.color2 = c(1, 2, - 3), edge.color1 = c(1, 2), edge.color2 = c(1, 2)) + isomorphic_vf2_impl(graph1 = g1, graph2 = g2, vertex.color1 = c(1, 2, 3), + vertex.color2 = c(1, 2, 3), edge.color1 = c(1, 2), edge.color2 = c(1, 2)) Output $iso [1] TRUE @@ -6999,15 +7014,15 @@ # count_isomorphisms_vf2_impl basic Code - count_isomorphisms_vf2_impl(g1, g2) + count_isomorphisms_vf2_impl(graph1 = g1, graph2 = g2) Output [1] 2 --- Code - count_isomorphisms_vf2_impl(g1, g2, vertex.color1 = c(1, 2, 3), vertex.color2 = c( - 1, 2, 3), edge.color1 = c(1, 2), edge.color2 = c(1, 2)) + count_isomorphisms_vf2_impl(graph1 = g1, graph2 = g2, vertex.color1 = c(1, 2, 3), + vertex.color2 = c(1, 2, 3), edge.color1 = c(1, 2), edge.color2 = c(1, 2)) Output [1] 1 @@ -7022,7 +7037,7 @@ # get_isomorphisms_vf2_impl basic Code - get_isomorphisms_vf2_impl(g1, g2) + get_isomorphisms_vf2_impl(graph1 = g1, graph2 = g2) Output [[1]] [1] 0 1 2 @@ -7034,8 +7049,8 @@ --- Code - get_isomorphisms_vf2_impl(g1, g2, vertex.color1 = c(1, 2, 3), vertex.color2 = c( - 1, 2, 3), edge.color1 = c(1, 2), edge.color2 = c(1, 2)) + get_isomorphisms_vf2_impl(graph1 = g1, graph2 = g2, vertex.color1 = c(1, 2, 3), + vertex.color2 = c(1, 2, 3), edge.color1 = c(1, 2), edge.color2 = c(1, 2)) Output [[1]] [1] 0 1 2 @@ -7052,7 +7067,7 @@ # subisomorphic_impl basic Code - subisomorphic_impl(g1, g2) + subisomorphic_impl(graph1 = g1, graph2 = g2) Output [1] TRUE @@ -7067,7 +7082,7 @@ # subisomorphic_vf2_impl basic Code - subisomorphic_vf2_impl(g1, g2) + subisomorphic_vf2_impl(graph1 = g1, graph2 = g2) Output $iso [1] TRUE @@ -7082,8 +7097,8 @@ --- Code - subisomorphic_vf2_impl(g1, g2, vertex.color1 = c(1, 2, 3), vertex.color2 = c(1, - 2, 3), edge.color1 = c(1, 2), edge.color2 = c(1, 2)) + subisomorphic_vf2_impl(graph1 = g1, graph2 = g2, vertex.color1 = c(1, 2, 3), + vertex.color2 = c(1, 2, 3), edge.color1 = c(1, 2), edge.color2 = c(1, 2)) Output $iso [1] TRUE @@ -7106,15 +7121,15 @@ # count_subisomorphisms_vf2_impl basic Code - count_subisomorphisms_vf2_impl(g1, g2) + count_subisomorphisms_vf2_impl(graph1 = g1, graph2 = g2) Output [1] 2 --- Code - count_subisomorphisms_vf2_impl(g1, g2, vertex.color1 = c(1, 2, 3), - vertex.color2 = c(1, 2, 3), edge.color1 = c(1, 2), edge.color2 = c(1, 2)) + count_subisomorphisms_vf2_impl(graph1 = g1, graph2 = g2, vertex.color1 = c(1, 2, + 3), vertex.color2 = c(1, 2, 3), edge.color1 = c(1, 2), edge.color2 = c(1, 2)) Output [1] 1 @@ -7129,7 +7144,7 @@ # get_subisomorphisms_vf2_impl basic Code - get_subisomorphisms_vf2_impl(g1, g2) + get_subisomorphisms_vf2_impl(graph1 = g1, graph2 = g2) Output [[1]] [1] 0 1 2 @@ -7141,8 +7156,8 @@ --- Code - get_subisomorphisms_vf2_impl(g1, g2, vertex.color1 = c(1, 2, 3), vertex.color2 = c( - 1, 2, 3), edge.color1 = c(1, 2), edge.color2 = c(1, 2)) + get_subisomorphisms_vf2_impl(graph1 = g1, graph2 = g2, vertex.color1 = c(1, 2, + 3), vertex.color2 = c(1, 2, 3), edge.color1 = c(1, 2), edge.color2 = c(1, 2)) Output [[1]] [1] 0 1 2 @@ -7159,7 +7174,7 @@ # canonical_permutation_impl basic Code - canonical_permutation_impl(g) + canonical_permutation_impl(graph = g) Output $labeling [1] 2 3 1 @@ -7188,7 +7203,7 @@ --- Code - canonical_permutation_impl(g, colors = c(1, 2, 3), sh = "fl") + canonical_permutation_impl(graph = g, colors = c(1, 2, 3), sh = "fl") Output $labeling [1] 1 2 3 @@ -7225,7 +7240,7 @@ # permute_vertices_impl basic Code - permute_vertices_impl(g, permutation = 3:1) + permute_vertices_impl(graph = g, permutation = 3:1) Output IGRAPH U--- 3 2 -- + edges: @@ -7242,7 +7257,7 @@ # isomorphic_bliss_impl basic Code - isomorphic_bliss_impl(g1, g2) + isomorphic_bliss_impl(graph1 = g1, graph2 = g2) Output $iso [1] TRUE @@ -7297,7 +7312,8 @@ --- Code - isomorphic_bliss_impl(g1, g2, colors1 = c(1, 2, 3), colors2 = c(1, 2, 3), sh = "fl") + isomorphic_bliss_impl(graph1 = g1, graph2 = g2, colors1 = c(1, 2, 3), colors2 = c( + 1, 2, 3), sh = "fl") Output $iso [1] TRUE @@ -7360,7 +7376,7 @@ # count_automorphisms_impl basic Code - count_automorphisms_impl(g) + count_automorphisms_impl(graph = g) Output $nof_nodes [1] 3 @@ -7384,7 +7400,7 @@ --- Code - count_automorphisms_impl(g, colors = c(1, 2, 3), sh = "fl") + count_automorphisms_impl(graph = g, colors = c(1, 2, 3), sh = "fl") Output $nof_nodes [1] 1 @@ -7416,7 +7432,7 @@ # automorphism_group_impl basic Code - automorphism_group_impl(g) + automorphism_group_impl(graph = g) Output [[1]] + 3/3 vertices: @@ -7426,7 +7442,7 @@ --- Code - automorphism_group_impl(g, colors = c(1, 2, 3), sh = "fl", details = TRUE) + automorphism_group_impl(graph = g, colors = c(1, 2, 3), sh = "fl", details = TRUE) Output $generators list() @@ -7463,7 +7479,7 @@ # simplify_and_colorize_impl basic Code - simplify_and_colorize_impl(g) + simplify_and_colorize_impl(graph = g) Output $res IGRAPH U--- 3 2 -- @@ -7488,14 +7504,14 @@ # graph_count_impl basic Code - graph_count_impl(3) + graph_count_impl(n = 3) Output [1] 4 --- Code - graph_count_impl(3, directed = TRUE) + graph_count_impl(n = 3, directed = TRUE) Output [1] 16 @@ -7512,14 +7528,14 @@ # is_matching_impl basic Code - is_matching_impl(g, matching = 1:2) + is_matching_impl(graph = g, matching = 1:2) Output [1] FALSE --- Code - is_matching_impl(g, types = c(TRUE, FALSE, TRUE), matching = 1:2) + is_matching_impl(graph = g, types = c(TRUE, FALSE, TRUE), matching = 1:2) Output [1] FALSE @@ -7534,14 +7550,15 @@ # is_maximal_matching_impl basic Code - is_maximal_matching_impl(g, matching = 1:2) + is_maximal_matching_impl(graph = g, matching = 1:2) Output [1] FALSE --- Code - is_maximal_matching_impl(g, types = c(TRUE, FALSE, TRUE), matching = 1:2) + is_maximal_matching_impl(graph = g, types = c(TRUE, FALSE, TRUE), matching = 1: + 2) Output [1] FALSE @@ -7556,7 +7573,7 @@ # maximum_bipartite_matching_impl basic Code - maximum_bipartite_matching_impl(g, types = c(TRUE, FALSE, TRUE)) + maximum_bipartite_matching_impl(graph = g, types = c(TRUE, FALSE, TRUE)) Output $matching_size [1] 1 @@ -7571,8 +7588,8 @@ --- Code - maximum_bipartite_matching_impl(g, types = c(TRUE, FALSE, TRUE), weights = c(1, - 2), eps = 1e-05) + maximum_bipartite_matching_impl(graph = g, types = c(TRUE, FALSE, TRUE), + weights = c(1, 2), eps = 1e-05) Output $matching_size [1] 1 @@ -7595,7 +7612,7 @@ # adjacency_spectral_embedding_impl basic Code - adjacency_spectral_embedding_impl(g, no = 2) + adjacency_spectral_embedding_impl(graph = g, no = 2) Output $X [,1] [,2] @@ -7675,7 +7692,7 @@ --- Code - adjacency_spectral_embedding_impl(g, no = 2, weights = c(1, 2), which = "la", + adjacency_spectral_embedding_impl(graph = g, no = 2, weights = c(1, 2), which = "la", scaled = FALSE, cvec = c(1, 2, 3), options = list(maxiter = 10)) Output $X @@ -7764,7 +7781,7 @@ # laplacian_spectral_embedding_impl basic Code - laplacian_spectral_embedding_impl(g, no = 2) + laplacian_spectral_embedding_impl(graph = g, no = 2) Output $X [,1] [,2] @@ -7852,7 +7869,7 @@ # eigen_adjacency_impl basic Code - eigen_adjacency_impl(g) + eigen_adjacency_impl(graph = g) Output $options $options$bmat @@ -7951,7 +7968,7 @@ # power_law_fit_impl basic Code - power_law_fit_impl(c(1, 2, 3)) + power_law_fit_impl(data = c(1, 2, 3)) Output $continuous [1] FALSE @@ -7972,7 +7989,7 @@ --- Code - power_law_fit_impl(c(1, 2, 3), xmin = 1, force.continuous = TRUE) + power_law_fit_impl(data = c(1, 2, 3), xmin = 1, force.continuous = TRUE) Output $continuous [1] TRUE @@ -8003,7 +8020,7 @@ # sir_impl basic Code - sir_impl(g, beta = 0.1, gamma = 0.1) + sir_impl(graph = g, beta = 0.1, gamma = 0.1) Output [[1]] [[1]]$times @@ -9411,7 +9428,7 @@ --- Code - sir_impl(g, beta = 0.1, gamma = 0.1, no.sim = 2) + sir_impl(graph = g, beta = 0.1, gamma = 0.1, no.sim = 2) Output [[1]] [[1]]$times @@ -9455,7 +9472,7 @@ # convex_hull_2d_impl basic Code - convex_hull_2d_impl(matrix(1:6, ncol = 2)) + convex_hull_2d_impl(data = matrix(1:6, ncol = 2)) Output $resverts [1] 1 3 @@ -9479,7 +9496,7 @@ # dim_select_impl basic Code - dim_select_impl(c(1, 2, 3)) + dim_select_impl(sv = c(1, 2, 3)) Output [1] 1 @@ -9494,7 +9511,7 @@ # solve_lsap_impl basic Code - solve_lsap_impl(matrix(1:4, ncol = 2), n = 2) + solve_lsap_impl(c = matrix(1:4, ncol = 2), n = 2) Output [1] 0 1 @@ -9511,7 +9528,7 @@ # find_cycle_impl basic Code - find_cycle_impl(g) + find_cycle_impl(graph = g) Output $vertices + 0/3 vertices: @@ -9523,7 +9540,7 @@ --- Code - find_cycle_impl(g, mode = "in") + find_cycle_impl(graph = g, mode = "in") Output $vertices + 0/3 vertices: @@ -9543,7 +9560,7 @@ # simple_cycles_impl basic Code - simple_cycles_impl(g) + simple_cycles_impl(graph = g) Output $vertices list() @@ -9555,7 +9572,8 @@ --- Code - simple_cycles_impl(g, mode = "in", min.cycle.length = 2, max.cycle.length = 3) + simple_cycles_impl(graph = g, mode = "in", min.cycle.length = 2, + max.cycle.length = 3) Output $vertices list() @@ -9575,7 +9593,7 @@ # is_eulerian_impl basic Code - is_eulerian_impl(g) + is_eulerian_impl(graph = g) Output $has_path [1] TRUE @@ -9595,7 +9613,7 @@ # eulerian_path_impl basic Code - eulerian_path_impl(g) + eulerian_path_impl(graph = g) Output $epath + 2/2 edges: @@ -9625,7 +9643,7 @@ --- Code - eulerian_cycle_impl(g2) + eulerian_cycle_impl(graph = g2) Output $epath + 4/4 edges: @@ -9647,14 +9665,14 @@ # fundamental_cycles_impl basic Code - fundamental_cycles_impl(g, start = 1) + fundamental_cycles_impl(graph = g, start = 1) Output list() --- Code - fundamental_cycles_impl(g, start = 1, bfs.cutoff = 2, weights = c(1, 2)) + fundamental_cycles_impl(graph = g, start = 1, bfs.cutoff = 2, weights = c(1, 2)) Output list() @@ -9669,15 +9687,15 @@ # minimum_cycle_basis_impl basic Code - minimum_cycle_basis_impl(g) + minimum_cycle_basis_impl(graph = g) Output list() --- Code - minimum_cycle_basis_impl(g, bfs.cutoff = 2, complete = FALSE, use.cycle.order = FALSE, - weights = c(1, 2)) + minimum_cycle_basis_impl(graph = g, bfs.cutoff = 2, complete = FALSE, + use.cycle.order = FALSE, weights = c(1, 2)) Output list() @@ -9692,14 +9710,14 @@ # is_tree_impl basic Code - is_tree_impl(g) + is_tree_impl(graph = g) Output [1] TRUE --- Code - is_tree_impl(g, mode = "in", details = TRUE) + is_tree_impl(graph = g, mode = "in", details = TRUE) Output $res [1] TRUE @@ -9720,14 +9738,14 @@ # is_forest_impl basic Code - is_forest_impl(g) + is_forest_impl(graph = g) Output [1] TRUE --- Code - is_forest_impl(g, mode = "in", details = TRUE) + is_forest_impl(graph = g, mode = "in", details = TRUE) Output $res [1] TRUE @@ -9748,7 +9766,7 @@ # from_prufer_impl basic Code - from_prufer_impl(1:2) + from_prufer_impl(prufer = 1:2) Output IGRAPH U--- 4 3 -- Tree from Prufer sequence + attr: name (g/c), prufer (g/n) @@ -9768,7 +9786,7 @@ # to_prufer_impl basic Code - to_prufer_impl(g) + to_prufer_impl(graph = g) Output [1] 2 @@ -9783,7 +9801,7 @@ # tree_from_parent_vector_impl basic Code - tree_from_parent_vector_impl(c(-1, 1, 2, 3)) + tree_from_parent_vector_impl(parents = c(-1, 1, 2, 3)) Output IGRAPH D--- 4 3 -- + edges: @@ -9792,7 +9810,7 @@ --- Code - tree_from_parent_vector_impl(c(-1, 1, 2, 3), type = "in") + tree_from_parent_vector_impl(parents = c(-1, 1, 2, 3), type = "in") Output IGRAPH D--- 4 3 -- + edges: @@ -9811,7 +9829,7 @@ # is_complete_impl basic Code - is_complete_impl(g) + is_complete_impl(graph = g) Output [1] FALSE @@ -9826,7 +9844,7 @@ # random_spanning_tree_impl basic Code - random_spanning_tree_impl(g, vid = 1) + random_spanning_tree_impl(graph = g, vid = 1) Output + 2/2 edges: [1] 1--2 2--3 @@ -9842,7 +9860,7 @@ # tree_game_impl basic Code - tree_game_impl(3) + tree_game_impl(n = 3) Output IGRAPH U--- 3 2 -- + edges: @@ -9851,7 +9869,7 @@ --- Code - tree_game_impl(3, directed = TRUE, method = "lerw") + tree_game_impl(n = 3, directed = TRUE, method = "lerw") Output IGRAPH D--- 3 2 -- + edges: @@ -9870,14 +9888,14 @@ # vertex_coloring_greedy_impl basic Code - vertex_coloring_greedy_impl(g) + vertex_coloring_greedy_impl(graph = g) Output [1] 2 1 2 --- Code - vertex_coloring_greedy_impl(g, heuristic = "dsatur") + vertex_coloring_greedy_impl(graph = g, heuristic = "dsatur") Output [1] 2 1 2 @@ -9892,7 +9910,7 @@ # is_vertex_coloring_impl basic Code - is_vertex_coloring_impl(g, types = c(1, 2, 3)) + is_vertex_coloring_impl(graph = g, types = c(1, 2, 3)) Output [1] TRUE @@ -9907,7 +9925,7 @@ # is_bipartite_coloring_impl basic Code - is_bipartite_coloring_impl(g, types = c(TRUE, FALSE, TRUE)) + is_bipartite_coloring_impl(graph = g, types = c(TRUE, FALSE, TRUE)) Output [1] TRUE @@ -9922,14 +9940,14 @@ # is_edge_coloring_impl basic Code - is_edge_coloring_impl(g, types = c(1, 2)) + is_edge_coloring_impl(graph = g, types = c(1, 2)) Output [1] TRUE --- Code - is_edge_coloring_impl(g) + is_edge_coloring_impl(graph = g) Output [1] TRUE @@ -9944,16 +9962,16 @@ # deterministic_optimal_imitation_impl basic Code - deterministic_optimal_imitation_impl(g, 1, quantities = c(1, 2, 3), strategies = c( - 1, 2, 3)) + deterministic_optimal_imitation_impl(graph = g, vid = 1, quantities = c(1, 2, 3), + strategies = c(1, 2, 3)) Output [1] 2 2 3 --- Code - deterministic_optimal_imitation_impl(g, 1, optimality = "minimum", quantities = c( - 1, 2, 3), strategies = c(1, 2, 3), mode = "in") + deterministic_optimal_imitation_impl(graph = g, vid = 1, optimality = "minimum", + quantities = c(1, 2, 3), strategies = c(1, 2, 3), mode = "in") Output [1] 1 2 3 @@ -9968,8 +9986,8 @@ # moran_process_impl basic Code - moran_process_impl(g, weights = c(1, 1), quantities = c(1, 2, 3), strategies = c( - 1, 2, 3), mode = "in") + moran_process_impl(graph = g, weights = c(1, 1), quantities = c(1, 2, 3), + strategies = c(1, 2, 3), mode = "in") Output $quantities [1] 1 3 3 @@ -9989,16 +10007,16 @@ # roulette_wheel_imitation_impl basic Code - roulette_wheel_imitation_impl(g, 1, TRUE, quantities = c(1, 2, 3), strategies = c( - 1, 2, 3)) + roulette_wheel_imitation_impl(graph = g, vid = 1, is.local = TRUE, quantities = c( + 1, 2, 3), strategies = c(1, 2, 3)) Output [1] 1 2 3 --- Code - roulette_wheel_imitation_impl(g, 1, FALSE, quantities = c(1, 2, 3), strategies = c( - 1, 2, 3), mode = "in") + roulette_wheel_imitation_impl(graph = g, vid = 1, is.local = FALSE, quantities = c( + 1, 2, 3), strategies = c(1, 2, 3), mode = "in") Output [1] 3 2 3 @@ -10013,16 +10031,16 @@ # stochastic_imitation_impl basic Code - stochastic_imitation_impl(g, 1, algo = 1, quantities = c(1, 2, 3), strategies = c( - 1, 2, 3)) + stochastic_imitation_impl(graph = g, vid = 1, algo = 1, quantities = c(1, 2, 3), + strategies = c(1, 2, 3)) Output [1] 1 2 3 --- Code - stochastic_imitation_impl(g, 1, algo = 2, quantities = c(1, 2, 3), strategies = c( - 1, 2, 3), mode = "in") + stochastic_imitation_impl(graph = g, vid = 1, algo = 2, quantities = c(1, 2, 3), + strategies = c(1, 2, 3), mode = "in") Output [1] 1 2 3 @@ -10037,7 +10055,7 @@ # invalidate_cache_impl basic Code - invalidate_cache_impl(g) + invalidate_cache_impl(graph = g) Output IGRAPH U--- 3 2 -- + edges: @@ -10054,7 +10072,7 @@ # vertex_path_from_edge_path_impl basic Code - vertex_path_from_edge_path_impl(g, start = 1, edge.path = c(1, 2)) + vertex_path_from_edge_path_impl(graph = g, start = 1, edge.path = c(1, 2)) Output + 3/3 vertices: [1] 1 2 3 @@ -10062,7 +10080,7 @@ --- Code - vertex_path_from_edge_path_impl(g, start = 1, edge.path = c(1), mode = "in") + vertex_path_from_edge_path_impl(graph = g, start = 1, edge.path = c(1), mode = "in") Output + 2/3 vertices: [1] 1 2 diff --git a/tests/testthat/test-aaa-auto.R b/tests/testthat/test-aaa-auto.R index b51a615c7b2..67b1f355ab6 100644 --- a/tests/testthat/test-aaa-auto.R +++ b/tests/testthat/test-aaa-auto.R @@ -4,13 +4,18 @@ test_that("empty_impl basic", { local_igraph_options(print.id = FALSE) expect_snapshot(empty_impl()) - expect_snapshot(empty_impl(5, directed = FALSE)) + expect_snapshot(empty_impl( + n = 5, + directed = FALSE + )) }) test_that("empty_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(empty_impl(-1)) + expect_snapshot_igraph_error(empty_impl( + n = -1 + )) }) # 2. add_edges_impl @@ -18,14 +23,24 @@ test_that("empty_impl errors", { test_that("add_edges_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- empty_impl(3) - expect_snapshot(add_edges_impl(g, c(0, 1, 1, 2))) + g <- empty_impl( + n = 3 + ) + + expect_snapshot(add_edges_impl( + graph = g, + edges = c(0, 1, 1, + 2) + )) }) test_that("add_edges_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(add_edges_impl(NULL, c(1, 2))) + expect_snapshot_igraph_error(add_edges_impl( + graph = NULL, + edges = c(1, 2) + )) }) # 3. copy_impl @@ -33,14 +48,21 @@ test_that("add_edges_impl errors", { test_that("copy_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- empty_impl(2) - expect_snapshot(copy_impl(g)) + g <- empty_impl( + n = 2 + ) + + expect_snapshot(copy_impl( + from = g + )) }) test_that("copy_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(copy_impl(NULL)) + expect_snapshot_igraph_error(copy_impl( + from = NULL + )) }) # 4. delete_vertices_idx_impl @@ -48,14 +70,23 @@ test_that("copy_impl errors", { test_that("delete_vertices_idx_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- empty_impl(3) - expect_snapshot(delete_vertices_idx_impl(g, 1)) + g <- empty_impl( + n = 3 + ) + + expect_snapshot(delete_vertices_idx_impl( + graph = g, + vertices = 1 + )) }) test_that("delete_vertices_idx_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(delete_vertices_idx_impl(NULL, 1)) + expect_snapshot_igraph_error(delete_vertices_idx_impl( + graph = NULL, + vertices = 1 + )) }) # 5. vcount_impl @@ -63,14 +94,21 @@ test_that("delete_vertices_idx_impl errors", { test_that("vcount_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- empty_impl(4) - expect_snapshot(vcount_impl(g)) + g <- empty_impl( + n = 4 + ) + + expect_snapshot(vcount_impl( + graph = g + )) }) test_that("vcount_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(vcount_impl(NULL)) + expect_snapshot_igraph_error(vcount_impl( + graph = NULL + )) }) # 6. degree_impl @@ -78,15 +116,25 @@ test_that("vcount_impl errors", { test_that("degree_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- empty_impl(3) - expect_snapshot(degree_impl(g)) - expect_snapshot(degree_impl(g, mode = "in")) + g <- empty_impl( + n = 3 + ) + + expect_snapshot(degree_impl( + graph = g + )) + expect_snapshot(degree_impl( + graph = g, + mode = "in" + )) }) test_that("degree_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(degree_impl(NULL)) + expect_snapshot_igraph_error(degree_impl( + graph = NULL + )) }) # 7. get_all_eids_between_impl @@ -94,14 +142,25 @@ test_that("degree_impl errors", { test_that("get_all_eids_between_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- empty_impl(2) - expect_snapshot(get_all_eids_between_impl(g, 1, 2)) + g <- empty_impl( + n = 2 + ) + + expect_snapshot(get_all_eids_between_impl( + graph = g, + from = 1, + to = 2 + )) }) test_that("get_all_eids_between_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(get_all_eids_between_impl(NULL, 1, 2)) + expect_snapshot_igraph_error(get_all_eids_between_impl( + graph = NULL, + from = 1, + to = 2 + )) }) # 8. wheel_impl @@ -109,14 +168,22 @@ test_that("get_all_eids_between_impl errors", { test_that("wheel_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(wheel_impl(5)) - expect_snapshot(wheel_impl(5, mode = "in", center = 2)) + expect_snapshot(wheel_impl( + n = 5 + )) + expect_snapshot(wheel_impl( + n = 5, + mode = "in", + center = 2 + )) }) test_that("wheel_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(wheel_impl(-1)) + expect_snapshot_igraph_error(wheel_impl( + n = -1 + )) }) # 9. hypercube_impl @@ -124,14 +191,21 @@ test_that("wheel_impl errors", { test_that("hypercube_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(hypercube_impl(3)) - expect_snapshot(hypercube_impl(3, directed = TRUE)) + expect_snapshot(hypercube_impl( + n = 3 + )) + expect_snapshot(hypercube_impl( + n = 3, + directed = TRUE + )) }) test_that("hypercube_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(hypercube_impl(10000)) + expect_snapshot_igraph_error(hypercube_impl( + n = 10000 + )) }) # 10. square_lattice_impl @@ -139,20 +213,27 @@ test_that("hypercube_impl errors", { test_that("square_lattice_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(square_lattice_impl(c(2, 2))) expect_snapshot(square_lattice_impl( - c(2, 2), + dimvector = c(2, + 2) + )) + expect_snapshot(square_lattice_impl( + dimvector = c(2, + 2), nei = 2, directed = TRUE, mutual = TRUE, - periodic = c(TRUE, TRUE) + periodic = c(TRUE, + TRUE) )) }) test_that("square_lattice_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(square_lattice_impl(-1)) + expect_snapshot_igraph_error(square_lattice_impl( + dimvector = -1 + )) }) # 11. triangular_lattice_impl @@ -160,9 +241,13 @@ test_that("square_lattice_impl errors", { test_that("triangular_lattice_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(triangular_lattice_impl(c(2, 2))) expect_snapshot(triangular_lattice_impl( - c(2, 2), + dimvector = c(2, + 2) + )) + expect_snapshot(triangular_lattice_impl( + dimvector = c(2, + 2), directed = TRUE, mutual = TRUE )) @@ -171,7 +256,9 @@ test_that("triangular_lattice_impl basic", { test_that("triangular_lattice_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(triangular_lattice_impl(-1)) + expect_snapshot_igraph_error(triangular_lattice_impl( + dimvector = -1 + )) }) # 12. path_graph_impl @@ -179,14 +266,22 @@ test_that("triangular_lattice_impl errors", { test_that("path_graph_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(path_graph_impl(5)) - expect_snapshot(path_graph_impl(5, directed = TRUE, mutual = TRUE)) + expect_snapshot(path_graph_impl( + n = 5 + )) + expect_snapshot(path_graph_impl( + n = 5, + directed = TRUE, + mutual = TRUE + )) }) test_that("path_graph_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(path_graph_impl(-1)) + expect_snapshot_igraph_error(path_graph_impl( + n = -1 + )) }) # 13. cycle_graph_impl @@ -194,14 +289,22 @@ test_that("path_graph_impl errors", { test_that("cycle_graph_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(cycle_graph_impl(5)) - expect_snapshot(cycle_graph_impl(5, directed = TRUE, mutual = TRUE)) + expect_snapshot(cycle_graph_impl( + n = 5 + )) + expect_snapshot(cycle_graph_impl( + n = 5, + directed = TRUE, + mutual = TRUE + )) }) test_that("cycle_graph_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(cycle_graph_impl(-1)) + expect_snapshot_igraph_error(cycle_graph_impl( + n = -1 + )) }) # 14. symmetric_tree_impl @@ -209,14 +312,21 @@ test_that("cycle_graph_impl errors", { test_that("symmetric_tree_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(symmetric_tree_impl(3)) - expect_snapshot(symmetric_tree_impl(3, type = "in")) + expect_snapshot(symmetric_tree_impl( + branches = 3 + )) + expect_snapshot(symmetric_tree_impl( + branches = 3, + type = "in" + )) }) test_that("symmetric_tree_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(symmetric_tree_impl(-1)) + expect_snapshot_igraph_error(symmetric_tree_impl( + branches = -1 + )) }) # 15. regular_tree_impl @@ -224,14 +334,22 @@ test_that("symmetric_tree_impl errors", { test_that("regular_tree_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(regular_tree_impl(2)) - expect_snapshot(regular_tree_impl(2, k = 4, type = "in")) + expect_snapshot(regular_tree_impl( + h = 2 + )) + expect_snapshot(regular_tree_impl( + h = 2, + k = 4, + type = "in" + )) }) test_that("regular_tree_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(regular_tree_impl(-1)) + expect_snapshot_igraph_error(regular_tree_impl( + h = -1 + )) }) # 16. full_citation_impl @@ -239,14 +357,21 @@ test_that("regular_tree_impl errors", { test_that("full_citation_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(full_citation_impl(5)) - expect_snapshot(full_citation_impl(5, directed = FALSE)) + expect_snapshot(full_citation_impl( + n = 5 + )) + expect_snapshot(full_citation_impl( + n = 5, + directed = FALSE + )) }) test_that("full_citation_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(full_citation_impl(-1)) + expect_snapshot_igraph_error(full_citation_impl( + n = -1 + )) }) # 17. atlas_impl @@ -254,14 +379,20 @@ test_that("full_citation_impl errors", { test_that("atlas_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(atlas_impl(0)) - expect_snapshot(atlas_impl(5)) + expect_snapshot(atlas_impl( + number = 0 + )) + expect_snapshot(atlas_impl( + number = 5 + )) }) test_that("atlas_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(atlas_impl(-1)) + expect_snapshot_igraph_error(atlas_impl( + number = -1 + )) }) # 18. extended_chordal_ring_impl @@ -269,10 +400,13 @@ test_that("atlas_impl errors", { test_that("extended_chordal_ring_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(extended_chordal_ring_impl(5, matrix(c(1, 2)))) expect_snapshot(extended_chordal_ring_impl( - 5, - matrix(c(1, 2)), + nodes = 5, + W = matrix(c(1, 2)) + )) + expect_snapshot(extended_chordal_ring_impl( + nodes = 5, + W = matrix(c(1, 2)), directed = TRUE )) }) @@ -280,7 +414,10 @@ test_that("extended_chordal_ring_impl basic", { test_that("extended_chordal_ring_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(extended_chordal_ring_impl(-1, matrix(c(1, 2)))) + expect_snapshot_igraph_error(extended_chordal_ring_impl( + nodes = -1, + W = matrix(c(1, 2)) + )) }) # 19. graph_power_impl @@ -288,15 +425,28 @@ test_that("extended_chordal_ring_impl errors", { test_that("graph_power_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(5) - expect_snapshot(graph_power_impl(g, 2)) - expect_snapshot(graph_power_impl(g, 2, directed = TRUE)) + g <- path_graph_impl( + n = 5 + ) + + expect_snapshot(graph_power_impl( + graph = g, + order = 2 + )) + expect_snapshot(graph_power_impl( + graph = g, + order = 2, + directed = TRUE + )) }) test_that("graph_power_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(graph_power_impl(NULL, 2)) + expect_snapshot_igraph_error(graph_power_impl( + graph = NULL, + order = 2 + )) }) # 20. linegraph_impl @@ -304,62 +454,95 @@ test_that("graph_power_impl errors", { test_that("linegraph_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(5) - expect_snapshot(linegraph_impl(g)) + g <- path_graph_impl( + n = 5 + ) + + expect_snapshot(linegraph_impl( + graph = g + )) }) test_that("linegraph_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(linegraph_impl(NULL)) + expect_snapshot_igraph_error(linegraph_impl( + graph = NULL + )) }) # 21. de_bruijn_impl test_that("de_bruijn_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(de_bruijn_impl(2, 3)) + expect_snapshot(de_bruijn_impl( + m = 2, + n = 3 + )) }) test_that("de_bruijn_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(de_bruijn_impl(-1, 3)) + expect_snapshot_igraph_error(de_bruijn_impl( + m = -1, + n = 3 + )) }) # 22. kautz_impl test_that("kautz_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(kautz_impl(2, 3)) + expect_snapshot(kautz_impl( + m = 2, + n = 3 + )) }) test_that("kautz_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(kautz_impl(-1, 3)) + expect_snapshot_igraph_error(kautz_impl( + m = -1, + n = 3 + )) }) # 23. lcf_vector_impl test_that("lcf_vector_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(lcf_vector_impl(10, c(3, -3, 4), 2)) + expect_snapshot(lcf_vector_impl( + n = 10, + shifts = c(3, -3, + 4), + repeats = 2 + )) }) test_that("lcf_vector_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(lcf_vector_impl(-1, c(3, -3, 4), 2)) + expect_snapshot_igraph_error(lcf_vector_impl( + n = -1, + shifts = c(3, -3, + 4), + repeats = 2 + )) }) # 24. mycielski_graph_impl test_that("mycielski_graph_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(mycielski_graph_impl(3)) + expect_snapshot(mycielski_graph_impl( + k = 3 + )) }) test_that("mycielski_graph_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(mycielski_graph_impl(-1)) + expect_snapshot_igraph_error(mycielski_graph_impl( + k = -1 + )) }) # 25. adjlist_impl @@ -367,35 +550,61 @@ test_that("adjlist_impl basic", { skip_if(Sys.getenv("R_SANITIZER") == "true") withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(adjlist_impl(list(c(2, 3), c(1), c(1)), mode = "out")) + expect_snapshot(adjlist_impl( + adjlist = list( + c(2, + 3), + c(1), + c(1) + ), + mode = "out" + )) }) test_that("adjlist_impl errors", { skip_if(Sys.getenv("R_SANITIZER") == "true") withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(adjlist_impl(-1, mode = "out")) + expect_snapshot_igraph_error(adjlist_impl( + adjlist = -1, + mode = "out" + )) }) # 26. full_bipartite_impl test_that("full_bipartite_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(full_bipartite_impl(2, 3)) - expect_snapshot(full_bipartite_impl(2, 3, directed = TRUE, mode = "in")) + expect_snapshot(full_bipartite_impl( + n1 = 2, + n2 = 3 + )) + expect_snapshot(full_bipartite_impl( + n1 = 2, + n2 = 3, + directed = TRUE, + mode = "in" + )) }) test_that("full_bipartite_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(full_bipartite_impl(-1, 3)) + expect_snapshot_igraph_error(full_bipartite_impl( + n1 = -1, + n2 = 3 + )) }) # 27. full_multipartite_impl test_that("full_multipartite_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(full_multipartite_impl(c(2, 3, 4))) expect_snapshot(full_multipartite_impl( - c(2, 3, 4), + n = c(2, + 3, 4) + )) + expect_snapshot(full_multipartite_impl( + n = c(2, + 3, 4), directed = TRUE, mode = "in" )) @@ -403,17 +612,24 @@ test_that("full_multipartite_impl basic", { test_that("full_multipartite_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(full_multipartite_impl(-1)) + expect_snapshot_igraph_error(full_multipartite_impl( + n = -1 + )) }) # 28. realize_degree_sequence_impl test_that("realize_degree_sequence_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(realize_degree_sequence_impl(c(2, 2, 2))) expect_snapshot(realize_degree_sequence_impl( - c(2, 2, 2), - c(2, 2, 2), + out.deg = c(2, + 2, 2) + )) + expect_snapshot(realize_degree_sequence_impl( + out.deg = c(2, + 2, 2), + in.deg = c(2, + 2, 2), allowed.edge.types = "simple", method = "largest" )) @@ -421,17 +637,26 @@ test_that("realize_degree_sequence_impl basic", { test_that("realize_degree_sequence_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(realize_degree_sequence_impl(-1)) + expect_snapshot_igraph_error(realize_degree_sequence_impl( + out.deg = -1 + )) }) # 29. realize_bipartite_degree_sequence_impl test_that("realize_bipartite_degree_sequence_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(realize_bipartite_degree_sequence_impl(c(2, 2), c(2, 2))) expect_snapshot(realize_bipartite_degree_sequence_impl( - c(2, 2), - c(2, 2), + degrees1 = c(2, + 2), + degrees2 = c(2, + 2) + )) + expect_snapshot(realize_bipartite_degree_sequence_impl( + degrees1 = c(2, + 2), + degrees2 = c(2, + 2), allowed.edge.types = "loops", method = "largest" )) @@ -440,7 +665,10 @@ test_that("realize_bipartite_degree_sequence_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - realize_bipartite_degree_sequence_impl(-1, c(2, 2)) + realize_bipartite_degree_sequence_impl( + degrees1 = -1, + degrees2 = c(2, 2) + ) ) }) @@ -448,47 +676,72 @@ test_that("realize_bipartite_degree_sequence_impl errors", { test_that("circulant_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(circulant_impl(5, c(1, 2))) - expect_snapshot(circulant_impl(5, c(1, 2), directed = TRUE)) + expect_snapshot(circulant_impl( + n = 5, + shifts = c(1, 2) + )) + expect_snapshot(circulant_impl( + n = 5, + shifts = c(1, 2), + directed = TRUE + )) }) test_that("circulant_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(circulant_impl(-1, c(1, 2))) + expect_snapshot_igraph_error(circulant_impl( + n = -1, + shifts = c(1, 2) + )) }) # 31. generalized_petersen_impl test_that("generalized_petersen_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(generalized_petersen_impl(5, 2)) + expect_snapshot(generalized_petersen_impl( + n = 5, + k = 2 + )) }) test_that("generalized_petersen_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(generalized_petersen_impl(-1, 2)) + expect_snapshot_igraph_error(generalized_petersen_impl( + n = -1, + k = 2 + )) }) # 32. turan_impl test_that("turan_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(turan_impl(5, 2)) + expect_snapshot(turan_impl( + n = 5, + r = 2 + )) }) test_that("turan_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(turan_impl(-1, 2)) + expect_snapshot_igraph_error(turan_impl( + n = -1, + r = 2 + )) }) # 33. erdos_renyi_game_gnp_impl test_that("erdos_renyi_game_gnp_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(erdos_renyi_game_gnp_impl(5, 0.5)) expect_snapshot(erdos_renyi_game_gnp_impl( - 5, - 0.5, + n = 5, + p = 0.5 + )) + expect_snapshot(erdos_renyi_game_gnp_impl( + n = 5, + p = 0.5, directed = TRUE, loops = TRUE )) @@ -496,17 +749,23 @@ test_that("erdos_renyi_game_gnp_impl basic", { test_that("erdos_renyi_game_gnp_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(erdos_renyi_game_gnp_impl(-1, 0.5)) + expect_snapshot_igraph_error(erdos_renyi_game_gnp_impl( + n = -1, + p = 0.5 + )) }) # 34. erdos_renyi_game_gnm_impl test_that("erdos_renyi_game_gnm_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(erdos_renyi_game_gnm_impl(5, 3)) expect_snapshot(erdos_renyi_game_gnm_impl( - 5, - 3, + n = 5, + m = 3 + )) + expect_snapshot(erdos_renyi_game_gnm_impl( + n = 5, + m = 3, directed = TRUE, loops = TRUE )) @@ -514,17 +773,23 @@ test_that("erdos_renyi_game_gnm_impl basic", { test_that("erdos_renyi_game_gnm_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(erdos_renyi_game_gnm_impl(-1, 3)) + expect_snapshot_igraph_error(erdos_renyi_game_gnm_impl( + n = -1, + m = 3 + )) }) # 35. growing_random_game_impl test_that("growing_random_game_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(growing_random_game_impl(5, 2)) expect_snapshot(growing_random_game_impl( - 5, - 2, + n = 5, + m = 2 + )) + expect_snapshot(growing_random_game_impl( + n = 5, + m = 2, directed = FALSE, citation = TRUE )) @@ -532,7 +797,10 @@ test_that("growing_random_game_impl basic", { test_that("growing_random_game_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(growing_random_game_impl(-1, 2)) + expect_snapshot_igraph_error(growing_random_game_impl( + n = -1, + m = 2 + )) }) # 36. preference_game_impl @@ -540,11 +808,14 @@ test_that("preference_game_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) expect_snapshot(preference_game_impl( - 5, - 2, - c(0.5, 0.5), - FALSE, - matrix(c(0.5, 0.5, 0.5, 0.5), 2, 2) + nodes = 5, + types = 2, + type.dist = c(0.5, + 0.5), + fixed.sizes = FALSE, + pref.matrix = matrix(c(0.5, + 0.5, 0.5, 0.5), + 2, 2) )) }) test_that("preference_game_impl errors", { @@ -552,11 +823,14 @@ test_that("preference_game_impl errors", { local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( preference_game_impl( - -1, - 2, - c(0.5, 0.5), - FALSE, - matrix(c(0.5, 0.5, 0.5, 0.5), 2, 2) + nodes = -1, + types = 2, + type.dist = c(0.5, + 0.5), + fixed.sizes = FALSE, + pref.matrix = matrix(c(0.5, + 0.5, 0.5, 0.5), + 2, 2) ) ) }) @@ -566,11 +840,15 @@ test_that("asymmetric_preference_game_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) expect_snapshot(asymmetric_preference_game_impl( - 5, - 2, - 2, - matrix(c(0.5, 0.5, 0.5, 0.5), 2, 2), - matrix(c(0.5, 0.5, 0.5, 0.5), 2, 2) + nodes = 5, + out.types = 2, + in.types = 2, + type.dist.matrix = matrix(c(0.5, + 0.5, 0.5, 0.5), + 2, 2), + pref.matrix = matrix(c(0.5, + 0.5, 0.5, 0.5), + 2, 2) )) }) test_that("asymmetric_preference_game_impl errors", { @@ -578,11 +856,15 @@ test_that("asymmetric_preference_game_impl errors", { local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( asymmetric_preference_game_impl( - -1, - 2, - 2, - matrix(c(0.5, 0.5, 0.5, 0.5), 2, 2), - matrix(c(0.5, 0.5, 0.5, 0.5), 2, 2) + nodes = -1, + out.types = 2, + in.types = 2, + type.dist.matrix = matrix(c(0.5, + 0.5, 0.5, 0.5), + 2, 2), + pref.matrix = matrix(c(0.5, + 0.5, 0.5, 0.5), + 2, 2) ) ) }) @@ -591,36 +873,58 @@ test_that("asymmetric_preference_game_impl errors", { test_that("rewire_edges_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(5) - expect_snapshot(rewire_edges_impl(g, 0.5)) + g <- path_graph_impl( + n = 5 + ) + + expect_snapshot(rewire_edges_impl( + graph = g, + prob = 0.5 + )) }) test_that("rewire_edges_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(rewire_edges_impl(NULL, 0.5)) + expect_snapshot_igraph_error(rewire_edges_impl( + graph = NULL, + prob = 0.5 + )) }) # 39. rewire_directed_edges_impl test_that("rewire_directed_edges_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(5, directed = TRUE) - expect_snapshot(rewire_directed_edges_impl(g, 0.5)) + g <- path_graph_impl( + n = 5, + directed = TRUE + ) + + expect_snapshot(rewire_directed_edges_impl( + graph = g, + prob = 0.5 + )) }) test_that("rewire_directed_edges_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(rewire_directed_edges_impl(NULL, 0.5)) + expect_snapshot_igraph_error(rewire_directed_edges_impl( + graph = NULL, + prob = 0.5 + )) }) # 40. forest_fire_game_impl test_that("forest_fire_game_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(forest_fire_game_impl(5, 0.5)) expect_snapshot(forest_fire_game_impl( - 5, - 0.5, + nodes = 5, + fw.prob = 0.5 + )) + expect_snapshot(forest_fire_game_impl( + nodes = 5, + fw.prob = 0.5, bw.factor = 0.2, ambs = 2, directed = FALSE @@ -629,20 +933,33 @@ test_that("forest_fire_game_impl basic", { test_that("forest_fire_game_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(forest_fire_game_impl(-1, 0.5)) + expect_snapshot_igraph_error(forest_fire_game_impl( + nodes = -1, + fw.prob = 0.5 + )) }) # 41. simple_interconnected_islands_game_impl test_that("simple_interconnected_islands_game_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(simple_interconnected_islands_game_impl(2, 3, 0.5, 1)) + expect_snapshot(simple_interconnected_islands_game_impl( + islands.n = 2, + islands.size = 3, + islands.pin = 0.5, + n.inter = 1 + )) }) test_that("simple_interconnected_islands_game_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - simple_interconnected_islands_game_impl(-1, 3, 0.5, 1) + simple_interconnected_islands_game_impl( + islands.n = -1, + islands.size = 3, + islands.pin = 0.5, + n.inter = 1 + ) ) }) @@ -650,10 +967,15 @@ test_that("simple_interconnected_islands_game_impl errors", { test_that("chung_lu_game_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(chung_lu_game_impl(c(2, 2, 2))) expect_snapshot(chung_lu_game_impl( - c(1, 2, 3), - c(1, 2, 3), + out.weights = c(2, + 2, 2) + )) + expect_snapshot(chung_lu_game_impl( + out.weights = c(1, + 2, 3), + in.weights = c(1, + 2, 3), loops = FALSE, variant = "maxent" )) @@ -661,18 +983,26 @@ test_that("chung_lu_game_impl basic", { test_that("chung_lu_game_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(chung_lu_game_impl(-1)) + expect_snapshot_igraph_error(chung_lu_game_impl( + out.weights = -1 + )) }) # 43. static_fitness_game_impl test_that("static_fitness_game_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(static_fitness_game_impl(3, c(1, 2, 3))) expect_snapshot(static_fitness_game_impl( - 3, - c(1, 2, 3), - c(1, 2, 3), + no.of.edges = 3, + fitness.out = c(1, + 2, 3) + )) + expect_snapshot(static_fitness_game_impl( + no.of.edges = 3, + fitness.out = c(1, + 2, 3), + fitness.in = c(1, + 2, 3), loops = TRUE, multiple = TRUE )) @@ -680,18 +1010,26 @@ test_that("static_fitness_game_impl basic", { test_that("static_fitness_game_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(static_fitness_game_impl(-1, c(1, 2, 3))) + expect_snapshot_igraph_error(static_fitness_game_impl( + no.of.edges = -1, + fitness.out = c(1, + 2, 3) + )) }) # 44. static_power_law_game_impl test_that("static_power_law_game_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(static_power_law_game_impl(5, 4, 2.5)) expect_snapshot(static_power_law_game_impl( - 5, - 4, - 2.5, + no.of.nodes = 5, + no.of.edges = 4, + exponent.out = 2.5 + )) + expect_snapshot(static_power_law_game_impl( + no.of.nodes = 5, + no.of.edges = 4, + exponent.out = 2.5, exponent.in = 2, loops = TRUE, multiple = TRUE, @@ -701,7 +1039,11 @@ test_that("static_power_law_game_impl basic", { test_that("static_power_law_game_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(static_power_law_game_impl(-1, 4, 2.5)) + expect_snapshot_igraph_error(static_power_law_game_impl( + no.of.nodes = -1, + no.of.edges = 4, + exponent.out = 2.5 + )) }) # 45. k_regular_game_impl @@ -709,14 +1051,25 @@ test_that("static_power_law_game_impl errors", { test_that("k_regular_game_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(k_regular_game_impl(5, 2)) - expect_snapshot(k_regular_game_impl(5, 2, directed = TRUE, multiple = TRUE)) + expect_snapshot(k_regular_game_impl( + no.of.nodes = 5, + k = 2 + )) + expect_snapshot(k_regular_game_impl( + no.of.nodes = 5, + k = 2, + directed = TRUE, + multiple = TRUE + )) }) test_that("k_regular_game_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(k_regular_game_impl(-1, 2)) + expect_snapshot_igraph_error(k_regular_game_impl( + no.of.nodes = -1, + k = 2 + )) }) # 46. sbm_game_impl @@ -724,11 +1077,19 @@ test_that("k_regular_game_impl errors", { test_that("sbm_game_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(sbm_game_impl(5, matrix(0.5, 2, 2), c(2, 3))) expect_snapshot(sbm_game_impl( - 5, - matrix(0.5, 2, 2), - c(2, 3), + n = 5, + pref.matrix = matrix(0.5, + 2, 2), + block.sizes = c(2, + 3) + )) + expect_snapshot(sbm_game_impl( + n = 5, + pref.matrix = matrix(0.5, + 2, 2), + block.sizes = c(2, + 3), directed = TRUE, loops = TRUE )) @@ -737,7 +1098,13 @@ test_that("sbm_game_impl basic", { test_that("sbm_game_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(sbm_game_impl(-1, matrix(0.5, 2, 2), c(2, 3))) + expect_snapshot_igraph_error(sbm_game_impl( + n = -1, + pref.matrix = matrix(0.5, + 2, 2), + block.sizes = c(2, + 3) + )) }) # 47. hsbm_game_impl @@ -745,14 +1112,29 @@ test_that("sbm_game_impl errors", { test_that("hsbm_game_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(hsbm_game_impl(6, 2, c(0.5, 0.5), matrix(1, 2, 2), 0.5)) + expect_snapshot(hsbm_game_impl( + n = 6, + m = 2, + rho = c(0.5, + 0.5), + C = matrix(1, + 2, 2), + p = 0.5 + )) }) test_that("hsbm_game_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - hsbm_game_impl(-1, 2, 0.5, matrix(1, 2, 2), 0.5) + hsbm_game_impl( + n = -1, + m = 2, + rho = 0.5, + C = matrix(1, 2, + 2), + p = 0.5 + ) ) }) @@ -776,10 +1158,14 @@ test_that("hsbm_list_game_impl basic", { nrow = 3 ) expect_snapshot(hsbm_list_game_impl( - 100, - list(50, 50), - rho = list(c(3, 3, 4) / 10), - C = list(C), + n = 100, + mlist = list(50, 50), + rholist = list( + c(3, + 3, 4) / + 10 + ), + Clist = list(C), p = 1 / 20 )) }) @@ -789,11 +1175,16 @@ test_that("hsbm_list_game_impl errors", { local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( hsbm_list_game_impl( - -1, - c(2, 3), - list(0.5, 0.5), - list(matrix(1, 2, 2), matrix(1, 2, 2)), - 0.5 + n = -1, + mlist = c(2, 3), + rholist = list(0.5, 0.5), + Clist = list( + matrix(1, + 2, 2), + matrix(1, + 2, 2) + ), + p = 0.5 ) ) }) @@ -803,14 +1194,23 @@ test_that("hsbm_list_game_impl errors", { test_that("correlated_game_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(5) - expect_snapshot(correlated_game_impl(g, 0.5)) + g <- path_graph_impl( + n = 5 + ) + + expect_snapshot(correlated_game_impl( + old.graph = g, + corr = 0.5 + )) }) test_that("correlated_game_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(correlated_game_impl(NULL, 0.5)) + expect_snapshot_igraph_error(correlated_game_impl( + old.graph = NULL, + corr = 0.5 + )) }) # 50. correlated_pair_game_impl @@ -818,14 +1218,27 @@ test_that("correlated_game_impl errors", { test_that("correlated_pair_game_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(correlated_pair_game_impl(5, 0.5, 0.5)) - expect_snapshot(correlated_pair_game_impl(5, 0.5, 0.5, directed = TRUE)) + expect_snapshot(correlated_pair_game_impl( + n = 5, + corr = 0.5, + p = 0.5 + )) + expect_snapshot(correlated_pair_game_impl( + n = 5, + corr = 0.5, + p = 0.5, + directed = TRUE + )) }) test_that("correlated_pair_game_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(correlated_pair_game_impl(-1, 0.5, 0.5)) + expect_snapshot_igraph_error(correlated_pair_game_impl( + n = -1, + corr = 0.5, + p = 0.5 + )) }) # 51. dot_product_game_impl @@ -833,14 +1246,23 @@ test_that("correlated_pair_game_impl errors", { test_that("dot_product_game_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(dot_product_game_impl(matrix(0.5, 5, 2))) - expect_snapshot(dot_product_game_impl(matrix(0.5, 5, 2), directed = TRUE)) + expect_snapshot(dot_product_game_impl( + vecs = matrix(0.5, + 5, 2) + )) + expect_snapshot(dot_product_game_impl( + vecs = matrix(0.5, + 5, 2), + directed = TRUE + )) }) test_that("dot_product_game_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(dot_product_game_impl(NULL)) + expect_snapshot_igraph_error(dot_product_game_impl( + vecs = NULL + )) }) # 52. sample_sphere_surface_impl @@ -848,10 +1270,13 @@ test_that("dot_product_game_impl errors", { test_that("sample_sphere_surface_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(sample_sphere_surface_impl(3, 5)) expect_snapshot(sample_sphere_surface_impl( - 3, - 5, + dim = 3, + n = 5 + )) + expect_snapshot(sample_sphere_surface_impl( + dim = 3, + n = 5, radius = 2, positive = FALSE )) @@ -860,7 +1285,10 @@ test_that("sample_sphere_surface_impl basic", { test_that("sample_sphere_surface_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(sample_sphere_surface_impl(-1, 5)) + expect_snapshot_igraph_error(sample_sphere_surface_impl( + dim = -1, + n = 5 + )) }) # 53. sample_sphere_volume_impl @@ -868,14 +1296,25 @@ test_that("sample_sphere_surface_impl errors", { test_that("sample_sphere_volume_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(sample_sphere_volume_impl(3, 5)) - expect_snapshot(sample_sphere_volume_impl(3, 5, radius = 2, positive = FALSE)) + expect_snapshot(sample_sphere_volume_impl( + dim = 3, + n = 5 + )) + expect_snapshot(sample_sphere_volume_impl( + dim = 3, + n = 5, + radius = 2, + positive = FALSE + )) }) test_that("sample_sphere_volume_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(sample_sphere_volume_impl(-1, 5)) + expect_snapshot_igraph_error(sample_sphere_volume_impl( + dim = -1, + n = 5 + )) }) # 54. sample_dirichlet_impl @@ -883,13 +1322,19 @@ test_that("sample_sphere_volume_impl errors", { test_that("sample_dirichlet_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(sample_dirichlet_impl(5, c(1, 1, 1))) + expect_snapshot(sample_dirichlet_impl( + n = 5, + alpha = c(1, 1, 1) + )) }) test_that("sample_dirichlet_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(sample_dirichlet_impl(-1, c(1, 1, 1))) + expect_snapshot_igraph_error(sample_dirichlet_impl( + n = -1, + alpha = c(1, 1, 1) + )) }) # 55. are_adjacent_impl @@ -897,14 +1342,25 @@ test_that("sample_dirichlet_impl errors", { test_that("are_adjacent_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(are_adjacent_impl(g, 1, 2)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(are_adjacent_impl( + graph = g, + v1 = 1, + v2 = 2 + )) }) test_that("are_adjacent_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(are_adjacent_impl(NULL, 1, 2)) + expect_snapshot_igraph_error(are_adjacent_impl( + graph = NULL, + v1 = 1, + v2 = 2 + )) }) # 56. closeness_impl @@ -912,15 +1368,26 @@ test_that("are_adjacent_impl errors", { test_that("closeness_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(closeness_impl(g)) - expect_snapshot(closeness_impl(g, mode = "in", normalized = TRUE)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(closeness_impl( + graph = g + )) + expect_snapshot(closeness_impl( + graph = g, + mode = "in", + normalized = TRUE + )) }) test_that("closeness_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(closeness_impl(NULL)) + expect_snapshot_igraph_error(closeness_impl( + graph = NULL + )) }) # 57. closeness_cutoff_impl @@ -928,10 +1395,16 @@ test_that("closeness_impl errors", { test_that("closeness_cutoff_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(closeness_cutoff_impl(g, cutoff = 2)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(closeness_cutoff_impl( + graph = g, + cutoff = 2 + )) expect_snapshot(closeness_cutoff_impl( - g, + graph = g, mode = "in", normalized = TRUE, cutoff = 1 @@ -941,7 +1414,9 @@ test_that("closeness_cutoff_impl basic", { test_that("closeness_cutoff_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(closeness_cutoff_impl(NULL)) + expect_snapshot_igraph_error(closeness_cutoff_impl( + graph = NULL + )) }) # 58. get_shortest_path_impl @@ -949,14 +1424,25 @@ test_that("closeness_cutoff_impl errors", { test_that("get_shortest_path_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(get_shortest_path_impl(g, 1, 3)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(get_shortest_path_impl( + graph = g, + from = 1, + to = 3 + )) }) test_that("get_shortest_path_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(get_shortest_path_impl(NULL, 1, 3)) + expect_snapshot_igraph_error(get_shortest_path_impl( + graph = NULL, + from = 1, + to = 3 + )) }) # 59. get_shortest_path_bellman_ford_impl @@ -964,14 +1450,25 @@ test_that("get_shortest_path_impl errors", { test_that("get_shortest_path_bellman_ford_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(get_shortest_path_bellman_ford_impl(g, 1, 3)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(get_shortest_path_bellman_ford_impl( + graph = g, + from = 1, + to = 3 + )) }) test_that("get_shortest_path_bellman_ford_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(get_shortest_path_bellman_ford_impl(NULL, 1, 3)) + expect_snapshot_igraph_error(get_shortest_path_bellman_ford_impl( + graph = NULL, + from = 1, + to = 3 + )) }) # 60. get_shortest_path_dijkstra_impl @@ -979,14 +1476,25 @@ test_that("get_shortest_path_bellman_ford_impl errors", { test_that("get_shortest_path_dijkstra_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(get_shortest_path_dijkstra_impl(g, 1, 3)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(get_shortest_path_dijkstra_impl( + graph = g, + from = 1, + to = 3 + )) }) test_that("get_shortest_path_dijkstra_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(get_shortest_path_dijkstra_impl(NULL, 1, 3)) + expect_snapshot_igraph_error(get_shortest_path_dijkstra_impl( + graph = NULL, + from = 1, + to = 3 + )) }) # 61. get_all_shortest_paths_impl @@ -994,14 +1502,25 @@ test_that("get_shortest_path_dijkstra_impl errors", { test_that("get_all_shortest_paths_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(get_all_shortest_paths_impl(g, 1, 3)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(get_all_shortest_paths_impl( + graph = g, + from = 1, + to = 3 + )) }) test_that("get_all_shortest_paths_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(get_all_shortest_paths_impl(NULL, 1, 3)) + expect_snapshot_igraph_error(get_all_shortest_paths_impl( + graph = NULL, + from = 1, + to = 3 + )) }) # 62. get_all_shortest_paths_dijkstra_impl @@ -1009,15 +1528,26 @@ test_that("get_all_shortest_paths_impl errors", { test_that("get_all_shortest_paths_dijkstra_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(get_all_shortest_paths_dijkstra_impl(g, 1, 3)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(get_all_shortest_paths_dijkstra_impl( + graph = g, + from = 1, + to = 3 + )) }) test_that("get_all_shortest_paths_dijkstra_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - get_all_shortest_paths_dijkstra_impl(NULL, 1, 3) + get_all_shortest_paths_dijkstra_impl( + graph = NULL, + from = 1, + to = 3 + ) ) }) @@ -1026,15 +1556,29 @@ test_that("get_all_shortest_paths_dijkstra_impl errors", { test_that("voronoi_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(voronoi_impl(g, 1)) - expect_snapshot(voronoi_impl(g, 1, mode = "in", tiebreaker = "first")) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(voronoi_impl( + graph = g, + generators = 1 + )) + expect_snapshot(voronoi_impl( + graph = g, + generators = 1, + mode = "in", + tiebreaker = "first" + )) }) test_that("voronoi_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(voronoi_impl(NULL, 1)) + expect_snapshot_igraph_error(voronoi_impl( + graph = NULL, + generators = 1 + )) }) # 64. get_all_simple_paths_impl @@ -1042,14 +1586,25 @@ test_that("voronoi_impl errors", { test_that("get_all_simple_paths_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(get_all_simple_paths_impl(g, 1, 3)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(get_all_simple_paths_impl( + graph = g, + from = 1, + to = 3 + )) }) test_that("get_all_simple_paths_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(get_all_simple_paths_impl(NULL, 1, 3)) + expect_snapshot_igraph_error(get_all_simple_paths_impl( + graph = NULL, + from = 1, + to = 3 + )) }) # 65. get_k_shortest_paths_impl @@ -1057,14 +1612,27 @@ test_that("get_all_simple_paths_impl errors", { test_that("get_k_shortest_paths_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(get_k_shortest_paths_impl(g, 1, 3, k = 2)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(get_k_shortest_paths_impl( + graph = g, + from = 1, + to = 3, + k = 2 + )) }) test_that("get_k_shortest_paths_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(get_k_shortest_paths_impl(NULL, 1, 3, k = 2)) + expect_snapshot_igraph_error(get_k_shortest_paths_impl( + graph = NULL, + from = 1, + to = 3, + k = 2 + )) }) # 66. get_widest_path_impl @@ -1072,14 +1640,26 @@ test_that("get_k_shortest_paths_impl errors", { test_that("get_widest_path_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(get_widest_path_impl(g, 1, 3, weights = c(1, 2))) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(get_widest_path_impl( + graph = g, + from = 1, + to = 3, + weights = c(1, 2) + )) }) test_that("get_widest_path_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(get_widest_path_impl(NULL, 1, 3)) + expect_snapshot_igraph_error(get_widest_path_impl( + graph = NULL, + from = 1, + to = 3 + )) }) # 67. get_widest_paths_impl @@ -1087,14 +1667,26 @@ test_that("get_widest_path_impl errors", { test_that("get_widest_paths_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(get_widest_paths_impl(g, 1, 3, weights = c(1, 2))) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(get_widest_paths_impl( + graph = g, + from = 1, + to = 3, + weights = c(1, 2) + )) }) test_that("get_widest_paths_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(get_widest_paths_impl(NULL, 1, 3)) + expect_snapshot_igraph_error(get_widest_paths_impl( + graph = NULL, + from = 1, + to = 3 + )) }) # 70. spanner_impl @@ -1102,14 +1694,23 @@ test_that("get_widest_paths_impl errors", { test_that("spanner_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(spanner_impl(g, 2)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(spanner_impl( + graph = g, + stretch = 2 + )) }) test_that("spanner_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(spanner_impl(NULL, 2)) + expect_snapshot_igraph_error(spanner_impl( + graph = NULL, + stretch = 2 + )) }) # 71. betweenness_cutoff_impl @@ -1117,14 +1718,23 @@ test_that("spanner_impl errors", { test_that("betweenness_cutoff_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(betweenness_cutoff_impl(g, cutoff = 2)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(betweenness_cutoff_impl( + graph = g, + cutoff = 2 + )) }) test_that("betweenness_cutoff_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(betweenness_cutoff_impl(NULL, cutoff = 2)) + expect_snapshot_igraph_error(betweenness_cutoff_impl( + graph = NULL, + cutoff = 2 + )) }) # 72. betweenness_subset_impl @@ -1132,14 +1742,21 @@ test_that("betweenness_cutoff_impl errors", { test_that("betweenness_subset_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(betweenness_subset_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(betweenness_subset_impl( + graph = g + )) }) test_that("betweenness_subset_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(betweenness_subset_impl(NULL)) + expect_snapshot_igraph_error(betweenness_subset_impl( + graph = NULL + )) }) # 73. edge_betweenness_impl @@ -1147,14 +1764,21 @@ test_that("betweenness_subset_impl errors", { test_that("edge_betweenness_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(edge_betweenness_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(edge_betweenness_impl( + graph = g + )) }) test_that("edge_betweenness_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(edge_betweenness_impl(NULL)) + expect_snapshot_igraph_error(edge_betweenness_impl( + graph = NULL + )) }) # 74. edge_betweenness_cutoff_impl @@ -1162,14 +1786,23 @@ test_that("edge_betweenness_impl errors", { test_that("edge_betweenness_cutoff_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(edge_betweenness_cutoff_impl(g, cutoff = 2)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(edge_betweenness_cutoff_impl( + graph = g, + cutoff = 2 + )) }) test_that("edge_betweenness_cutoff_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(edge_betweenness_cutoff_impl(NULL, cutoff = 2)) + expect_snapshot_igraph_error(edge_betweenness_cutoff_impl( + graph = NULL, + cutoff = 2 + )) }) # 75. edge_betweenness_subset_impl @@ -1177,14 +1810,21 @@ test_that("edge_betweenness_cutoff_impl errors", { test_that("edge_betweenness_subset_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(edge_betweenness_subset_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(edge_betweenness_subset_impl( + graph = g + )) }) test_that("edge_betweenness_subset_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(edge_betweenness_subset_impl(NULL)) + expect_snapshot_igraph_error(edge_betweenness_subset_impl( + graph = NULL + )) }) # 76. harmonic_centrality_cutoff_impl @@ -1192,15 +1832,24 @@ test_that("edge_betweenness_subset_impl errors", { test_that("harmonic_centrality_cutoff_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(harmonic_centrality_cutoff_impl(g, cutoff = 2)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(harmonic_centrality_cutoff_impl( + graph = g, + cutoff = 2 + )) }) test_that("harmonic_centrality_cutoff_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - harmonic_centrality_cutoff_impl(NULL, cutoff = 2) + harmonic_centrality_cutoff_impl( + graph = NULL, + cutoff = 2 + ) ) }) @@ -1209,15 +1858,26 @@ test_that("harmonic_centrality_cutoff_impl errors", { test_that("personalized_pagerank_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(personalized_pagerank_impl(g)) - expect_snapshot(personalized_pagerank_impl(g, algo = "arpack", damping = 0.9)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(personalized_pagerank_impl( + graph = g + )) + expect_snapshot(personalized_pagerank_impl( + graph = g, + algo = "arpack", + damping = 0.9 + )) }) test_that("personalized_pagerank_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(personalized_pagerank_impl(NULL)) + expect_snapshot_igraph_error(personalized_pagerank_impl( + graph = NULL + )) }) # 78. personalized_pagerank_vs_impl @@ -1225,10 +1885,16 @@ test_that("personalized_pagerank_impl errors", { test_that("personalized_pagerank_vs_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(personalized_pagerank_vs_impl(g, reset.vids = 1)) + g <- path_graph_impl( + n = 3 + ) + expect_snapshot(personalized_pagerank_vs_impl( - g, + graph = g, + reset.vids = 1 + )) + expect_snapshot(personalized_pagerank_vs_impl( + graph = g, algo = "arpack", reset.vids = 1, details = TRUE @@ -1239,7 +1905,10 @@ test_that("personalized_pagerank_vs_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - personalized_pagerank_vs_impl(NULL, reset.vids = 1) + personalized_pagerank_vs_impl( + graph = NULL, + reset.vids = 1 + ) ) }) @@ -1248,14 +1917,23 @@ test_that("personalized_pagerank_vs_impl errors", { test_that("induced_subgraph_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(induced_subgraph_impl(g, 1:2)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(induced_subgraph_impl( + graph = g, + vids = 1:2 + )) }) test_that("induced_subgraph_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(induced_subgraph_impl(NULL, 1:2)) + expect_snapshot_igraph_error(induced_subgraph_impl( + graph = NULL, + vids = 1:2 + )) }) # 80. subgraph_from_edges_impl @@ -1263,14 +1941,23 @@ test_that("induced_subgraph_impl errors", { test_that("subgraph_from_edges_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(subgraph_from_edges_impl(g, 1)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(subgraph_from_edges_impl( + graph = g, + eids = 1 + )) }) test_that("subgraph_from_edges_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(subgraph_from_edges_impl(NULL, 1)) + expect_snapshot_igraph_error(subgraph_from_edges_impl( + graph = NULL, + eids = 1 + )) }) # 81. reverse_edges_impl @@ -1278,14 +1965,21 @@ test_that("subgraph_from_edges_impl errors", { test_that("reverse_edges_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(reverse_edges_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(reverse_edges_impl( + graph = g + )) }) test_that("reverse_edges_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(reverse_edges_impl(NULL)) + expect_snapshot_igraph_error(reverse_edges_impl( + graph = NULL + )) }) # and much more halucination before... @@ -1297,15 +1991,25 @@ test_that("reverse_edges_impl errors", { test_that("path_length_hist_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(path_length_hist_impl(g)) - expect_snapshot(path_length_hist_impl(g, directed = FALSE)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(path_length_hist_impl( + graph = g + )) + expect_snapshot(path_length_hist_impl( + graph = g, + directed = FALSE + )) }) test_that("path_length_hist_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(path_length_hist_impl(NULL)) + expect_snapshot_igraph_error(path_length_hist_impl( + graph = NULL + )) }) # 102. simplify_impl @@ -1313,10 +2017,15 @@ test_that("path_length_hist_impl errors", { test_that("simplify_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(simplify_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(simplify_impl( + graph = g + )) expect_snapshot(simplify_impl( - g, + graph = g, remove.multiple = FALSE, remove.loops = FALSE )) @@ -1325,7 +2034,9 @@ test_that("simplify_impl basic", { test_that("simplify_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(simplify_impl(NULL)) + expect_snapshot_igraph_error(simplify_impl( + graph = NULL + )) }) # 103. transitivity_undirected_impl @@ -1333,15 +2044,25 @@ test_that("simplify_impl errors", { test_that("transitivity_undirected_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(transitivity_undirected_impl(g)) - expect_snapshot(transitivity_undirected_impl(g, mode = "zero")) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(transitivity_undirected_impl( + graph = g + )) + expect_snapshot(transitivity_undirected_impl( + graph = g, + mode = "zero" + )) }) test_that("transitivity_undirected_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(transitivity_undirected_impl(NULL)) + expect_snapshot_igraph_error(transitivity_undirected_impl( + graph = NULL + )) }) # 104. transitivity_local_undirected_impl @@ -1349,15 +2070,25 @@ test_that("transitivity_undirected_impl errors", { test_that("transitivity_local_undirected_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(transitivity_local_undirected_impl(g)) - expect_snapshot(transitivity_local_undirected_impl(g, mode = "zero")) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(transitivity_local_undirected_impl( + graph = g + )) + expect_snapshot(transitivity_local_undirected_impl( + graph = g, + mode = "zero" + )) }) test_that("transitivity_local_undirected_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(transitivity_local_undirected_impl(NULL)) + expect_snapshot_igraph_error(transitivity_local_undirected_impl( + graph = NULL + )) }) # 105. transitivity_avglocal_undirected_impl @@ -1365,15 +2096,25 @@ test_that("transitivity_local_undirected_impl errors", { test_that("transitivity_avglocal_undirected_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(transitivity_avglocal_undirected_impl(g)) - expect_snapshot(transitivity_avglocal_undirected_impl(g, mode = "zero")) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(transitivity_avglocal_undirected_impl( + graph = g + )) + expect_snapshot(transitivity_avglocal_undirected_impl( + graph = g, + mode = "zero" + )) }) test_that("transitivity_avglocal_undirected_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(transitivity_avglocal_undirected_impl(NULL)) + expect_snapshot_igraph_error(transitivity_avglocal_undirected_impl( + graph = NULL + )) }) # 106. transitivity_barrat_impl @@ -1381,15 +2122,25 @@ test_that("transitivity_avglocal_undirected_impl errors", { test_that("transitivity_barrat_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(transitivity_barrat_impl(g)) - expect_snapshot(transitivity_barrat_impl(g, mode = "zero")) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(transitivity_barrat_impl( + graph = g + )) + expect_snapshot(transitivity_barrat_impl( + graph = g, + mode = "zero" + )) }) test_that("transitivity_barrat_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(transitivity_barrat_impl(NULL)) + expect_snapshot_igraph_error(transitivity_barrat_impl( + graph = NULL + )) }) # 107. ecc_impl @@ -1397,15 +2148,27 @@ test_that("transitivity_barrat_impl errors", { test_that("ecc_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(4) - expect_snapshot(ecc_impl(g)) - expect_snapshot(ecc_impl(g, k = 3, offset = TRUE, normalize = FALSE)) + g <- path_graph_impl( + n = 4 + ) + + expect_snapshot(ecc_impl( + graph = g + )) + expect_snapshot(ecc_impl( + graph = g, + k = 3, + offset = TRUE, + normalize = FALSE + )) }) test_that("ecc_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(ecc_impl(NULL)) + expect_snapshot_igraph_error(ecc_impl( + graph = NULL + )) }) # 108. reciprocity_impl @@ -1413,15 +2176,26 @@ test_that("ecc_impl errors", { test_that("reciprocity_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(reciprocity_impl(g)) - expect_snapshot(reciprocity_impl(g, ignore.loops = FALSE, mode = "ratio")) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(reciprocity_impl( + graph = g + )) + expect_snapshot(reciprocity_impl( + graph = g, + ignore.loops = FALSE, + mode = "ratio" + )) }) test_that("reciprocity_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(reciprocity_impl(NULL)) + expect_snapshot_igraph_error(reciprocity_impl( + graph = NULL + )) }) # 109. maxdegree_impl @@ -1429,15 +2203,26 @@ test_that("reciprocity_impl errors", { test_that("maxdegree_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(maxdegree_impl(g)) - expect_snapshot(maxdegree_impl(g, mode = "in", loops = FALSE)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(maxdegree_impl( + graph = g + )) + expect_snapshot(maxdegree_impl( + graph = g, + mode = "in", + loops = FALSE + )) }) test_that("maxdegree_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(maxdegree_impl(NULL)) + expect_snapshot_igraph_error(maxdegree_impl( + graph = NULL + )) }) # 110. density_impl @@ -1445,15 +2230,25 @@ test_that("maxdegree_impl errors", { test_that("density_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(density_impl(g)) - expect_snapshot(density_impl(g, loops = TRUE)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(density_impl( + graph = g + )) + expect_snapshot(density_impl( + graph = g, + loops = TRUE + )) }) test_that("density_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(density_impl(NULL)) + expect_snapshot_igraph_error(density_impl( + graph = NULL + )) }) # 111. mean_degree_impl @@ -1461,15 +2256,25 @@ test_that("density_impl errors", { test_that("mean_degree_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(mean_degree_impl(g)) - expect_snapshot(mean_degree_impl(g, loops = FALSE)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(mean_degree_impl( + graph = g + )) + expect_snapshot(mean_degree_impl( + graph = g, + loops = FALSE + )) }) test_that("mean_degree_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(mean_degree_impl(NULL)) + expect_snapshot_igraph_error(mean_degree_impl( + graph = NULL + )) }) # 112. feedback_arc_set_impl @@ -1477,15 +2282,25 @@ test_that("mean_degree_impl errors", { test_that("feedback_arc_set_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(feedback_arc_set_impl(g)) - expect_snapshot(feedback_arc_set_impl(g, algo = "exact_ip")) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(feedback_arc_set_impl( + graph = g + )) + expect_snapshot(feedback_arc_set_impl( + graph = g, + algo = "exact_ip" + )) }) test_that("feedback_arc_set_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(feedback_arc_set_impl(NULL)) + expect_snapshot_igraph_error(feedback_arc_set_impl( + graph = NULL + )) }) # 113. feedback_vertex_set_impl @@ -1493,14 +2308,21 @@ test_that("feedback_arc_set_impl errors", { test_that("feedback_vertex_set_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(feedback_vertex_set_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(feedback_vertex_set_impl( + graph = g + )) }) test_that("feedback_vertex_set_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(feedback_vertex_set_impl(NULL)) + expect_snapshot_igraph_error(feedback_vertex_set_impl( + graph = NULL + )) }) # 114. is_loop_impl @@ -1508,14 +2330,21 @@ test_that("feedback_vertex_set_impl errors", { test_that("is_loop_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(is_loop_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(is_loop_impl( + graph = g + )) }) test_that("is_loop_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(is_loop_impl(NULL)) + expect_snapshot_igraph_error(is_loop_impl( + graph = NULL + )) }) # 115. is_dag_impl @@ -1523,14 +2352,21 @@ test_that("is_loop_impl errors", { test_that("is_dag_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(is_dag_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(is_dag_impl( + graph = g + )) }) test_that("is_dag_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(is_dag_impl(NULL)) + expect_snapshot_igraph_error(is_dag_impl( + graph = NULL + )) }) # 116. is_acyclic_impl @@ -1538,14 +2374,21 @@ test_that("is_dag_impl errors", { test_that("is_acyclic_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(is_acyclic_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(is_acyclic_impl( + graph = g + )) }) test_that("is_acyclic_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(is_acyclic_impl(NULL)) + expect_snapshot_igraph_error(is_acyclic_impl( + graph = NULL + )) }) # 117. is_simple_impl @@ -1553,14 +2396,21 @@ test_that("is_acyclic_impl errors", { test_that("is_simple_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(is_simple_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(is_simple_impl( + graph = g + )) }) test_that("is_simple_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(is_simple_impl(NULL)) + expect_snapshot_igraph_error(is_simple_impl( + graph = NULL + )) }) # 118. is_multiple_impl @@ -1568,14 +2418,21 @@ test_that("is_simple_impl errors", { test_that("is_multiple_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(is_multiple_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(is_multiple_impl( + graph = g + )) }) test_that("is_multiple_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(is_multiple_impl(NULL)) + expect_snapshot_igraph_error(is_multiple_impl( + graph = NULL + )) }) # 119. has_loop_impl @@ -1583,14 +2440,21 @@ test_that("is_multiple_impl errors", { test_that("has_loop_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(has_loop_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(has_loop_impl( + graph = g + )) }) test_that("has_loop_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(has_loop_impl(NULL)) + expect_snapshot_igraph_error(has_loop_impl( + graph = NULL + )) }) # 120. has_multiple_impl @@ -1598,14 +2462,21 @@ test_that("has_loop_impl errors", { test_that("has_multiple_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(has_multiple_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(has_multiple_impl( + graph = g + )) }) test_that("has_multiple_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(has_multiple_impl(NULL)) + expect_snapshot_igraph_error(has_multiple_impl( + graph = NULL + )) }) # 121. count_loops_impl @@ -1613,14 +2484,21 @@ test_that("has_multiple_impl errors", { test_that("count_loops_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(count_loops_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(count_loops_impl( + graph = g + )) }) test_that("count_loops_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(count_loops_impl(NULL)) + expect_snapshot_igraph_error(count_loops_impl( + graph = NULL + )) }) # 122. count_multiple_impl @@ -1628,14 +2506,21 @@ test_that("count_loops_impl errors", { test_that("count_multiple_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(count_multiple_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(count_multiple_impl( + graph = g + )) }) test_that("count_multiple_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(count_multiple_impl(NULL)) + expect_snapshot_igraph_error(count_multiple_impl( + graph = NULL + )) }) # 123. is_perfect_impl @@ -1643,14 +2528,21 @@ test_that("count_multiple_impl errors", { test_that("is_perfect_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(is_perfect_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(is_perfect_impl( + graph = g + )) }) test_that("is_perfect_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(is_perfect_impl(NULL)) + expect_snapshot_igraph_error(is_perfect_impl( + graph = NULL + )) }) # 124. eigenvector_centrality_impl @@ -1658,10 +2550,15 @@ test_that("is_perfect_impl errors", { test_that("eigenvector_centrality_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(eigenvector_centrality_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(eigenvector_centrality_impl( + graph = g + )) expect_snapshot(eigenvector_centrality_impl( - g, + graph = g, directed = TRUE, scale = FALSE )) @@ -1670,7 +2567,9 @@ test_that("eigenvector_centrality_impl basic", { test_that("eigenvector_centrality_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(eigenvector_centrality_impl(NULL)) + expect_snapshot_igraph_error(eigenvector_centrality_impl( + graph = NULL + )) }) # 125. hub_and_authority_scores_impl @@ -1679,14 +2578,21 @@ test_that("hub_and_authority_scores_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) g <- make_full_graph(5) - expect_snapshot(hub_and_authority_scores_impl(g)) - expect_snapshot(hub_and_authority_scores_impl(g, scale = FALSE)) + expect_snapshot(hub_and_authority_scores_impl( + graph = g + )) + expect_snapshot(hub_and_authority_scores_impl( + graph = g, + scale = FALSE + )) }) test_that("hub_and_authority_scores_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(hub_and_authority_scores_impl(NULL)) + expect_snapshot_igraph_error(hub_and_authority_scores_impl( + graph = NULL + )) }) # 126. unfold_tree_impl @@ -1694,15 +2600,28 @@ test_that("hub_and_authority_scores_impl errors", { test_that("unfold_tree_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(unfold_tree_impl(g, roots = 1)) - expect_snapshot(unfold_tree_impl(g, mode = "in", roots = 1)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(unfold_tree_impl( + graph = g, + roots = 1 + )) + expect_snapshot(unfold_tree_impl( + graph = g, + mode = "in", + roots = 1 + )) }) test_that("unfold_tree_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(unfold_tree_impl(NULL, roots = 1)) + expect_snapshot_igraph_error(unfold_tree_impl( + graph = NULL, + roots = 1 + )) }) # 127. is_mutual_impl @@ -1710,15 +2629,25 @@ test_that("unfold_tree_impl errors", { test_that("is_mutual_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(is_mutual_impl(g)) - expect_snapshot(is_mutual_impl(g, loops = FALSE)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(is_mutual_impl( + graph = g + )) + expect_snapshot(is_mutual_impl( + graph = g, + loops = FALSE + )) }) test_that("is_mutual_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(is_mutual_impl(NULL)) + expect_snapshot_igraph_error(is_mutual_impl( + graph = NULL + )) }) # 128. has_mutual_impl @@ -1726,15 +2655,25 @@ test_that("is_mutual_impl errors", { test_that("has_mutual_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(has_mutual_impl(g)) - expect_snapshot(has_mutual_impl(g, loops = FALSE)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(has_mutual_impl( + graph = g + )) + expect_snapshot(has_mutual_impl( + graph = g, + loops = FALSE + )) }) test_that("has_mutual_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(has_mutual_impl(NULL)) + expect_snapshot_igraph_error(has_mutual_impl( + graph = NULL + )) }) # 129. maximum_cardinality_search_impl @@ -1742,14 +2681,21 @@ test_that("has_mutual_impl errors", { test_that("maximum_cardinality_search_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(maximum_cardinality_search_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(maximum_cardinality_search_impl( + graph = g + )) }) test_that("maximum_cardinality_search_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(maximum_cardinality_search_impl(NULL)) + expect_snapshot_igraph_error(maximum_cardinality_search_impl( + graph = NULL + )) }) # 130. avg_nearest_neighbor_degree_impl @@ -1757,10 +2703,15 @@ test_that("maximum_cardinality_search_impl errors", { test_that("avg_nearest_neighbor_degree_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(avg_nearest_neighbor_degree_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(avg_nearest_neighbor_degree_impl( + graph = g + )) expect_snapshot(avg_nearest_neighbor_degree_impl( - g, + graph = g, mode = "in", neighbor.degree.mode = "out" )) @@ -1769,7 +2720,9 @@ test_that("avg_nearest_neighbor_degree_impl basic", { test_that("avg_nearest_neighbor_degree_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(avg_nearest_neighbor_degree_impl(NULL)) + expect_snapshot_igraph_error(avg_nearest_neighbor_degree_impl( + graph = NULL + )) }) # 131. degree_correlation_vector_impl @@ -1777,10 +2730,15 @@ test_that("avg_nearest_neighbor_degree_impl errors", { test_that("degree_correlation_vector_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(degree_correlation_vector_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(degree_correlation_vector_impl( + graph = g + )) expect_snapshot(degree_correlation_vector_impl( - g, + graph = g, from.mode = "in", to.mode = "out", directed.neighbors = FALSE @@ -1790,7 +2748,9 @@ test_that("degree_correlation_vector_impl basic", { test_that("degree_correlation_vector_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(degree_correlation_vector_impl(NULL)) + expect_snapshot_igraph_error(degree_correlation_vector_impl( + graph = NULL + )) }) # 132. rich_club_sequence_impl @@ -1798,10 +2758,16 @@ test_that("degree_correlation_vector_impl errors", { test_that("rich_club_sequence_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(rich_club_sequence_impl(g, vertex.order = 1:3)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(rich_club_sequence_impl( + graph = g, + vertex.order = 1:3 + )) expect_snapshot(rich_club_sequence_impl( - g, + graph = g, vertex.order = 1:3, normalized = FALSE, loops = TRUE, @@ -1813,7 +2779,10 @@ test_that("rich_club_sequence_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - rich_club_sequence_impl(NULL, vertex.order = 1:3) + rich_club_sequence_impl( + graph = NULL, + vertex.order = 1:3 + ) ) }) @@ -1822,15 +2791,26 @@ test_that("rich_club_sequence_impl errors", { test_that("strength_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(strength_impl(g)) - expect_snapshot(strength_impl(g, mode = "in", loops = FALSE)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(strength_impl( + graph = g + )) + expect_snapshot(strength_impl( + graph = g, + mode = "in", + loops = FALSE + )) }) test_that("strength_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(strength_impl(NULL)) + expect_snapshot_igraph_error(strength_impl( + graph = NULL + )) }) # 134. centralization_impl @@ -1838,9 +2818,13 @@ test_that("strength_impl errors", { test_that("centralization_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(centralization_impl(c(1, 2, 3))) expect_snapshot(centralization_impl( - c(1, 2, 3), + scores = c(1, + 2, 3) + )) + expect_snapshot(centralization_impl( + scores = c(1, + 2, 3), theoretical.max = 2, normalized = FALSE )) @@ -1849,7 +2833,9 @@ test_that("centralization_impl basic", { test_that("centralization_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(centralization_impl(package_version("1.2.3"))) + expect_snapshot_igraph_error(centralization_impl( + scores = package_version("1.2.3") + )) }) # 135. centralization_degree_impl @@ -1857,10 +2843,15 @@ test_that("centralization_impl errors", { test_that("centralization_degree_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(centralization_degree_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(centralization_degree_impl( + graph = g + )) expect_snapshot(centralization_degree_impl( - g, + graph = g, mode = "in", loops = FALSE, normalized = FALSE @@ -1870,7 +2861,9 @@ test_that("centralization_degree_impl basic", { test_that("centralization_degree_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(centralization_degree_impl(NULL)) + expect_snapshot_igraph_error(centralization_degree_impl( + graph = NULL + )) }) # 136. centralization_degree_tmax_impl @@ -1878,7 +2871,10 @@ test_that("centralization_degree_impl errors", { test_that("centralization_degree_tmax_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(centralization_degree_tmax_impl(nodes = 3, loops = TRUE)) + expect_snapshot(centralization_degree_tmax_impl( + nodes = 3, + loops = TRUE + )) expect_snapshot(centralization_degree_tmax_impl( nodes = 3, mode = "in", @@ -1890,7 +2886,10 @@ test_that("centralization_degree_tmax_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - centralization_degree_tmax_impl(nodes = -1, loops = TRUE) + centralization_degree_tmax_impl( + nodes = -1, + loops = TRUE + ) ) }) @@ -1899,10 +2898,15 @@ test_that("centralization_degree_tmax_impl errors", { test_that("centralization_betweenness_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(centralization_betweenness_impl(g)) + g <- path_graph_impl( + n = 3 + ) + expect_snapshot(centralization_betweenness_impl( - g, + graph = g + )) + expect_snapshot(centralization_betweenness_impl( + graph = g, directed = FALSE, normalized = FALSE )) @@ -1911,7 +2915,9 @@ test_that("centralization_betweenness_impl basic", { test_that("centralization_betweenness_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(centralization_betweenness_impl(NULL)) + expect_snapshot_igraph_error(centralization_betweenness_impl( + graph = NULL + )) }) # 138. centralization_betweenness_tmax_impl @@ -1933,7 +2939,10 @@ test_that("centralization_betweenness_tmax_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - centralization_betweenness_tmax_impl(nodes = -1, directed = TRUE) + centralization_betweenness_tmax_impl( + nodes = -1, + directed = TRUE + ) ) }) @@ -1942,10 +2951,15 @@ test_that("centralization_betweenness_tmax_impl errors", { test_that("centralization_closeness_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(centralization_closeness_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(centralization_closeness_impl( + graph = g + )) expect_snapshot(centralization_closeness_impl( - g, + graph = g, mode = "in", normalized = FALSE )) @@ -1954,7 +2968,9 @@ test_that("centralization_closeness_impl basic", { test_that("centralization_closeness_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(centralization_closeness_impl(NULL)) + expect_snapshot_igraph_error(centralization_closeness_impl( + graph = NULL + )) }) # 140. centralization_closeness_tmax_impl @@ -1962,14 +2978,21 @@ test_that("centralization_closeness_impl errors", { test_that("centralization_closeness_tmax_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(centralization_closeness_tmax_impl(nodes = 3)) - expect_snapshot(centralization_closeness_tmax_impl(nodes = 3, mode = "in")) + expect_snapshot(centralization_closeness_tmax_impl( + nodes = 3 + )) + expect_snapshot(centralization_closeness_tmax_impl( + nodes = 3, + mode = "in" + )) }) test_that("centralization_closeness_tmax_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(centralization_closeness_tmax_impl(nodes = -1)) + expect_snapshot_igraph_error(centralization_closeness_tmax_impl( + nodes = -1 + )) }) # 141. centralization_eigenvector_centrality_impl @@ -1977,10 +3000,15 @@ test_that("centralization_closeness_tmax_impl errors", { test_that("centralization_eigenvector_centrality_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(centralization_eigenvector_centrality_impl(g)) + g <- path_graph_impl( + n = 3 + ) + expect_snapshot(centralization_eigenvector_centrality_impl( - g, + graph = g + )) + expect_snapshot(centralization_eigenvector_centrality_impl( + graph = g, directed = TRUE, normalized = FALSE )) @@ -1990,7 +3018,9 @@ test_that("centralization_eigenvector_centrality_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - centralization_eigenvector_centrality_impl(NULL) + centralization_eigenvector_centrality_impl( + graph = NULL + ) ) }) @@ -1999,7 +3029,9 @@ test_that("centralization_eigenvector_centrality_impl errors", { test_that("centralization_eigenvector_centrality_tmax_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(centralization_eigenvector_centrality_tmax_impl(nodes = 3)) + expect_snapshot(centralization_eigenvector_centrality_tmax_impl( + nodes = 3 + )) expect_snapshot(centralization_eigenvector_centrality_tmax_impl( nodes = 3, directed = TRUE @@ -2010,7 +3042,9 @@ test_that("centralization_eigenvector_centrality_tmax_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - centralization_eigenvector_centrality_tmax_impl(nodes = -1) + centralization_eigenvector_centrality_tmax_impl( + nodes = -1 + ) ) }) @@ -2019,11 +3053,17 @@ test_that("centralization_eigenvector_centrality_tmax_impl errors", { test_that("assortativity_nominal_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(assortativity_nominal_impl(g, c(1, 2, 1))) + g <- path_graph_impl( + n = 3 + ) + expect_snapshot(assortativity_nominal_impl( - g, - c(1, 2, 1), + graph = g, + types = c(1, 2, 1) + )) + expect_snapshot(assortativity_nominal_impl( + graph = g, + types = c(1, 2, 1), directed = FALSE, normalized = FALSE )) @@ -2032,7 +3072,10 @@ test_that("assortativity_nominal_impl basic", { test_that("assortativity_nominal_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(assortativity_nominal_impl(NULL, c(1, 2, 1))) + expect_snapshot_igraph_error(assortativity_nominal_impl( + graph = NULL, + types = c(1, 2, 1) + )) }) # 144. assortativity_impl @@ -2040,11 +3083,19 @@ test_that("assortativity_nominal_impl errors", { test_that("assortativity_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(assortativity_impl(g, c(1, 2, 1))) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(assortativity_impl( + graph = g, + values = c(1, 2, + 1) + )) expect_snapshot(assortativity_impl( - g, - c(1, 2, 1), + graph = g, + values = c(1, 2, + 1), directed = FALSE, normalized = FALSE )) @@ -2053,7 +3104,11 @@ test_that("assortativity_impl basic", { test_that("assortativity_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(assortativity_impl(NULL, c(1, 2, 1))) + expect_snapshot_igraph_error(assortativity_impl( + graph = NULL, + values = c(1, 2, + 1) + )) }) # 145. assortativity_degree_impl @@ -2061,15 +3116,25 @@ test_that("assortativity_impl errors", { test_that("assortativity_degree_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(assortativity_degree_impl(g)) - expect_snapshot(assortativity_degree_impl(g, directed = FALSE)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(assortativity_degree_impl( + graph = g + )) + expect_snapshot(assortativity_degree_impl( + graph = g, + directed = FALSE + )) }) test_that("assortativity_degree_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(assortativity_degree_impl(NULL)) + expect_snapshot_igraph_error(assortativity_degree_impl( + graph = NULL + )) }) # 146. joint_degree_matrix_impl @@ -2077,10 +3142,15 @@ test_that("assortativity_degree_impl errors", { test_that("joint_degree_matrix_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(joint_degree_matrix_impl(g)) + g <- path_graph_impl( + n = 3 + ) + expect_snapshot(joint_degree_matrix_impl( - g, + graph = g + )) + expect_snapshot(joint_degree_matrix_impl( + graph = g, max.out.degree = 2, max.in.degree = 2 )) @@ -2089,7 +3159,9 @@ test_that("joint_degree_matrix_impl basic", { test_that("joint_degree_matrix_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(joint_degree_matrix_impl(NULL)) + expect_snapshot_igraph_error(joint_degree_matrix_impl( + graph = NULL + )) }) # 147. joint_degree_distribution_impl @@ -2097,10 +3169,15 @@ test_that("joint_degree_matrix_impl errors", { test_that("joint_degree_distribution_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(joint_degree_distribution_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(joint_degree_distribution_impl( + graph = g + )) expect_snapshot(joint_degree_distribution_impl( - g, + graph = g, from.mode = "in", to.mode = "out", directed.neighbors = FALSE, @@ -2113,7 +3190,9 @@ test_that("joint_degree_distribution_impl basic", { test_that("joint_degree_distribution_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(joint_degree_distribution_impl(NULL)) + expect_snapshot_igraph_error(joint_degree_distribution_impl( + graph = NULL + )) }) # 148. joint_type_distribution_impl @@ -2121,12 +3200,21 @@ test_that("joint_degree_distribution_impl errors", { test_that("joint_type_distribution_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(joint_type_distribution_impl(g, from.types = c(1, 2, 1))) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(joint_type_distribution_impl( + graph = g, + from.types = c(1, + 2, 1) + )) expect_snapshot(joint_type_distribution_impl( - g, - from.types = c(1, 2, 1), - to.types = c(1, 2, 1), + graph = g, + from.types = c(1, + 2, 1), + to.types = c(1, + 2, 1), directed = FALSE, normalized = FALSE )) @@ -2136,7 +3224,11 @@ test_that("joint_type_distribution_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - joint_type_distribution_impl(NULL, from.types = c(1, 2, 1)) + joint_type_distribution_impl( + graph = NULL, + from.types = c(1, + 2, 1) + ) ) }) @@ -2145,14 +3237,25 @@ test_that("joint_type_distribution_impl errors", { test_that("contract_vertices_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(contract_vertices_impl(g, c(1, 1, 2))) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(contract_vertices_impl( + graph = g, + mapping = c(1, 1, + 2) + )) }) test_that("contract_vertices_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(contract_vertices_impl(NULL, c(1, 1, 2))) + expect_snapshot_igraph_error(contract_vertices_impl( + graph = NULL, + mapping = c(1, 1, + 2) + )) }) # 150. eccentricity_dijkstra_impl @@ -2160,15 +3263,25 @@ test_that("contract_vertices_impl errors", { test_that("eccentricity_dijkstra_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(eccentricity_dijkstra_impl(g)) - expect_snapshot(eccentricity_dijkstra_impl(g, mode = "in")) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(eccentricity_dijkstra_impl( + graph = g + )) + expect_snapshot(eccentricity_dijkstra_impl( + graph = g, + mode = "in" + )) }) test_that("eccentricity_dijkstra_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(eccentricity_dijkstra_impl(NULL)) + expect_snapshot_igraph_error(eccentricity_dijkstra_impl( + graph = NULL + )) }) # 151. graph_center_dijkstra_impl @@ -2176,15 +3289,25 @@ test_that("eccentricity_dijkstra_impl errors", { test_that("graph_center_dijkstra_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(graph_center_dijkstra_impl(g)) - expect_snapshot(graph_center_dijkstra_impl(g, mode = "in")) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(graph_center_dijkstra_impl( + graph = g + )) + expect_snapshot(graph_center_dijkstra_impl( + graph = g, + mode = "in" + )) }) test_that("graph_center_dijkstra_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(graph_center_dijkstra_impl(NULL)) + expect_snapshot_igraph_error(graph_center_dijkstra_impl( + graph = NULL + )) }) # 152. radius_dijkstra_impl @@ -2192,15 +3315,25 @@ test_that("graph_center_dijkstra_impl errors", { test_that("radius_dijkstra_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(radius_dijkstra_impl(g)) - expect_snapshot(radius_dijkstra_impl(g, mode = "in")) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(radius_dijkstra_impl( + graph = g + )) + expect_snapshot(radius_dijkstra_impl( + graph = g, + mode = "in" + )) }) test_that("radius_dijkstra_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(radius_dijkstra_impl(NULL)) + expect_snapshot_igraph_error(radius_dijkstra_impl( + graph = NULL + )) }) # 153. pseudo_diameter_impl @@ -2208,11 +3341,17 @@ test_that("radius_dijkstra_impl errors", { test_that("pseudo_diameter_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(pseudo_diameter_impl(g, 1)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(pseudo_diameter_impl( + graph = g, + start.vid = 1 + )) expect_snapshot(pseudo_diameter_impl( - g, - 1, + graph = g, + start.vid = 1, directed = FALSE, unconnected = FALSE )) @@ -2221,7 +3360,10 @@ test_that("pseudo_diameter_impl basic", { test_that("pseudo_diameter_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(pseudo_diameter_impl(NULL, 1)) + expect_snapshot_igraph_error(pseudo_diameter_impl( + graph = NULL, + start.vid = 1 + )) }) # 154. pseudo_diameter_dijkstra_impl @@ -2229,10 +3371,16 @@ test_that("pseudo_diameter_impl errors", { test_that("pseudo_diameter_dijkstra_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(pseudo_diameter_dijkstra_impl(g, start.vid = 1)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(pseudo_diameter_dijkstra_impl( + graph = g, + start.vid = 1 + )) expect_snapshot(pseudo_diameter_dijkstra_impl( - g, + graph = g, start.vid = 1, directed = FALSE, unconnected = FALSE @@ -2243,7 +3391,10 @@ test_that("pseudo_diameter_dijkstra_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - pseudo_diameter_dijkstra_impl(NULL, start.vid = 1) + pseudo_diameter_dijkstra_impl( + graph = NULL, + start.vid = 1 + ) ) }) @@ -2252,15 +3403,22 @@ test_that("pseudo_diameter_dijkstra_impl errors", { test_that("diversity_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) + g <- path_graph_impl( + n = 3 + ) + E(g)$weight <- c(1, 2) - expect_snapshot(diversity_impl(g)) + expect_snapshot(diversity_impl( + graph = g + )) }) test_that("diversity_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(diversity_impl(NULL)) + expect_snapshot_igraph_error(diversity_impl( + graph = NULL + )) }) # 156. random_walk_impl @@ -2268,15 +3426,32 @@ test_that("diversity_impl errors", { test_that("random_walk_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(random_walk_impl(g, 1, 2)) - expect_snapshot(random_walk_impl(g, 1, 2, mode = "in", stuck = "error")) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(random_walk_impl( + graph = g, + start = 1, + steps = 2 + )) + expect_snapshot(random_walk_impl( + graph = g, + start = 1, + steps = 2, + mode = "in", + stuck = "error" + )) }) test_that("random_walk_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(random_walk_impl(NULL, 1, 2)) + expect_snapshot_igraph_error(random_walk_impl( + graph = NULL, + start = 1, + steps = 2 + )) }) # 157. global_efficiency_impl @@ -2284,15 +3459,25 @@ test_that("random_walk_impl errors", { test_that("global_efficiency_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(global_efficiency_impl(g)) - expect_snapshot(global_efficiency_impl(g, directed = FALSE)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(global_efficiency_impl( + graph = g + )) + expect_snapshot(global_efficiency_impl( + graph = g, + directed = FALSE + )) }) test_that("global_efficiency_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(global_efficiency_impl(NULL)) + expect_snapshot_igraph_error(global_efficiency_impl( + graph = NULL + )) }) # 158. local_efficiency_impl @@ -2300,15 +3485,26 @@ test_that("global_efficiency_impl errors", { test_that("local_efficiency_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(local_efficiency_impl(g)) - expect_snapshot(local_efficiency_impl(g, directed = FALSE, mode = "in")) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(local_efficiency_impl( + graph = g + )) + expect_snapshot(local_efficiency_impl( + graph = g, + directed = FALSE, + mode = "in" + )) }) test_that("local_efficiency_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(local_efficiency_impl(NULL)) + expect_snapshot_igraph_error(local_efficiency_impl( + graph = NULL + )) }) # 159. average_local_efficiency_impl @@ -2316,10 +3512,15 @@ test_that("local_efficiency_impl errors", { test_that("average_local_efficiency_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(average_local_efficiency_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(average_local_efficiency_impl( + graph = g + )) expect_snapshot(average_local_efficiency_impl( - g, + graph = g, directed = FALSE, mode = "in" )) @@ -2328,7 +3529,9 @@ test_that("average_local_efficiency_impl basic", { test_that("average_local_efficiency_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(average_local_efficiency_impl(NULL)) + expect_snapshot_igraph_error(average_local_efficiency_impl( + graph = NULL + )) }) # 160. transitive_closure_dag_impl @@ -2336,14 +3539,22 @@ test_that("average_local_efficiency_impl errors", { test_that("transitive_closure_dag_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3, directed = TRUE) - expect_snapshot(transitive_closure_dag_impl(g)) + g <- path_graph_impl( + n = 3, + directed = TRUE + ) + + expect_snapshot(transitive_closure_dag_impl( + graph = g + )) }) test_that("transitive_closure_dag_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(transitive_closure_dag_impl(NULL)) + expect_snapshot_igraph_error(transitive_closure_dag_impl( + graph = NULL + )) }) # 161. transitive_closure_impl @@ -2351,14 +3562,21 @@ test_that("transitive_closure_dag_impl errors", { test_that("transitive_closure_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(transitive_closure_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(transitive_closure_impl( + graph = g + )) }) test_that("transitive_closure_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(transitive_closure_impl(NULL)) + expect_snapshot_igraph_error(transitive_closure_impl( + graph = NULL + )) }) # 162. trussness_impl @@ -2366,14 +3584,21 @@ test_that("transitive_closure_impl errors", { test_that("trussness_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(trussness_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(trussness_impl( + graph = g + )) }) test_that("trussness_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(trussness_impl(NULL)) + expect_snapshot_igraph_error(trussness_impl( + graph = NULL + )) }) # 163. is_graphical_impl @@ -2381,10 +3606,15 @@ test_that("trussness_impl errors", { test_that("is_graphical_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(is_graphical_impl(c(2, 2, 2))) expect_snapshot(is_graphical_impl( - c(2, 2, 2), - c(1, 1, 1), + out.deg = c(2, + 2, 2) + )) + expect_snapshot(is_graphical_impl( + out.deg = c(2, + 2, 2), + in.deg = c(1, + 1, 1), allowed.edge.types = "all" )) }) @@ -2392,7 +3622,9 @@ test_that("is_graphical_impl basic", { test_that("is_graphical_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(is_graphical_impl("a")) + expect_snapshot_igraph_error(is_graphical_impl( + out.deg = "a" + )) }) # 164. bfs_simple_impl @@ -2400,15 +3632,28 @@ test_that("is_graphical_impl errors", { test_that("bfs_simple_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(bfs_simple_impl(g, 1)) - expect_snapshot(bfs_simple_impl(g, 1, mode = "in")) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(bfs_simple_impl( + graph = g, + root = 1 + )) + expect_snapshot(bfs_simple_impl( + graph = g, + root = 1, + mode = "in" + )) }) test_that("bfs_simple_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(bfs_simple_impl(NULL, 1)) + expect_snapshot_igraph_error(bfs_simple_impl( + graph = NULL, + root = 1 + )) }) # 165. bipartite_projection_size_impl @@ -2416,15 +3661,22 @@ test_that("bfs_simple_impl errors", { test_that("bipartite_projection_size_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(4) + g <- path_graph_impl( + n = 4 + ) + V(g)$type <- c(TRUE, FALSE, TRUE, FALSE) - expect_snapshot(bipartite_projection_size_impl(g)) + expect_snapshot(bipartite_projection_size_impl( + graph = g + )) }) test_that("bipartite_projection_size_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(bipartite_projection_size_impl(NULL)) + expect_snapshot_igraph_error(bipartite_projection_size_impl( + graph = NULL + )) }) # 166. biadjacency_impl @@ -2433,9 +3685,11 @@ test_that("biadjacency_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) m <- matrix(c(1, 0, 1, 0, 1, 1), nrow = 2) - expect_snapshot(biadjacency_impl(m)) expect_snapshot(biadjacency_impl( - m, + incidence = m + )) + expect_snapshot(biadjacency_impl( + incidence = m, directed = TRUE, mode = "in", multiple = TRUE @@ -2445,7 +3699,9 @@ test_that("biadjacency_impl basic", { test_that("biadjacency_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(biadjacency_impl("a")) + expect_snapshot_igraph_error(biadjacency_impl( + incidence = "a" + )) }) # 167. get_biadjacency_impl @@ -2453,15 +3709,26 @@ test_that("biadjacency_impl errors", { test_that("get_biadjacency_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(get_biadjacency_impl(g, c(TRUE, FALSE, TRUE))) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(get_biadjacency_impl( + graph = g, + types = c(TRUE, FALSE, + TRUE) + )) }) test_that("get_biadjacency_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - get_biadjacency_impl(NULL, c(TRUE, FALSE, TRUE)) + get_biadjacency_impl( + graph = NULL, + types = c(TRUE, FALSE, + TRUE) + ) ) }) @@ -2470,14 +3737,21 @@ test_that("get_biadjacency_impl errors", { test_that("is_bipartite_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(is_bipartite_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(is_bipartite_impl( + graph = g + )) }) test_that("is_bipartite_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(is_bipartite_impl(NULL)) + expect_snapshot_igraph_error(is_bipartite_impl( + graph = NULL + )) }) # 169. bipartite_game_gnp_impl @@ -2485,11 +3759,15 @@ test_that("is_bipartite_impl errors", { test_that("bipartite_game_gnp_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(bipartite_game_gnp_impl(2, 2, 0.5)) expect_snapshot(bipartite_game_gnp_impl( - 2, - 2, - 0.5, + n1 = 2, + n2 = 2, + p = 0.5 + )) + expect_snapshot(bipartite_game_gnp_impl( + n1 = 2, + n2 = 2, + p = 0.5, directed = TRUE, mode = "in" )) @@ -2498,7 +3776,11 @@ test_that("bipartite_game_gnp_impl basic", { test_that("bipartite_game_gnp_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(bipartite_game_gnp_impl(-1, 2, 0.5)) + expect_snapshot_igraph_error(bipartite_game_gnp_impl( + n1 = -1, + n2 = 2, + p = 0.5 + )) }) # 170. bipartite_game_gnm_impl @@ -2506,11 +3788,15 @@ test_that("bipartite_game_gnp_impl errors", { test_that("bipartite_game_gnm_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(bipartite_game_gnm_impl(2, 2, 1)) expect_snapshot(bipartite_game_gnm_impl( - 2, - 2, - 1, + n1 = 2, + n2 = 2, + m = 1 + )) + expect_snapshot(bipartite_game_gnm_impl( + n1 = 2, + n2 = 2, + m = 1, directed = TRUE, mode = "in" )) @@ -2519,7 +3805,11 @@ test_that("bipartite_game_gnm_impl basic", { test_that("bipartite_game_gnm_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(bipartite_game_gnm_impl(-1, 2, 1)) + expect_snapshot_igraph_error(bipartite_game_gnm_impl( + n1 = -1, + n2 = 2, + m = 1 + )) }) # 171. get_laplacian_impl @@ -2527,10 +3817,15 @@ test_that("bipartite_game_gnm_impl errors", { test_that("get_laplacian_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(get_laplacian_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(get_laplacian_impl( + graph = g + )) expect_snapshot(get_laplacian_impl( - g, + graph = g, mode = "in", normalization = "symmetric", weights = c(1, 2) @@ -2540,7 +3835,9 @@ test_that("get_laplacian_impl basic", { test_that("get_laplacian_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(get_laplacian_impl(NULL)) + expect_snapshot_igraph_error(get_laplacian_impl( + graph = NULL + )) }) # 172. get_laplacian_sparse_impl @@ -2548,10 +3845,15 @@ test_that("get_laplacian_impl errors", { test_that("get_laplacian_sparse_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(get_laplacian_sparse_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(get_laplacian_sparse_impl( + graph = g + )) expect_snapshot(get_laplacian_sparse_impl( - g, + graph = g, mode = "in", normalization = "symmetric", weights = c(1, 2) @@ -2561,7 +3863,9 @@ test_that("get_laplacian_sparse_impl basic", { test_that("get_laplacian_sparse_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(get_laplacian_sparse_impl(NULL)) + expect_snapshot_igraph_error(get_laplacian_sparse_impl( + graph = NULL + )) }) # 173. connected_components_impl @@ -2569,15 +3873,26 @@ test_that("get_laplacian_sparse_impl errors", { test_that("connected_components_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(connected_components_impl(g)) - expect_snapshot(connected_components_impl(g, mode = "strong", details = TRUE)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(connected_components_impl( + graph = g + )) + expect_snapshot(connected_components_impl( + graph = g, + mode = "strong", + details = TRUE + )) }) test_that("connected_components_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(connected_components_impl(NULL)) + expect_snapshot_igraph_error(connected_components_impl( + graph = NULL + )) }) # 174. is_connected_impl @@ -2585,15 +3900,25 @@ test_that("connected_components_impl errors", { test_that("is_connected_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(is_connected_impl(g)) - expect_snapshot(is_connected_impl(g, mode = "strong")) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(is_connected_impl( + graph = g + )) + expect_snapshot(is_connected_impl( + graph = g, + mode = "strong" + )) }) test_that("is_connected_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(is_connected_impl(NULL)) + expect_snapshot_igraph_error(is_connected_impl( + graph = NULL + )) }) # 175. articulation_points_impl @@ -2601,14 +3926,21 @@ test_that("is_connected_impl errors", { test_that("articulation_points_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(articulation_points_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(articulation_points_impl( + graph = g + )) }) test_that("articulation_points_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(articulation_points_impl(NULL)) + expect_snapshot_igraph_error(articulation_points_impl( + graph = NULL + )) }) # 176. biconnected_components_impl @@ -2616,14 +3948,21 @@ test_that("articulation_points_impl errors", { test_that("biconnected_components_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(biconnected_components_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(biconnected_components_impl( + graph = g + )) }) test_that("biconnected_components_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(biconnected_components_impl(NULL)) + expect_snapshot_igraph_error(biconnected_components_impl( + graph = NULL + )) }) # 177. bridges_impl @@ -2631,14 +3970,21 @@ test_that("biconnected_components_impl errors", { test_that("bridges_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(bridges_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(bridges_impl( + graph = g + )) }) test_that("bridges_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(bridges_impl(NULL)) + expect_snapshot_igraph_error(bridges_impl( + graph = NULL + )) }) # 178. is_biconnected_impl @@ -2646,14 +3992,21 @@ test_that("bridges_impl errors", { test_that("is_biconnected_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(is_biconnected_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(is_biconnected_impl( + graph = g + )) }) test_that("is_biconnected_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(is_biconnected_impl(NULL)) + expect_snapshot_igraph_error(is_biconnected_impl( + graph = NULL + )) }) # 179. count_reachable_impl @@ -2661,15 +4014,27 @@ test_that("is_biconnected_impl errors", { test_that("count_reachable_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(5) - expect_snapshot(count_reachable_impl(g, mode = "out")) - expect_snapshot(count_reachable_impl(g, mode = "in")) + g <- path_graph_impl( + n = 5 + ) + + expect_snapshot(count_reachable_impl( + graph = g, + mode = "out" + )) + expect_snapshot(count_reachable_impl( + graph = g, + mode = "in" + )) }) test_that("count_reachable_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(count_reachable_impl(NULL, mode = "out")) + expect_snapshot_igraph_error(count_reachable_impl( + graph = NULL, + mode = "out" + )) }) # 180. bond_percolation_impl @@ -2677,14 +4042,21 @@ test_that("count_reachable_impl errors", { test_that("bond_percolation_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(bond_percolation_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(bond_percolation_impl( + graph = g + )) }) test_that("bond_percolation_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(bond_percolation_impl(NULL)) + expect_snapshot_igraph_error(bond_percolation_impl( + graph = NULL + )) }) # 181. site_percolation_impl @@ -2692,14 +4064,21 @@ test_that("bond_percolation_impl errors", { test_that("site_percolation_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(site_percolation_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(site_percolation_impl( + graph = g + )) }) test_that("site_percolation_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(site_percolation_impl(NULL)) + expect_snapshot_igraph_error(site_percolation_impl( + graph = NULL + )) }) # 182. edgelist_percolation_impl @@ -2707,13 +4086,18 @@ test_that("site_percolation_impl errors", { test_that("edgelist_percolation_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(edgelist_percolation_impl(matrix(c(1, 2, 2, 3), ncol = 2))) + expect_snapshot(edgelist_percolation_impl( + edges = matrix(c(1, + 2, 2, 3), ncol = 2) + )) }) test_that("edgelist_percolation_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(edgelist_percolation_impl("a")) + expect_snapshot_igraph_error(edgelist_percolation_impl( + edges = "a" + )) }) # 183. is_clique_impl @@ -2721,15 +4105,28 @@ test_that("edgelist_percolation_impl errors", { test_that("is_clique_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(is_clique_impl(g, 1:2)) - expect_snapshot(is_clique_impl(g, 1:2, directed = TRUE)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(is_clique_impl( + graph = g, + candidate = 1:2 + )) + expect_snapshot(is_clique_impl( + graph = g, + candidate = 1:2, + directed = TRUE + )) }) test_that("is_clique_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(is_clique_impl(NULL, 1:2)) + expect_snapshot_igraph_error(is_clique_impl( + graph = NULL, + candidate = 1:2 + )) }) # 184. cliques_impl @@ -2737,15 +4134,26 @@ test_that("is_clique_impl errors", { test_that("cliques_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(cliques_impl(g)) - expect_snapshot(cliques_impl(g, min = 2, max = 2)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(cliques_impl( + graph = g + )) + expect_snapshot(cliques_impl( + graph = g, + min = 2, + max = 2 + )) }) test_that("cliques_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(cliques_impl(NULL)) + expect_snapshot_igraph_error(cliques_impl( + graph = NULL + )) }) # 185. clique_size_hist_impl @@ -2753,15 +4161,26 @@ test_that("cliques_impl errors", { test_that("clique_size_hist_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(clique_size_hist_impl(g)) - expect_snapshot(clique_size_hist_impl(g, min.size = 2, max.size = 2)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(clique_size_hist_impl( + graph = g + )) + expect_snapshot(clique_size_hist_impl( + graph = g, + min.size = 2, + max.size = 2 + )) }) test_that("clique_size_hist_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(clique_size_hist_impl(NULL)) + expect_snapshot_igraph_error(clique_size_hist_impl( + graph = NULL + )) }) # 186. largest_cliques_impl @@ -2769,14 +4188,21 @@ test_that("clique_size_hist_impl errors", { test_that("largest_cliques_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(largest_cliques_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(largest_cliques_impl( + graph = g + )) }) test_that("largest_cliques_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(largest_cliques_impl(NULL)) + expect_snapshot_igraph_error(largest_cliques_impl( + graph = NULL + )) }) # 187. maximal_cliques_hist_impl @@ -2784,15 +4210,26 @@ test_that("largest_cliques_impl errors", { test_that("maximal_cliques_hist_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(maximal_cliques_hist_impl(g)) - expect_snapshot(maximal_cliques_hist_impl(g, min.size = 2, max.size = 2)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(maximal_cliques_hist_impl( + graph = g + )) + expect_snapshot(maximal_cliques_hist_impl( + graph = g, + min.size = 2, + max.size = 2 + )) }) test_that("maximal_cliques_hist_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(maximal_cliques_hist_impl(NULL)) + expect_snapshot_igraph_error(maximal_cliques_hist_impl( + graph = NULL + )) }) # 188. clique_number_impl @@ -2800,14 +4237,21 @@ test_that("maximal_cliques_hist_impl errors", { test_that("clique_number_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(clique_number_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(clique_number_impl( + graph = g + )) }) test_that("clique_number_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(clique_number_impl(NULL)) + expect_snapshot_igraph_error(clique_number_impl( + graph = NULL + )) }) # 189. weighted_cliques_impl @@ -2815,11 +4259,17 @@ test_that("clique_number_impl errors", { test_that("weighted_cliques_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(weighted_cliques_impl(g)) + g <- path_graph_impl( + n = 3 + ) + expect_snapshot(weighted_cliques_impl( - g, - vertex.weights = c(1, 2, 3), + graph = g + )) + expect_snapshot(weighted_cliques_impl( + graph = g, + vertex.weights = c(1, + 2, 3), min.weight = 1, max.weight = 3, maximal = TRUE @@ -2829,7 +4279,9 @@ test_that("weighted_cliques_impl basic", { test_that("weighted_cliques_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(weighted_cliques_impl(NULL)) + expect_snapshot_igraph_error(weighted_cliques_impl( + graph = NULL + )) }) # 190. largest_weighted_cliques_impl @@ -2837,15 +4289,26 @@ test_that("weighted_cliques_impl errors", { test_that("largest_weighted_cliques_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(largest_weighted_cliques_impl(g)) - expect_snapshot(largest_weighted_cliques_impl(g, vertex.weights = c(1, 2, 3))) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(largest_weighted_cliques_impl( + graph = g + )) + expect_snapshot(largest_weighted_cliques_impl( + graph = g, + vertex.weights = c(1, + 2, 3) + )) }) test_that("largest_weighted_cliques_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(largest_weighted_cliques_impl(NULL)) + expect_snapshot_igraph_error(largest_weighted_cliques_impl( + graph = NULL + )) }) # 191. weighted_clique_number_impl @@ -2853,15 +4316,26 @@ test_that("largest_weighted_cliques_impl errors", { test_that("weighted_clique_number_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(weighted_clique_number_impl(g)) - expect_snapshot(weighted_clique_number_impl(g, vertex.weights = c(1, 2, 3))) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(weighted_clique_number_impl( + graph = g + )) + expect_snapshot(weighted_clique_number_impl( + graph = g, + vertex.weights = c(1, + 2, 3) + )) }) test_that("weighted_clique_number_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(weighted_clique_number_impl(NULL)) + expect_snapshot_igraph_error(weighted_clique_number_impl( + graph = NULL + )) }) # 192. is_independent_vertex_set_impl @@ -2869,14 +4343,23 @@ test_that("weighted_clique_number_impl errors", { test_that("is_independent_vertex_set_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(is_independent_vertex_set_impl(g, 1:2)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(is_independent_vertex_set_impl( + graph = g, + candidate = 1:2 + )) }) test_that("is_independent_vertex_set_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(is_independent_vertex_set_impl(NULL, 1:2)) + expect_snapshot_igraph_error(is_independent_vertex_set_impl( + graph = NULL, + candidate = 1:2 + )) }) # 193. layout_random_impl @@ -2884,14 +4367,21 @@ test_that("is_independent_vertex_set_impl errors", { test_that("layout_random_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(layout_random_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(layout_random_impl( + graph = g + )) }) test_that("layout_random_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(layout_random_impl(NULL)) + expect_snapshot_igraph_error(layout_random_impl( + graph = NULL + )) }) # 194. layout_circle_impl @@ -2899,15 +4389,25 @@ test_that("layout_random_impl errors", { test_that("layout_circle_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(layout_circle_impl(g)) - expect_snapshot(layout_circle_impl(g, order = 1:3)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(layout_circle_impl( + graph = g + )) + expect_snapshot(layout_circle_impl( + graph = g, + order = 1:3 + )) }) test_that("layout_circle_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(layout_circle_impl(NULL)) + expect_snapshot_igraph_error(layout_circle_impl( + graph = NULL + )) }) # 195. layout_star_impl @@ -2915,15 +4415,32 @@ test_that("layout_circle_impl errors", { test_that("layout_star_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(round(layout_star_impl(g), 4)) - expect_snapshot(round(layout_star_impl(g, center = 1, order = 3:1), 4)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(round( + layout_star_impl( + graph = g + ), + 4 + )) + expect_snapshot(round( + layout_star_impl( + graph = g, + center = 1, + order = 3:1 + ), + 4 + )) }) test_that("layout_star_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(layout_star_impl(NULL)) + expect_snapshot_igraph_error(layout_star_impl( + graph = NULL + )) }) # 196. layout_grid_impl @@ -2931,15 +4448,25 @@ test_that("layout_star_impl errors", { test_that("layout_grid_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(layout_grid_impl(g)) - expect_snapshot(layout_grid_impl(g, width = 2)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(layout_grid_impl( + graph = g + )) + expect_snapshot(layout_grid_impl( + graph = g, + width = 2 + )) }) test_that("layout_grid_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(layout_grid_impl(NULL)) + expect_snapshot_igraph_error(layout_grid_impl( + graph = NULL + )) }) # 197. layout_grid_3d_impl @@ -2947,15 +4474,26 @@ test_that("layout_grid_impl errors", { test_that("layout_grid_3d_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(layout_grid_3d_impl(g)) - expect_snapshot(layout_grid_3d_impl(g, width = 2, height = 2)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(layout_grid_3d_impl( + graph = g + )) + expect_snapshot(layout_grid_3d_impl( + graph = g, + width = 2, + height = 2 + )) }) test_that("layout_grid_3d_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(layout_grid_3d_impl(NULL)) + expect_snapshot_igraph_error(layout_grid_3d_impl( + graph = NULL + )) }) # 198. roots_for_tree_layout_impl @@ -2963,15 +4501,26 @@ test_that("layout_grid_3d_impl errors", { test_that("roots_for_tree_layout_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(roots_for_tree_layout_impl(g, mode = "out", heuristic = 1)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(roots_for_tree_layout_impl( + graph = g, + mode = "out", + heuristic = 1 + )) }) test_that("roots_for_tree_layout_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - roots_for_tree_layout_impl(NULL, mode = "out", heuristic = 1) + roots_for_tree_layout_impl( + graph = NULL, + mode = "out", + heuristic = 1 + ) ) }) @@ -2980,14 +4529,21 @@ test_that("roots_for_tree_layout_impl errors", { test_that("layout_random_3d_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(layout_random_3d_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(layout_random_3d_impl( + graph = g + )) }) test_that("layout_random_3d_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(layout_random_3d_impl(NULL)) + expect_snapshot_igraph_error(layout_random_3d_impl( + graph = NULL + )) }) # 200. layout_sphere_impl @@ -2995,14 +4551,21 @@ test_that("layout_random_3d_impl errors", { test_that("layout_sphere_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(layout_sphere_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(layout_sphere_impl( + graph = g + )) }) test_that("layout_sphere_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(layout_sphere_impl(NULL)) + expect_snapshot_igraph_error(layout_sphere_impl( + graph = NULL + )) }) # 201. layout_sugiyama_impl @@ -3010,10 +4573,15 @@ test_that("layout_sphere_impl errors", { test_that("layout_sugiyama_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(layout_sugiyama_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(layout_sugiyama_impl( + graph = g + )) expect_snapshot(layout_sugiyama_impl( - g, + graph = g, layers = 1:3, hgap = 2, vgap = 2, @@ -3025,7 +4593,9 @@ test_that("layout_sugiyama_impl basic", { test_that("layout_sugiyama_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(layout_sugiyama_impl(NULL)) + expect_snapshot_igraph_error(layout_sugiyama_impl( + graph = NULL + )) }) # 202. layout_mds_impl @@ -3033,15 +4603,27 @@ test_that("layout_sugiyama_impl errors", { test_that("layout_mds_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(layout_mds_impl(g)) - expect_snapshot(layout_mds_impl(g, dist = matrix(1:9, nrow = 3), dim = 3)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(layout_mds_impl( + graph = g + )) + expect_snapshot(layout_mds_impl( + graph = g, + dist = matrix(1:9, + nrow = 3), + dim = 3 + )) }) test_that("layout_mds_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(layout_mds_impl(NULL)) + expect_snapshot_igraph_error(layout_mds_impl( + graph = NULL + )) }) # 203. layout_bipartite_impl @@ -3049,11 +4631,19 @@ test_that("layout_mds_impl errors", { test_that("layout_bipartite_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(layout_bipartite_impl(g, types = c(TRUE, FALSE, TRUE))) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(layout_bipartite_impl( + graph = g, + types = c(TRUE, FALSE, + TRUE) + )) expect_snapshot(layout_bipartite_impl( - g, - types = c(TRUE, FALSE, TRUE), + graph = g, + types = c(TRUE, FALSE, + TRUE), hgap = 2, vgap = 2, maxiter = 10 @@ -3064,7 +4654,11 @@ test_that("layout_bipartite_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - layout_bipartite_impl(NULL, types = c(TRUE, FALSE, TRUE)) + layout_bipartite_impl( + graph = NULL, + types = c(TRUE, FALSE, + TRUE) + ) ) }) @@ -3073,11 +4667,19 @@ test_that("layout_bipartite_impl errors", { test_that("layout_gem_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(layout_gem_impl(g, res = matrix(0, nrow = 3, ncol = 2))) + g <- path_graph_impl( + n = 3 + ) + expect_snapshot(layout_gem_impl( - g, - res = matrix(0, nrow = 3, ncol = 2), + graph = g, + res = matrix(0, nrow = 3, + ncol = 2) + )) + expect_snapshot(layout_gem_impl( + graph = g, + res = matrix(0, nrow = 3, + ncol = 2), use.seed = TRUE, maxiter = 10, temp.max = 2, @@ -3090,7 +4692,11 @@ test_that("layout_gem_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - layout_gem_impl(NULL, res = matrix(0, nrow = 3, ncol = 2)) + layout_gem_impl( + graph = NULL, + res = matrix(0, nrow = 3, + ncol = 2) + ) ) }) @@ -3099,14 +4705,19 @@ test_that("layout_gem_impl errors", { test_that("layout_davidson_harel_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) + g <- path_graph_impl( + n = 3 + ) + expect_snapshot(layout_davidson_harel_impl( - g, - res = matrix(0, nrow = 3, ncol = 2) + graph = g, + res = matrix(0, nrow = 3, + ncol = 2) )) expect_snapshot(layout_davidson_harel_impl( - g, - res = matrix(0, nrow = 3, ncol = 2), + graph = g, + res = matrix(0, nrow = 3, + ncol = 2), use.seed = TRUE, maxiter = 10, fineiter = 5, @@ -3123,7 +4734,11 @@ test_that("layout_davidson_harel_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - layout_davidson_harel_impl(NULL, res = matrix(0, nrow = 3, ncol = 2)) + layout_davidson_harel_impl( + graph = NULL, + res = matrix(0, nrow = 3, + ncol = 2) + ) ) }) @@ -3132,15 +4747,20 @@ test_that("layout_davidson_harel_impl errors", { test_that("layout_umap_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) + g <- path_graph_impl( + n = 3 + ) + expect_snapshot(layout_umap_impl( - g, - res = matrix(0, nrow = 3, ncol = 2), + graph = g, + res = matrix(0, nrow = 3, + ncol = 2), use.seed = TRUE )) expect_snapshot(layout_umap_impl( - g, - res = matrix(0, nrow = 3, ncol = 2), + graph = g, + res = matrix(0, nrow = 3, + ncol = 2), use.seed = TRUE, distances = 1:3, min.dist = 0.1, @@ -3153,7 +4773,11 @@ test_that("layout_umap_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - layout_umap_impl(NULL, res = matrix(0, nrow = 3, ncol = 2)) + layout_umap_impl( + graph = NULL, + res = matrix(0, nrow = 3, + ncol = 2) + ) ) }) @@ -3162,15 +4786,20 @@ test_that("layout_umap_impl errors", { test_that("layout_umap_3d_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) + g <- path_graph_impl( + n = 3 + ) + expect_snapshot(layout_umap_3d_impl( - g, - res = matrix(0, nrow = 3, ncol = 3), - use.see = TRUE + graph = g, + res = matrix(0, nrow = 3, + ncol = 3), + use.seed = TRUE )) expect_snapshot(layout_umap_3d_impl( - g, - res = matrix(0, nrow = 3, ncol = 3), + graph = g, + res = matrix(0, nrow = 3, + ncol = 3), use.seed = TRUE, distances = 1:3, min.dist = 0.1, @@ -3183,7 +4812,11 @@ test_that("layout_umap_3d_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - layout_umap_3d_impl(NULL, res = matrix(0, nrow = 3, ncol = 3)) + layout_umap_3d_impl( + graph = NULL, + res = matrix(0, nrow = 3, + ncol = 3) + ) ) }) @@ -3192,9 +4825,12 @@ test_that("layout_umap_3d_impl errors", { test_that("layout_umap_compute_weights_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) + g <- path_graph_impl( + n = 3 + ) + expect_snapshot(layout_umap_compute_weights_impl( - g, + graph = g, distances = 1:2, weights = 1:3 )) @@ -3204,7 +4840,11 @@ test_that("layout_umap_compute_weights_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - layout_umap_compute_weights_impl(NULL, distances = 1:3, weights = 1:3) + layout_umap_compute_weights_impl( + graph = NULL, + distances = 1:3, + weights = 1:3 + ) ) }) @@ -3213,15 +4853,26 @@ test_that("layout_umap_compute_weights_impl errors", { test_that("layout_align_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(layout_align_impl(g, layout = matrix(0, nrow = 3, ncol = 2))) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(layout_align_impl( + graph = g, + layout = matrix(0, + nrow = 3, ncol = 2) + )) }) test_that("layout_align_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - layout_align_impl(NULL, layout = matrix(0, nrow = 3, ncol = 2)) + layout_align_impl( + graph = NULL, + layout = matrix(0, + nrow = 3, ncol = 2) + ) ) }) @@ -3230,10 +4881,15 @@ test_that("layout_align_impl errors", { test_that("similarity_dice_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(similarity_dice_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(similarity_dice_impl( + graph = g + )) expect_snapshot(similarity_dice_impl( - g, + graph = g, vids = 1:2, mode = "in", loops = TRUE @@ -3243,7 +4899,9 @@ test_that("similarity_dice_impl basic", { test_that("similarity_dice_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(similarity_dice_impl(NULL)) + expect_snapshot_igraph_error(similarity_dice_impl( + graph = NULL + )) }) # 211. similarity_dice_es_impl @@ -3251,10 +4909,15 @@ test_that("similarity_dice_impl errors", { test_that("similarity_dice_es_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(similarity_dice_es_impl(g)) + g <- path_graph_impl( + n = 3 + ) + expect_snapshot(similarity_dice_es_impl( - g, + graph = g + )) + expect_snapshot(similarity_dice_es_impl( + graph = g, es = 1:2, mode = "in", loops = TRUE @@ -3264,7 +4927,9 @@ test_that("similarity_dice_es_impl basic", { test_that("similarity_dice_es_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(similarity_dice_es_impl(NULL)) + expect_snapshot_igraph_error(similarity_dice_es_impl( + graph = NULL + )) }) # 212. similarity_dice_pairs_impl @@ -3272,14 +4937,19 @@ test_that("similarity_dice_es_impl errors", { test_that("similarity_dice_pairs_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(4) + g <- path_graph_impl( + n = 4 + ) + expect_snapshot(similarity_dice_pairs_impl( - g, - pairs = matrix(c(1, 2, 2, 3), ncol = 2) + graph = g, + pairs = matrix(c(1, + 2, 2, 3), ncol = 2) )) expect_snapshot(similarity_dice_pairs_impl( - g, - pairs = matrix(c(1, 2, 2, 3), ncol = 2), + graph = g, + pairs = matrix(c(1, + 2, 2, 3), ncol = 2), mode = "in", loops = TRUE )) @@ -3289,7 +4959,11 @@ test_that("similarity_dice_pairs_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - similarity_dice_pairs_impl(NULL, pairs = matrix(c(1, 2, 2, 3), ncol = 2)) + similarity_dice_pairs_impl( + graph = NULL, + pairs = matrix(c(1, + 2, 2, 3), ncol = 2) + ) ) }) @@ -3298,10 +4972,15 @@ test_that("similarity_dice_pairs_impl errors", { test_that("similarity_inverse_log_weighted_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(similarity_inverse_log_weighted_impl(g)) + g <- path_graph_impl( + n = 3 + ) + expect_snapshot(similarity_inverse_log_weighted_impl( - g, + graph = g + )) + expect_snapshot(similarity_inverse_log_weighted_impl( + graph = g, vids = 1:2, mode = "in" )) @@ -3310,7 +4989,9 @@ test_that("similarity_inverse_log_weighted_impl basic", { test_that("similarity_inverse_log_weighted_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(similarity_inverse_log_weighted_impl(NULL)) + expect_snapshot_igraph_error(similarity_inverse_log_weighted_impl( + graph = NULL + )) }) # 214. similarity_jaccard_impl @@ -3318,10 +4999,15 @@ test_that("similarity_inverse_log_weighted_impl errors", { test_that("similarity_jaccard_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(similarity_jaccard_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(similarity_jaccard_impl( + graph = g + )) expect_snapshot(similarity_jaccard_impl( - g, + graph = g, vids = 1:2, mode = "in", loops = TRUE @@ -3331,7 +5017,9 @@ test_that("similarity_jaccard_impl basic", { test_that("similarity_jaccard_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(similarity_jaccard_impl(NULL)) + expect_snapshot_igraph_error(similarity_jaccard_impl( + graph = NULL + )) }) # 215. similarity_jaccard_es_impl @@ -3339,10 +5027,15 @@ test_that("similarity_jaccard_impl errors", { test_that("similarity_jaccard_es_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(similarity_jaccard_es_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(similarity_jaccard_es_impl( + graph = g + )) expect_snapshot(similarity_jaccard_es_impl( - g, + graph = g, es = 1:2, mode = "in", loops = TRUE @@ -3352,7 +5045,9 @@ test_that("similarity_jaccard_es_impl basic", { test_that("similarity_jaccard_es_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(similarity_jaccard_es_impl(NULL)) + expect_snapshot_igraph_error(similarity_jaccard_es_impl( + graph = NULL + )) }) # 216. similarity_jaccard_pairs_impl @@ -3360,14 +5055,19 @@ test_that("similarity_jaccard_es_impl errors", { test_that("similarity_jaccard_pairs_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(4) + g <- path_graph_impl( + n = 4 + ) + expect_snapshot(similarity_jaccard_pairs_impl( - g, - pairs = matrix(c(1, 2, 2, 3), ncol = 2) + graph = g, + pairs = matrix(c(1, + 2, 2, 3), ncol = 2) )) expect_snapshot(similarity_jaccard_pairs_impl( - g, - pairs = matrix(c(1, 2, 2, 3), ncol = 2), + graph = g, + pairs = matrix(c(1, + 2, 2, 3), ncol = 2), mode = "in", loops = TRUE )) @@ -3377,7 +5077,11 @@ test_that("similarity_jaccard_pairs_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - similarity_jaccard_pairs_impl(NULL, pairs = matrix(c(1, 2, 2, 3), ncol = 2)) + similarity_jaccard_pairs_impl( + graph = NULL, + pairs = matrix(c(1, + 2, 2, 3), ncol = 2) + ) ) }) @@ -3386,10 +5090,17 @@ test_that("similarity_jaccard_pairs_impl errors", { test_that("compare_communities_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(compare_communities_impl(c(1, 2, 1), c(2, 1, 2))) expect_snapshot(compare_communities_impl( - c(1, 2, 1), - c(2, 1, 2), + comm1 = c(1, + 2, 1), + comm2 = c(2, + 1, 2) + )) + expect_snapshot(compare_communities_impl( + comm1 = c(1, + 2, 1), + comm2 = c(2, + 1, 2), method = "nmi" )) }) @@ -3397,7 +5108,10 @@ test_that("compare_communities_impl basic", { test_that("compare_communities_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(compare_communities_impl("a", c(2, 1, 2))) + expect_snapshot_igraph_error(compare_communities_impl( + comm1 = "a", + comm2 = c(2, 1, 2) + )) }) # 218. modularity_impl @@ -3405,12 +5119,21 @@ test_that("compare_communities_impl errors", { test_that("modularity_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(modularity_impl(g, membership = c(1, 2, 1))) + g <- path_graph_impl( + n = 3 + ) + expect_snapshot(modularity_impl( - g, - membership = c(1, 2, 1), - weights = c(1, 2), + graph = g, + membership = c(1, + 2, 1) + )) + expect_snapshot(modularity_impl( + graph = g, + membership = c(1, + 2, 1), + weights = c(1, + 2), resolution = 0.5, directed = FALSE )) @@ -3419,7 +5142,11 @@ test_that("modularity_impl basic", { test_that("modularity_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(modularity_impl(NULL, membership = c(1, 2, 1))) + expect_snapshot_igraph_error(modularity_impl( + graph = NULL, + membership = c(1, + 2, 1) + )) }) # 219. modularity_matrix_impl @@ -3427,10 +5154,15 @@ test_that("modularity_impl errors", { test_that("modularity_matrix_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(modularity_matrix_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(modularity_matrix_impl( + graph = g + )) expect_snapshot(modularity_matrix_impl( - g, + graph = g, weights = c(1, 2), resolution = 0.5, directed = FALSE @@ -3440,7 +5172,9 @@ test_that("modularity_matrix_impl basic", { test_that("modularity_matrix_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(modularity_matrix_impl(NULL)) + expect_snapshot_igraph_error(modularity_matrix_impl( + graph = NULL + )) }) # 220. community_fluid_communities_impl @@ -3448,15 +5182,24 @@ test_that("modularity_matrix_impl errors", { test_that("community_fluid_communities_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(community_fluid_communities_impl(g, no.of.communities = 2)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(community_fluid_communities_impl( + graph = g, + no.of.communities = 2 + )) }) test_that("community_fluid_communities_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - community_fluid_communities_impl(NULL, no.of.communities = 2) + community_fluid_communities_impl( + graph = NULL, + no.of.communities = 2 + ) ) }) @@ -3465,21 +5208,30 @@ test_that("community_fluid_communities_impl errors", { test_that("community_label_propagation_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(community_label_propagation_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(community_label_propagation_impl( + graph = g + )) expect_snapshot(community_label_propagation_impl( - g, + graph = g, mode = "in", - weights = c(1, 2), + weights = c(1, + 2), initial = 1:3, - fixed = c(TRUE, FALSE, TRUE) + fixed = c(TRUE, FALSE, + TRUE) )) }) test_that("community_label_propagation_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(community_label_propagation_impl(NULL)) + expect_snapshot_igraph_error(community_label_propagation_impl( + graph = NULL + )) }) # 222. community_multilevel_impl @@ -3487,10 +5239,15 @@ test_that("community_label_propagation_impl errors", { test_that("community_multilevel_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(community_multilevel_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(community_multilevel_impl( + graph = g + )) expect_snapshot(community_multilevel_impl( - g, + graph = g, weights = c(1, 2), resolution = 0.5 )) @@ -3499,7 +5256,9 @@ test_that("community_multilevel_impl basic", { test_that("community_multilevel_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(community_multilevel_impl(NULL)) + expect_snapshot_igraph_error(community_multilevel_impl( + graph = NULL + )) }) # 223. community_optimal_modularity_impl @@ -3507,15 +5266,25 @@ test_that("community_multilevel_impl errors", { test_that("community_optimal_modularity_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(community_optimal_modularity_impl(g)) - expect_snapshot(community_optimal_modularity_impl(g, weights = c(1, 2))) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(community_optimal_modularity_impl( + graph = g + )) + expect_snapshot(community_optimal_modularity_impl( + graph = g, + weights = c(1, 2) + )) }) test_that("community_optimal_modularity_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(community_optimal_modularity_impl(NULL)) + expect_snapshot_igraph_error(community_optimal_modularity_impl( + graph = NULL + )) }) # 224. community_leiden_impl @@ -3523,11 +5292,15 @@ test_that("community_optimal_modularity_impl errors", { test_that("community_leiden_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) + g <- path_graph_impl( + n = 3 + ) + expect_snapshot(community_leiden_impl( - g, + graph = g, weights = c(1, 2), - vertex.weights = c(1, 2, 3), + vertex.weights = c(1, + 2, 3), resolution = 0.5, beta = 0.1, start = TRUE, @@ -3539,7 +5312,10 @@ test_that("community_leiden_impl basic", { test_that("community_leiden_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(community_leiden_impl(NULL, resolution = 1)) + expect_snapshot_igraph_error(community_leiden_impl( + graph = NULL, + resolution = 1 + )) }) # 225. split_join_distance_impl @@ -3547,13 +5323,21 @@ test_that("community_leiden_impl errors", { test_that("split_join_distance_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(split_join_distance_impl(c(1, 2, 1), c(2, 1, 2))) + expect_snapshot(split_join_distance_impl( + comm1 = c(1, + 2, 1), + comm2 = c(2, + 1, 2) + )) }) test_that("split_join_distance_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(split_join_distance_impl("a", c(2, 1, 2))) + expect_snapshot_igraph_error(split_join_distance_impl( + comm1 = "a", + comm2 = c(2, 1, 2) + )) }) # 226. community_infomap_impl @@ -3561,12 +5345,19 @@ test_that("split_join_distance_impl errors", { test_that("community_infomap_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(community_infomap_impl(g)) + g <- path_graph_impl( + n = 3 + ) + expect_snapshot(community_infomap_impl( - g, - e.weights = c(1, 2), - v.weights = c(1, 2, 3), + graph = g + )) + expect_snapshot(community_infomap_impl( + graph = g, + e.weights = c(1, + 2), + v.weights = c(1, + 2, 3), nb.trials = 2 )) }) @@ -3574,7 +5365,9 @@ test_that("community_infomap_impl basic", { test_that("community_infomap_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(community_infomap_impl(NULL)) + expect_snapshot_igraph_error(community_infomap_impl( + graph = NULL + )) }) # 227. graphlets_impl @@ -3582,16 +5375,27 @@ test_that("community_infomap_impl errors", { test_that("graphlets_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) + g <- path_graph_impl( + n = 3 + ) + E(g)$weight <- 1:2 - expect_snapshot(graphlets_impl(g)) - expect_snapshot(graphlets_impl(g, weights = c(3, 4), niter = 10)) + expect_snapshot(graphlets_impl( + graph = g + )) + expect_snapshot(graphlets_impl( + graph = g, + weights = c(3, 4), + niter = 10 + )) }) test_that("graphlets_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(graphlets_impl(NULL)) + expect_snapshot_igraph_error(graphlets_impl( + graph = NULL + )) }) # 228. hrg_fit_impl @@ -3599,14 +5403,21 @@ test_that("graphlets_impl errors", { test_that("hrg_fit_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g1 <- path_graph_impl(3) - expect_snapshot(hrg_fit_impl(g1)) + g1 <- path_graph_impl( + n = 3 + ) + + expect_snapshot(hrg_fit_impl( + graph = g1 + )) }) test_that("hrg_fit_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(hrg_fit_impl(NULL)) + expect_snapshot_igraph_error(hrg_fit_impl( + graph = NULL + )) }) # 229. hrg_sample_impl @@ -3617,14 +5428,18 @@ test_that("hrg_sample_impl basic", { local_igraph_options(print.id = FALSE) g <- make_full_graph(10) hrg_model <- fit_hrg(g, hrg = NULL, start = FALSE, steps = 0) - expect_snapshot(hrg_sample_impl(hrg_model)) + expect_snapshot(hrg_sample_impl( + hrg = hrg_model + )) }) test_that("hrg_sample_impl errors", { skip_if(Sys.getenv("R_SANITIZER") == "true") withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(hrg_sample_impl(NULL)) + expect_snapshot_igraph_error(hrg_sample_impl( + hrg = NULL + )) }) # 230. hrg_sample_many_impl @@ -3635,14 +5450,20 @@ test_that("hrg_sample_many_impl basic", { local_igraph_options(print.id = FALSE) g <- make_full_graph(10) hrg_model <- fit_hrg(g, hrg = NULL, start = FALSE, steps = 0) - expect_snapshot(hrg_sample_many_impl(hrg_model, num.samples = 2)) + expect_snapshot(hrg_sample_many_impl( + hrg = hrg_model, + num.samples = 2 + )) }) test_that("hrg_sample_many_impl errors", { skip_if(Sys.getenv("R_SANITIZER") == "true") withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(hrg_sample_many_impl(NULL, num.samples = 2)) + expect_snapshot_igraph_error(hrg_sample_many_impl( + hrg = NULL, + num.samples = 2 + )) }) # 231. hrg_game_impl @@ -3653,14 +5474,18 @@ test_that("hrg_game_impl basic", { local_igraph_options(print.id = FALSE) g <- make_full_graph(10) hrg_model <- fit_hrg(g, hrg = NULL, start = FALSE, steps = 0) - expect_snapshot(hrg_game_impl(hrg_model)) + expect_snapshot(hrg_game_impl( + hrg = hrg_model + )) }) test_that("hrg_game_impl errors", { skip_if(Sys.getenv("R_SANITIZER") == "true") withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(hrg_game_impl(NULL)) + expect_snapshot_igraph_error(hrg_game_impl( + hrg = NULL + )) }) # 232. hrg_consensus_impl @@ -3677,7 +5502,9 @@ test_that("hrg_game_impl errors", { test_that("hrg_consensus_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(hrg_consensus_impl(NULL)) + expect_snapshot_igraph_error(hrg_consensus_impl( + graph = NULL + )) }) # 233. hrg_predict_impl @@ -3694,7 +5521,9 @@ test_that("hrg_consensus_impl errors", { test_that("hrg_predict_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(hrg_predict_impl(NULL)) + expect_snapshot_igraph_error(hrg_predict_impl( + graph = NULL + )) }) # 234. hrg_create_impl @@ -3703,14 +5532,20 @@ test_that("hrg_create_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) g <- make_tree(5) - expect_snapshot(hrg_create_impl(g, prob = rep(0.5, 2))) + expect_snapshot(hrg_create_impl( + graph = g, + prob = rep(0.5, 2) + )) }) test_that("hrg_create_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) g <- make_full_graph(4, directed = TRUE) - expect_snapshot_igraph_error(hrg_create_impl(g, prob = 0.5)) + expect_snapshot_igraph_error(hrg_create_impl( + graph = g, + prob = 0.5 + )) }) # 235. hrg_resize_impl @@ -3721,14 +5556,20 @@ test_that("hrg_resize_impl basic", { local_igraph_options(print.id = FALSE) g <- make_full_graph(10) hrg_model <- fit_hrg(g, hrg = NULL, start = FALSE, steps = 0) - expect_snapshot(hrg_resize_impl(hrg_model, newsize = 5)) + expect_snapshot(hrg_resize_impl( + hrg = hrg_model, + newsize = 5 + )) }) test_that("hrg_resize_impl errors", { skip_if(Sys.getenv("R_SANITIZER") == "true") withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(hrg_resize_impl(-1, newsize = 2)) + expect_snapshot_igraph_error(hrg_resize_impl( + hrg = -1, + newsize = 2 + )) }) # 236. hrg_size_impl @@ -3739,14 +5580,18 @@ test_that("hrg_size_impl basic", { local_igraph_options(print.id = FALSE) g <- make_full_graph(10) hrg_model <- fit_hrg(g, hrg = NULL, start = FALSE, steps = 0) - expect_snapshot(hrg_size_impl(hrg_model)) + expect_snapshot(hrg_size_impl( + hrg = hrg_model + )) }) test_that("hrg_size_impl errors", { skip_if(Sys.getenv("R_SANITIZER") == "true") withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(hrg_size_impl(-1)) + expect_snapshot_igraph_error(hrg_size_impl( + hrg = -1 + )) }) # 237. from_hrg_dendrogram_impl @@ -3756,13 +5601,17 @@ test_that("from_hrg_dendrogram_impl basic", { local_igraph_options(print.id = FALSE) g <- make_full_graph(10) hrg_model <- fit_hrg(g, hrg = NULL, start = FALSE, steps = 0) - expect_snapshot(from_hrg_dendrogram_impl(hrg_model)) + expect_snapshot(from_hrg_dendrogram_impl( + hrg = hrg_model + )) }) test_that("from_hrg_dendrogram_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(from_hrg_dendrogram_impl(-1)) + expect_snapshot_igraph_error(from_hrg_dendrogram_impl( + hrg = -1 + )) }) # 238. get_adjacency_sparse_impl @@ -3770,12 +5619,18 @@ test_that("from_hrg_dendrogram_impl errors", { test_that("get_adjacency_sparse_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(get_adjacency_sparse_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(get_adjacency_sparse_impl( + graph = g + )) expect_snapshot(get_adjacency_sparse_impl( - g, + graph = g, type = "upper", - weights = c(1, 2), + weights = c(1, + 2), loops = "none" )) }) @@ -3783,7 +5638,9 @@ test_that("get_adjacency_sparse_impl basic", { test_that("get_adjacency_sparse_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(get_adjacency_sparse_impl(NULL)) + expect_snapshot_igraph_error(get_adjacency_sparse_impl( + graph = NULL + )) }) # 239. get_stochastic_impl @@ -3791,15 +5648,26 @@ test_that("get_adjacency_sparse_impl errors", { test_that("get_stochastic_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(get_stochastic_impl(g)) - expect_snapshot(get_stochastic_impl(g, column.wise = TRUE, weights = c(1, 2))) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(get_stochastic_impl( + graph = g + )) + expect_snapshot(get_stochastic_impl( + graph = g, + column.wise = TRUE, + weights = c(1, 2) + )) }) test_that("get_stochastic_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(get_stochastic_impl(NULL)) + expect_snapshot_igraph_error(get_stochastic_impl( + graph = NULL + )) }) # 240. get_stochastic_sparse_impl @@ -3807,10 +5675,15 @@ test_that("get_stochastic_impl errors", { test_that("get_stochastic_sparse_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(get_stochastic_sparse_impl(g)) + g <- path_graph_impl( + n = 3 + ) + expect_snapshot(get_stochastic_sparse_impl( - g, + graph = g + )) + expect_snapshot(get_stochastic_sparse_impl( + graph = g, column.wise = TRUE, weights = c(1, 2) )) @@ -3819,7 +5692,9 @@ test_that("get_stochastic_sparse_impl basic", { test_that("get_stochastic_sparse_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(get_stochastic_sparse_impl(NULL)) + expect_snapshot_igraph_error(get_stochastic_sparse_impl( + graph = NULL + )) }) # 241. to_directed_impl @@ -3827,15 +5702,25 @@ test_that("get_stochastic_sparse_impl errors", { test_that("to_directed_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(to_directed_impl(g)) - expect_snapshot(to_directed_impl(g, mode = "acyclic")) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(to_directed_impl( + graph = g + )) + expect_snapshot(to_directed_impl( + graph = g, + mode = "acyclic" + )) }) test_that("to_directed_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(to_directed_impl(NULL)) + expect_snapshot_igraph_error(to_directed_impl( + graph = NULL + )) }) # 242. to_undirected_impl @@ -3843,10 +5728,15 @@ test_that("to_directed_impl errors", { test_that("to_undirected_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(to_undirected_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(to_undirected_impl( + graph = g + )) expect_snapshot(to_undirected_impl( - g, + graph = g, mode = "mutual", edge.attr.comb = "sum" )) @@ -3855,7 +5745,9 @@ test_that("to_undirected_impl basic", { test_that("to_undirected_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(to_undirected_impl(NULL)) + expect_snapshot_igraph_error(to_undirected_impl( + graph = NULL + )) }) # 243. motifs_randesu_impl @@ -3863,15 +5755,26 @@ test_that("to_undirected_impl errors", { test_that("motifs_randesu_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(motifs_randesu_impl(g)) - expect_snapshot(motifs_randesu_impl(g, size = 4, cut.prob = rep(0.1, 4))) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(motifs_randesu_impl( + graph = g + )) + expect_snapshot(motifs_randesu_impl( + graph = g, + size = 4, + cut.prob = rep(0.1, 4) + )) }) test_that("motifs_randesu_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(motifs_randesu_impl(NULL)) + expect_snapshot_igraph_error(motifs_randesu_impl( + graph = NULL + )) }) # 244. motifs_randesu_estimate_impl @@ -3879,10 +5782,17 @@ test_that("motifs_randesu_impl errors", { test_that("motifs_randesu_estimate_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(6) - expect_snapshot(motifs_randesu_estimate_impl(g, size = 3, sample.size = 2)) + g <- path_graph_impl( + n = 6 + ) + + expect_snapshot(motifs_randesu_estimate_impl( + graph = g, + size = 3, + sample.size = 2 + )) expect_snapshot(motifs_randesu_estimate_impl( - g, + graph = g, size = 4, cut.prob = rep(0.1, 4), sample.size = 2, @@ -3894,7 +5804,11 @@ test_that("motifs_randesu_estimate_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - motifs_randesu_estimate_impl(NULL, size = 3, sample.size = 2) + motifs_randesu_estimate_impl( + graph = NULL, + size = 3, + sample.size = 2 + ) ) }) @@ -3903,21 +5817,34 @@ test_that("motifs_randesu_estimate_impl errors", { test_that("motifs_randesu_no_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(motifs_randesu_no_impl(g)) + g <- path_graph_impl( + n = 3 + ) + expect_snapshot(motifs_randesu_no_impl( - g, + graph = g + )) + expect_snapshot(motifs_randesu_no_impl( + graph = g, size = 4, - cut.prob = c(0.1, 0.1, 0.1, 0.1) + cut.prob = c(0.1, + 0.1, 0.1, 0.1) )) }) test_that("motifs_randesu_no_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) + g <- path_graph_impl( + n = 3 + ) + expect_snapshot_igraph_error( - motifs_randesu_no_impl(g, size = 3, cut.prob = c(0.1)) + motifs_randesu_no_impl( + graph = g, + size = 3, + cut.prob = c(0.1) + ) ) }) @@ -3926,14 +5853,21 @@ test_that("motifs_randesu_no_impl errors", { test_that("dyad_census_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(dyad_census_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(dyad_census_impl( + graph = g + )) }) test_that("dyad_census_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(dyad_census_impl(NULL)) + expect_snapshot_igraph_error(dyad_census_impl( + graph = NULL + )) }) # 247. triad_census_impl @@ -3941,14 +5875,21 @@ test_that("dyad_census_impl errors", { test_that("triad_census_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(triad_census_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(triad_census_impl( + graph = g + )) }) test_that("triad_census_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(triad_census_impl(NULL)) + expect_snapshot_igraph_error(triad_census_impl( + graph = NULL + )) }) # 248. count_adjacent_triangles_impl @@ -3956,15 +5897,25 @@ test_that("triad_census_impl errors", { test_that("count_adjacent_triangles_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(count_adjacent_triangles_impl(g)) - expect_snapshot(count_adjacent_triangles_impl(g, vids = 1:2)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(count_adjacent_triangles_impl( + graph = g + )) + expect_snapshot(count_adjacent_triangles_impl( + graph = g, + vids = 1:2 + )) }) test_that("count_adjacent_triangles_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(count_adjacent_triangles_impl(NULL)) + expect_snapshot_igraph_error(count_adjacent_triangles_impl( + graph = NULL + )) }) # 249. count_triangles_impl @@ -3972,14 +5923,21 @@ test_that("count_adjacent_triangles_impl errors", { test_that("count_triangles_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(count_triangles_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(count_triangles_impl( + graph = g + )) }) test_that("count_triangles_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(count_triangles_impl(NULL)) + expect_snapshot_igraph_error(count_triangles_impl( + graph = NULL + )) }) # 250. local_scan_0_impl @@ -3987,15 +5945,26 @@ test_that("count_triangles_impl errors", { test_that("local_scan_0_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(local_scan_0_impl(g)) - expect_snapshot(local_scan_0_impl(g, weights = c(1, 2), mode = "in")) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(local_scan_0_impl( + graph = g + )) + expect_snapshot(local_scan_0_impl( + graph = g, + weights = c(1, 2), + mode = "in" + )) }) test_that("local_scan_0_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(local_scan_0_impl(NULL)) + expect_snapshot_igraph_error(local_scan_0_impl( + graph = NULL + )) }) # 251. local_scan_0_them_impl @@ -4003,13 +5972,23 @@ test_that("local_scan_0_impl errors", { test_that("local_scan_0_them_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g1 <- path_graph_impl(3) - g2 <- path_graph_impl(3) - expect_snapshot(local_scan_0_them_impl(g1, g2)) + g1 <- path_graph_impl( + n = 3 + ) + + g2 <- path_graph_impl( + n = 3 + ) + + expect_snapshot(local_scan_0_them_impl( + us = g1, + them = g2 + )) expect_snapshot(local_scan_0_them_impl( - g1, - g2, - weights.them = c(1, 2), + us = g1, + them = g2, + weights.them = c(1, + 2), mode = "in" )) }) @@ -4018,7 +5997,10 @@ test_that("local_scan_0_them_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - local_scan_0_them_impl(NULL, path_graph_impl(3)) + local_scan_0_them_impl( + us = NULL, + them = path_graph_impl(3) + ) ) }) @@ -4027,15 +6009,26 @@ test_that("local_scan_0_them_impl errors", { test_that("local_scan_1_ecount_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(local_scan_1_ecount_impl(g)) - expect_snapshot(local_scan_1_ecount_impl(g, weights = c(1, 2), mode = "in")) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(local_scan_1_ecount_impl( + graph = g + )) + expect_snapshot(local_scan_1_ecount_impl( + graph = g, + weights = c(1, 2), + mode = "in" + )) }) test_that("local_scan_1_ecount_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(local_scan_1_ecount_impl(NULL)) + expect_snapshot_igraph_error(local_scan_1_ecount_impl( + graph = NULL + )) }) # 253. local_scan_1_ecount_them_impl @@ -4043,13 +6036,23 @@ test_that("local_scan_1_ecount_impl errors", { test_that("local_scan_1_ecount_them_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g1 <- path_graph_impl(3) - g2 <- path_graph_impl(3) - expect_snapshot(local_scan_1_ecount_them_impl(g1, g2)) + g1 <- path_graph_impl( + n = 3 + ) + + g2 <- path_graph_impl( + n = 3 + ) + + expect_snapshot(local_scan_1_ecount_them_impl( + us = g1, + them = g2 + )) expect_snapshot(local_scan_1_ecount_them_impl( - g1, - g2, - weights.them = c(1, 2), + us = g1, + them = g2, + weights.them = c(1, + 2), mode = "in" )) }) @@ -4058,7 +6061,10 @@ test_that("local_scan_1_ecount_them_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - local_scan_1_ecount_them_impl(NULL, path_graph_impl(3)) + local_scan_1_ecount_them_impl( + us = NULL, + them = path_graph_impl(3) + ) ) }) @@ -4067,12 +6073,19 @@ test_that("local_scan_1_ecount_them_impl errors", { test_that("local_scan_k_ecount_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(local_scan_k_ecount_impl(g, k = 1)) + g <- path_graph_impl( + n = 3 + ) + expect_snapshot(local_scan_k_ecount_impl( - g, + graph = g, + k = 1 + )) + expect_snapshot(local_scan_k_ecount_impl( + graph = g, k = 1, - weights = c(1, 2), + weights = c(1, + 2), mode = "in" )) }) @@ -4080,7 +6093,10 @@ test_that("local_scan_k_ecount_impl basic", { test_that("local_scan_k_ecount_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(local_scan_k_ecount_impl(NULL, k = 1)) + expect_snapshot_igraph_error(local_scan_k_ecount_impl( + graph = NULL, + k = 1 + )) }) # 255. local_scan_k_ecount_them_impl @@ -4088,14 +6104,25 @@ test_that("local_scan_k_ecount_impl errors", { test_that("local_scan_k_ecount_them_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g1 <- path_graph_impl(3) - g2 <- path_graph_impl(3) - expect_snapshot(local_scan_k_ecount_them_impl(g1, g2, k = 1)) + g1 <- path_graph_impl( + n = 3 + ) + + g2 <- path_graph_impl( + n = 3 + ) + expect_snapshot(local_scan_k_ecount_them_impl( - g1, - g2, + us = g1, + them = g2, + k = 1 + )) + expect_snapshot(local_scan_k_ecount_them_impl( + us = g1, + them = g2, k = 1, - weights.them = c(1, 2), + weights.them = c(1, + 2), mode = "in" )) }) @@ -4104,7 +6131,11 @@ test_that("local_scan_k_ecount_them_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - local_scan_k_ecount_them_impl(NULL, path_graph_impl(3), k = 1) + local_scan_k_ecount_them_impl( + us = NULL, + them = path_graph_impl(3), + k = 1 + ) ) }) @@ -4113,14 +6144,18 @@ test_that("local_scan_k_ecount_them_impl errors", { test_that("local_scan_neighborhood_ecount_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(4) + g <- path_graph_impl( + n = 4 + ) + expect_snapshot(local_scan_neighborhood_ecount_impl( - g, + graph = g, neighborhoods = list(1:2, 2:3, 2:4, 2) )) expect_snapshot(local_scan_neighborhood_ecount_impl( - g, - weights = c(1, 2, 3), + graph = g, + weights = c(1, 2, + 3), neighborhoods = list(1:2, 1:3, 2:4, 1) )) }) @@ -4129,7 +6164,10 @@ test_that("local_scan_neighborhood_ecount_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - local_scan_neighborhood_ecount_impl(NULL, neighborhoods = list(1:2, 2:3)) + local_scan_neighborhood_ecount_impl( + graph = NULL, + neighborhoods = list(1:2, 2:3) + ) ) }) @@ -4138,24 +6176,42 @@ test_that("local_scan_neighborhood_ecount_impl errors", { test_that("local_scan_subset_ecount_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(4) + g <- path_graph_impl( + n = 4 + ) + expect_snapshot(local_scan_subset_ecount_impl( - g, - subsets = list(c(1.0, 2.0), c(2.0, 3.0)) + graph = g, + subsets = list( + c(1, + 2), + c(2, 3) + ) )) expect_snapshot(local_scan_subset_ecount_impl( - g, - weights = c(1.0, 2.0, 3.0), - subsets = list(c(1.0, 2.0), c(2.0, 3.0)) + graph = g, + weights = c(1, 2, + 3), + subsets = list( + c(1, + 2), + c(2, 3) + ) )) }) test_that("local_scan_subset_ecount_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(4) + g <- path_graph_impl( + n = 4 + ) + expect_snapshot_igraph_error( - local_scan_subset_ecount_impl(g, subsets = list(1:2, letters[2:3])) + local_scan_subset_ecount_impl( + graph = g, + subsets = list(1:2, letters[2:3]) + ) ) }) @@ -4164,14 +6220,21 @@ test_that("local_scan_subset_ecount_impl errors", { test_that("list_triangles_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(list_triangles_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(list_triangles_impl( + graph = g + )) }) test_that("list_triangles_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(list_triangles_impl(NULL)) + expect_snapshot_igraph_error(list_triangles_impl( + graph = NULL + )) }) # 259. join_impl @@ -4179,15 +6242,27 @@ test_that("list_triangles_impl errors", { test_that("join_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g1 <- path_graph_impl(3) - g2 <- path_graph_impl(3) - expect_snapshot(join_impl(g1, g2)) + g1 <- path_graph_impl( + n = 3 + ) + + g2 <- path_graph_impl( + n = 3 + ) + + expect_snapshot(join_impl( + left = g1, + right = g2 + )) }) test_that("join_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(join_impl(NULL, path_graph_impl(3))) + expect_snapshot_igraph_error(join_impl( + left = NULL, + right = path_graph_impl(3) + )) }) # 260. induced_subgraph_map_impl @@ -4195,16 +6270,31 @@ test_that("join_impl errors", { test_that("induced_subgraph_map_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(induced_subgraph_map_impl(g, 1:2, impl = "auto")) - expect_snapshot(induced_subgraph_map_impl(g, 1:2, impl = "copy_and_delete")) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(induced_subgraph_map_impl( + graph = g, + vids = 1:2, + impl = "auto" + )) + expect_snapshot(induced_subgraph_map_impl( + graph = g, + vids = 1:2, + impl = "copy_and_delete" + )) }) test_that("induced_subgraph_map_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - induced_subgraph_map_impl(NULL, 1:2, impl = "auto") + induced_subgraph_map_impl( + graph = NULL, + vids = 1:2, + impl = "auto" + ) ) }) @@ -4213,15 +6303,25 @@ test_that("induced_subgraph_map_impl errors", { test_that("mycielskian_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(mycielskian_impl(g)) - expect_snapshot(mycielskian_impl(g, k = 2)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(mycielskian_impl( + graph = g + )) + expect_snapshot(mycielskian_impl( + graph = g, + k = 2 + )) }) test_that("mycielskian_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(mycielskian_impl(NULL)) + expect_snapshot_igraph_error(mycielskian_impl( + graph = NULL + )) }) # 262. product_impl @@ -4229,16 +6329,32 @@ test_that("mycielskian_impl errors", { test_that("product_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g1 <- path_graph_impl(3) - g2 <- path_graph_impl(3) - expect_snapshot(product_impl(g1, g2)) - expect_snapshot(product_impl(g1, g2, type = "tensor")) + g1 <- path_graph_impl( + n = 3 + ) + + g2 <- path_graph_impl( + n = 3 + ) + + expect_snapshot(product_impl( + g1 = g1, + g2 = g2 + )) + expect_snapshot(product_impl( + g1 = g1, + g2 = g2, + type = "tensor" + )) }) test_that("product_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(product_impl(NULL, path_graph_impl(3))) + expect_snapshot_igraph_error(product_impl( + g1 = NULL, + g2 = path_graph_impl(3) + )) }) # 263. rooted_product_impl @@ -4246,16 +6362,30 @@ test_that("product_impl errors", { test_that("rooted_product_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g1 <- path_graph_impl(3) - g2 <- path_graph_impl(3) - expect_snapshot(rooted_product_impl(g1, g2, root = 1)) + g1 <- path_graph_impl( + n = 3 + ) + + g2 <- path_graph_impl( + n = 3 + ) + + expect_snapshot(rooted_product_impl( + g1 = g1, + g2 = g2, + root = 1 + )) }) test_that("rooted_product_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - rooted_product_impl(NULL, path_graph_impl(3), root = 1) + rooted_product_impl( + g1 = NULL, + g2 = path_graph_impl(3), + root = 1 + ) ) }) @@ -4264,15 +6394,25 @@ test_that("rooted_product_impl errors", { test_that("gomory_hu_tree_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(gomory_hu_tree_impl(g)) - expect_snapshot(gomory_hu_tree_impl(g, capacity = c(1, 2))) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(gomory_hu_tree_impl( + graph = g + )) + expect_snapshot(gomory_hu_tree_impl( + graph = g, + capacity = c(1, 2) + )) }) test_that("gomory_hu_tree_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(gomory_hu_tree_impl(NULL)) + expect_snapshot_igraph_error(gomory_hu_tree_impl( + graph = NULL + )) }) # 265. maxflow_impl @@ -4280,15 +6420,31 @@ test_that("gomory_hu_tree_impl errors", { test_that("maxflow_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(maxflow_impl(g, source = 1, target = 3)) - expect_snapshot(maxflow_impl(g, source = 1, target = 3, capacity = c(1, 2))) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(maxflow_impl( + graph = g, + source = 1, + target = 3 + )) + expect_snapshot(maxflow_impl( + graph = g, + source = 1, + target = 3, + capacity = c(1, 2) + )) }) test_that("maxflow_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(maxflow_impl(NULL, source = 1, target = 3)) + expect_snapshot_igraph_error(maxflow_impl( + graph = NULL, + source = 1, + target = 3 + )) }) # 266. residual_graph_impl @@ -4296,15 +6452,26 @@ test_that("maxflow_impl errors", { test_that("residual_graph_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(residual_graph_impl(g, capacity = c(1, 2), flow = c(1, 2))) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(residual_graph_impl( + graph = g, + capacity = c(1, 2), + flow = c(1, 2) + )) }) test_that("residual_graph_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - residual_graph_impl(NULL, capacity = c(1, 2), flow = c(1, 2)) + residual_graph_impl( + graph = NULL, + capacity = c(1, 2), + flow = c(1, 2) + ) ) }) @@ -4313,9 +6480,12 @@ test_that("residual_graph_impl errors", { test_that("reverse_residual_graph_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) + g <- path_graph_impl( + n = 3 + ) + expect_snapshot(reverse_residual_graph_impl( - g, + graph = g, capacity = c(1, 2), flow = c(1, 2) )) @@ -4325,7 +6495,11 @@ test_that("reverse_residual_graph_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - reverse_residual_graph_impl(NULL, capacity = c(1, 2), flow = c(1, 2)) + reverse_residual_graph_impl( + graph = NULL, + capacity = c(1, 2), + flow = c(1, 2) + ) ) }) @@ -4334,15 +6508,31 @@ test_that("reverse_residual_graph_impl errors", { test_that("st_mincut_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(st_mincut_impl(g, source = 1, target = 3)) - expect_snapshot(st_mincut_impl(g, source = 1, target = 3, capacity = c(1, 2))) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(st_mincut_impl( + graph = g, + source = 1, + target = 3 + )) + expect_snapshot(st_mincut_impl( + graph = g, + source = 1, + target = 3, + capacity = c(1, 2) + )) }) test_that("st_mincut_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(st_mincut_impl(NULL, source = 1, target = 3)) + expect_snapshot_igraph_error(st_mincut_impl( + graph = NULL, + source = 1, + target = 3 + )) }) # 269. dominator_tree_impl @@ -4350,15 +6540,29 @@ test_that("st_mincut_impl errors", { test_that("dominator_tree_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3, directed = TRUE) - expect_snapshot(dominator_tree_impl(g, root = 1)) - expect_snapshot(dominator_tree_impl(g, root = 1, mode = "in")) + g <- path_graph_impl( + n = 3, + directed = TRUE + ) + + expect_snapshot(dominator_tree_impl( + graph = g, + root = 1 + )) + expect_snapshot(dominator_tree_impl( + graph = g, + root = 1, + mode = "in" + )) }) test_that("dominator_tree_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(dominator_tree_impl(NULL, root = 1)) + expect_snapshot_igraph_error(dominator_tree_impl( + graph = NULL, + root = 1 + )) }) # 270. all_st_cuts_impl @@ -4366,14 +6570,26 @@ test_that("dominator_tree_impl errors", { test_that("all_st_cuts_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3, directed = TRUE) - expect_snapshot(all_st_cuts_impl(g, source = 1, target = 3)) + g <- path_graph_impl( + n = 3, + directed = TRUE + ) + + expect_snapshot(all_st_cuts_impl( + graph = g, + source = 1, + target = 3 + )) }) test_that("all_st_cuts_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(all_st_cuts_impl(NULL, source = 1, target = 3)) + expect_snapshot_igraph_error(all_st_cuts_impl( + graph = NULL, + source = 1, + target = 3 + )) }) # 271. all_st_mincuts_impl @@ -4381,10 +6597,18 @@ test_that("all_st_cuts_impl errors", { test_that("all_st_mincuts_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3, directed = TRUE) - expect_snapshot(all_st_mincuts_impl(g, source = 1, target = 3)) + g <- path_graph_impl( + n = 3, + directed = TRUE + ) + expect_snapshot(all_st_mincuts_impl( - g, + graph = g, + source = 1, + target = 3 + )) + expect_snapshot(all_st_mincuts_impl( + graph = g, source = 1, target = 3, capacity = c(1, 2) @@ -4395,7 +6619,11 @@ test_that("all_st_mincuts_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - all_st_mincuts_impl(NULL, source = 1, target = 3) + all_st_mincuts_impl( + graph = NULL, + source = 1, + target = 3 + ) ) }) @@ -4404,14 +6632,21 @@ test_that("all_st_mincuts_impl errors", { test_that("even_tarjan_reduction_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(even_tarjan_reduction_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(even_tarjan_reduction_impl( + graph = g + )) }) test_that("even_tarjan_reduction_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(even_tarjan_reduction_impl(NULL)) + expect_snapshot_igraph_error(even_tarjan_reduction_impl( + graph = NULL + )) }) # 273. is_separator_impl @@ -4419,14 +6654,23 @@ test_that("even_tarjan_reduction_impl errors", { test_that("is_separator_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(is_separator_impl(g, 1:2)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(is_separator_impl( + graph = g, + candidate = 1:2 + )) }) test_that("is_separator_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(is_separator_impl(NULL, 1:2)) + expect_snapshot_igraph_error(is_separator_impl( + graph = NULL, + candidate = 1:2 + )) }) # 274. is_minimal_separator_impl @@ -4434,14 +6678,23 @@ test_that("is_separator_impl errors", { test_that("is_minimal_separator_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(is_minimal_separator_impl(g, 1:2)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(is_minimal_separator_impl( + graph = g, + candidate = 1:2 + )) }) test_that("is_minimal_separator_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(is_minimal_separator_impl(NULL, 1:2)) + expect_snapshot_igraph_error(is_minimal_separator_impl( + graph = NULL, + candidate = 1:2 + )) }) # 275. all_minimal_st_separators_impl @@ -4449,14 +6702,21 @@ test_that("is_minimal_separator_impl errors", { test_that("all_minimal_st_separators_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(all_minimal_st_separators_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(all_minimal_st_separators_impl( + graph = g + )) }) test_that("all_minimal_st_separators_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(all_minimal_st_separators_impl(NULL)) + expect_snapshot_igraph_error(all_minimal_st_separators_impl( + graph = NULL + )) }) # 276. minimum_size_separators_impl @@ -4464,14 +6724,21 @@ test_that("all_minimal_st_separators_impl errors", { test_that("minimum_size_separators_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(minimum_size_separators_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(minimum_size_separators_impl( + graph = g + )) }) test_that("minimum_size_separators_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(minimum_size_separators_impl(NULL)) + expect_snapshot_igraph_error(minimum_size_separators_impl( + graph = NULL + )) }) # 277. isoclass_impl @@ -4479,30 +6746,49 @@ test_that("minimum_size_separators_impl errors", { test_that("isoclass_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(isoclass_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(isoclass_impl( + graph = g + )) }) test_that("isoclass_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(isoclass_impl(NULL)) + expect_snapshot_igraph_error(isoclass_impl( + graph = NULL + )) }) # 278. isomorphic_impl -test_that("isomorphic_impl basic", { - withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) - g1 <- path_graph_impl(3) - g2 <- path_graph_impl(3) - expect_snapshot(isomorphic_impl(g1, g2)) +test_that("isomorphic_impl basic", { + withr::local_seed(20250909) + local_igraph_options(print.id = FALSE) + g1 <- path_graph_impl( + n = 3 + ) + + g2 <- path_graph_impl( + n = 3 + ) + + expect_snapshot(isomorphic_impl( + graph1 = g1, + graph2 = g2 + )) }) test_that("isomorphic_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(isomorphic_impl(NULL, path_graph_impl(3))) + expect_snapshot_igraph_error(isomorphic_impl( + graph1 = NULL, + graph2 = path_graph_impl(3) + )) }) # 279. isoclass_subgraph_impl @@ -4510,14 +6796,23 @@ test_that("isomorphic_impl errors", { test_that("isoclass_subgraph_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(5) - expect_snapshot(isoclass_subgraph_impl(g, c(1, 2, 3))) + g <- path_graph_impl( + n = 5 + ) + + expect_snapshot(isoclass_subgraph_impl( + graph = g, + vids = c(1, 2, 3) + )) }) test_that("isoclass_subgraph_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(isoclass_subgraph_impl(NULL, 1:2)) + expect_snapshot_igraph_error(isoclass_subgraph_impl( + graph = NULL, + vids = 1:2 + )) }) # 280. isoclass_create_impl @@ -4525,14 +6820,24 @@ test_that("isoclass_subgraph_impl errors", { test_that("isoclass_create_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(isoclass_create_impl(size = 3, number = 1)) - expect_snapshot(isoclass_create_impl(size = 3, number = 1, directed = FALSE)) + expect_snapshot(isoclass_create_impl( + size = 3, + number = 1 + )) + expect_snapshot(isoclass_create_impl( + size = 3, + number = 1, + directed = FALSE + )) }) test_that("isoclass_create_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(isoclass_create_impl("a", 1)) + expect_snapshot_igraph_error(isoclass_create_impl( + size = "a", + number = 1 + )) }) # 281. isomorphic_vf2_impl @@ -4540,23 +6845,39 @@ test_that("isoclass_create_impl errors", { test_that("isomorphic_vf2_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g1 <- path_graph_impl(3) - g2 <- path_graph_impl(3) - expect_snapshot(isomorphic_vf2_impl(g1, g2)) + g1 <- path_graph_impl( + n = 3 + ) + + g2 <- path_graph_impl( + n = 3 + ) + + expect_snapshot(isomorphic_vf2_impl( + graph1 = g1, + graph2 = g2 + )) expect_snapshot(isomorphic_vf2_impl( - g1, - g2, - vertex.color1 = c(1, 2, 3), - vertex.color2 = c(1, 2, 3), - edge.color1 = c(1, 2), - edge.color2 = c(1, 2) + graph1 = g1, + graph2 = g2, + vertex.color1 = c(1, + 2, 3), + vertex.color2 = c(1, + 2, 3), + edge.color1 = c(1, + 2), + edge.color2 = c(1, + 2) )) }) test_that("isomorphic_vf2_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(isomorphic_vf2_impl(NULL, path_graph_impl(3))) + expect_snapshot_igraph_error(isomorphic_vf2_impl( + graph1 = NULL, + graph2 = path_graph_impl(3) + )) }) # 282. get_isomorphisms_vf2_callback_impl @@ -4567,16 +6888,29 @@ test_that("isomorphic_vf2_impl errors", { test_that("count_isomorphisms_vf2_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g1 <- path_graph_impl(3) - g2 <- path_graph_impl(3) - expect_snapshot(count_isomorphisms_vf2_impl(g1, g2)) + g1 <- path_graph_impl( + n = 3 + ) + + g2 <- path_graph_impl( + n = 3 + ) + expect_snapshot(count_isomorphisms_vf2_impl( - g1, - g2, - vertex.color1 = c(1, 2, 3), - vertex.color2 = c(1, 2, 3), - edge.color1 = c(1, 2), - edge.color2 = c(1, 2) + graph1 = g1, + graph2 = g2 + )) + expect_snapshot(count_isomorphisms_vf2_impl( + graph1 = g1, + graph2 = g2, + vertex.color1 = c(1, + 2, 3), + vertex.color2 = c(1, + 2, 3), + edge.color1 = c(1, + 2), + edge.color2 = c(1, + 2) )) }) @@ -4584,7 +6918,10 @@ test_that("count_isomorphisms_vf2_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - count_isomorphisms_vf2_impl(NULL, path_graph_impl(3)) + count_isomorphisms_vf2_impl( + graph1 = NULL, + graph2 = path_graph_impl(3) + ) ) }) @@ -4593,16 +6930,29 @@ test_that("count_isomorphisms_vf2_impl errors", { test_that("get_isomorphisms_vf2_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g1 <- path_graph_impl(3) - g2 <- path_graph_impl(3) - expect_snapshot(get_isomorphisms_vf2_impl(g1, g2)) + g1 <- path_graph_impl( + n = 3 + ) + + g2 <- path_graph_impl( + n = 3 + ) + + expect_snapshot(get_isomorphisms_vf2_impl( + graph1 = g1, + graph2 = g2 + )) expect_snapshot(get_isomorphisms_vf2_impl( - g1, - g2, - vertex.color1 = c(1, 2, 3), - vertex.color2 = c(1, 2, 3), - edge.color1 = c(1, 2), - edge.color2 = c(1, 2) + graph1 = g1, + graph2 = g2, + vertex.color1 = c(1, + 2, 3), + vertex.color2 = c(1, + 2, 3), + edge.color1 = c(1, + 2), + edge.color2 = c(1, + 2) )) }) @@ -4610,7 +6960,10 @@ test_that("get_isomorphisms_vf2_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - get_isomorphisms_vf2_impl(NULL, path_graph_impl(3)) + get_isomorphisms_vf2_impl( + graph1 = NULL, + graph2 = path_graph_impl(3) + ) ) }) @@ -4619,15 +6972,27 @@ test_that("get_isomorphisms_vf2_impl errors", { test_that("subisomorphic_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g1 <- path_graph_impl(3) - g2 <- path_graph_impl(3) - expect_snapshot(subisomorphic_impl(g1, g2)) + g1 <- path_graph_impl( + n = 3 + ) + + g2 <- path_graph_impl( + n = 3 + ) + + expect_snapshot(subisomorphic_impl( + graph1 = g1, + graph2 = g2 + )) }) test_that("subisomorphic_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(subisomorphic_impl(NULL, path_graph_impl(3))) + expect_snapshot_igraph_error(subisomorphic_impl( + graph1 = NULL, + graph2 = path_graph_impl(3) + )) }) # 286. subisomorphic_vf2_impl @@ -4635,16 +7000,29 @@ test_that("subisomorphic_impl errors", { test_that("subisomorphic_vf2_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g1 <- path_graph_impl(3) - g2 <- path_graph_impl(3) - expect_snapshot(subisomorphic_vf2_impl(g1, g2)) + g1 <- path_graph_impl( + n = 3 + ) + + g2 <- path_graph_impl( + n = 3 + ) + expect_snapshot(subisomorphic_vf2_impl( - g1, - g2, - vertex.color1 = c(1, 2, 3), - vertex.color2 = c(1, 2, 3), - edge.color1 = c(1, 2), - edge.color2 = c(1, 2) + graph1 = g1, + graph2 = g2 + )) + expect_snapshot(subisomorphic_vf2_impl( + graph1 = g1, + graph2 = g2, + vertex.color1 = c(1, + 2, 3), + vertex.color2 = c(1, + 2, 3), + edge.color1 = c(1, + 2), + edge.color2 = c(1, + 2) )) }) @@ -4652,7 +7030,10 @@ test_that("subisomorphic_vf2_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - subisomorphic_vf2_impl(NULL, path_graph_impl(3)) + subisomorphic_vf2_impl( + graph1 = NULL, + graph2 = path_graph_impl(3) + ) ) }) @@ -4661,16 +7042,29 @@ test_that("subisomorphic_vf2_impl errors", { test_that("count_subisomorphisms_vf2_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g1 <- path_graph_impl(3) - g2 <- path_graph_impl(3) - expect_snapshot(count_subisomorphisms_vf2_impl(g1, g2)) + g1 <- path_graph_impl( + n = 3 + ) + + g2 <- path_graph_impl( + n = 3 + ) + + expect_snapshot(count_subisomorphisms_vf2_impl( + graph1 = g1, + graph2 = g2 + )) expect_snapshot(count_subisomorphisms_vf2_impl( - g1, - g2, - vertex.color1 = c(1, 2, 3), - vertex.color2 = c(1, 2, 3), - edge.color1 = c(1, 2), - edge.color2 = c(1, 2) + graph1 = g1, + graph2 = g2, + vertex.color1 = c(1, + 2, 3), + vertex.color2 = c(1, + 2, 3), + edge.color1 = c(1, + 2), + edge.color2 = c(1, + 2) )) }) @@ -4678,7 +7072,10 @@ test_that("count_subisomorphisms_vf2_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - count_subisomorphisms_vf2_impl(NULL, path_graph_impl(3)) + count_subisomorphisms_vf2_impl( + graph1 = NULL, + graph2 = path_graph_impl(3) + ) ) }) @@ -4687,16 +7084,29 @@ test_that("count_subisomorphisms_vf2_impl errors", { test_that("get_subisomorphisms_vf2_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g1 <- path_graph_impl(3) - g2 <- path_graph_impl(3) - expect_snapshot(get_subisomorphisms_vf2_impl(g1, g2)) + g1 <- path_graph_impl( + n = 3 + ) + + g2 <- path_graph_impl( + n = 3 + ) + + expect_snapshot(get_subisomorphisms_vf2_impl( + graph1 = g1, + graph2 = g2 + )) expect_snapshot(get_subisomorphisms_vf2_impl( - g1, - g2, - vertex.color1 = c(1, 2, 3), - vertex.color2 = c(1, 2, 3), - edge.color1 = c(1, 2), - edge.color2 = c(1, 2) + graph1 = g1, + graph2 = g2, + vertex.color1 = c(1, + 2, 3), + vertex.color2 = c(1, + 2, 3), + edge.color1 = c(1, + 2), + edge.color2 = c(1, + 2) )) }) @@ -4704,7 +7114,10 @@ test_that("get_subisomorphisms_vf2_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - get_subisomorphisms_vf2_impl(NULL, path_graph_impl(3)) + get_subisomorphisms_vf2_impl( + graph1 = NULL, + graph2 = path_graph_impl(3) + ) ) }) @@ -4713,15 +7126,27 @@ test_that("get_subisomorphisms_vf2_impl errors", { test_that("canonical_permutation_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(canonical_permutation_impl(g)) - expect_snapshot(canonical_permutation_impl(g, colors = c(1, 2, 3), sh = "fl")) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(canonical_permutation_impl( + graph = g + )) + expect_snapshot(canonical_permutation_impl( + graph = g, + colors = c(1, 2, + 3), + sh = "fl" + )) }) test_that("canonical_permutation_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(canonical_permutation_impl(NULL)) + expect_snapshot_igraph_error(canonical_permutation_impl( + graph = NULL + )) }) # 290. permute_vertices_impl @@ -4729,14 +7154,23 @@ test_that("canonical_permutation_impl errors", { test_that("permute_vertices_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(permute_vertices_impl(g, permutation = 3:1)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(permute_vertices_impl( + graph = g, + permutation = 3:1 + )) }) test_that("permute_vertices_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(permute_vertices_impl(NULL, permutation = 3:1)) + expect_snapshot_igraph_error(permute_vertices_impl( + graph = NULL, + permutation = 3:1 + )) }) # 291. isomorphic_bliss_impl @@ -4744,14 +7178,25 @@ test_that("permute_vertices_impl errors", { test_that("isomorphic_bliss_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g1 <- path_graph_impl(3) - g2 <- path_graph_impl(3) - expect_snapshot(isomorphic_bliss_impl(g1, g2)) + g1 <- path_graph_impl( + n = 3 + ) + + g2 <- path_graph_impl( + n = 3 + ) + + expect_snapshot(isomorphic_bliss_impl( + graph1 = g1, + graph2 = g2 + )) expect_snapshot(isomorphic_bliss_impl( - g1, - g2, - colors1 = c(1, 2, 3), - colors2 = c(1, 2, 3), + graph1 = g1, + graph2 = g2, + colors1 = c(1, + 2, 3), + colors2 = c(1, + 2, 3), sh = "fl" )) }) @@ -4759,7 +7204,10 @@ test_that("isomorphic_bliss_impl basic", { test_that("isomorphic_bliss_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(isomorphic_bliss_impl(NULL, path_graph_impl(3))) + expect_snapshot_igraph_error(isomorphic_bliss_impl( + graph1 = NULL, + graph2 = path_graph_impl(3) + )) }) # 292. count_automorphisms_impl @@ -4767,15 +7215,27 @@ test_that("isomorphic_bliss_impl errors", { test_that("count_automorphisms_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(count_automorphisms_impl(g)) - expect_snapshot(count_automorphisms_impl(g, colors = c(1, 2, 3), sh = "fl")) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(count_automorphisms_impl( + graph = g + )) + expect_snapshot(count_automorphisms_impl( + graph = g, + colors = c(1, 2, + 3), + sh = "fl" + )) }) test_that("count_automorphisms_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(count_automorphisms_impl(NULL)) + expect_snapshot_igraph_error(count_automorphisms_impl( + graph = NULL + )) }) # 293. automorphism_group_impl @@ -4783,11 +7243,17 @@ test_that("count_automorphisms_impl errors", { test_that("automorphism_group_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(automorphism_group_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(automorphism_group_impl( + graph = g + )) expect_snapshot(automorphism_group_impl( - g, - colors = c(1, 2, 3), + graph = g, + colors = c(1, 2, + 3), sh = "fl", details = TRUE )) @@ -4796,7 +7262,9 @@ test_that("automorphism_group_impl basic", { test_that("automorphism_group_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(automorphism_group_impl(NULL)) + expect_snapshot_igraph_error(automorphism_group_impl( + graph = NULL + )) }) # 294. simplify_and_colorize_impl @@ -4804,14 +7272,21 @@ test_that("automorphism_group_impl errors", { test_that("simplify_and_colorize_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(simplify_and_colorize_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(simplify_and_colorize_impl( + graph = g + )) }) test_that("simplify_and_colorize_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(simplify_and_colorize_impl(NULL)) + expect_snapshot_igraph_error(simplify_and_colorize_impl( + graph = NULL + )) }) # 295. graph_count_impl @@ -4819,14 +7294,21 @@ test_that("simplify_and_colorize_impl errors", { test_that("graph_count_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(graph_count_impl(3)) - expect_snapshot(graph_count_impl(3, directed = TRUE)) + expect_snapshot(graph_count_impl( + n = 3 + )) + expect_snapshot(graph_count_impl( + n = 3, + directed = TRUE + )) }) test_that("graph_count_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(graph_count_impl("a")) + expect_snapshot_igraph_error(graph_count_impl( + n = "a" + )) }) # 296. is_matching_impl @@ -4834,11 +7316,18 @@ test_that("graph_count_impl errors", { test_that("is_matching_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(is_matching_impl(g, matching = 1:2)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(is_matching_impl( + graph = g, + matching = 1:2 + )) expect_snapshot(is_matching_impl( - g, - types = c(TRUE, FALSE, TRUE), + graph = g, + types = c(TRUE, FALSE, + TRUE), matching = 1:2 )) }) @@ -4846,7 +7335,10 @@ test_that("is_matching_impl basic", { test_that("is_matching_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(is_matching_impl(NULL, matching = 1:2)) + expect_snapshot_igraph_error(is_matching_impl( + graph = NULL, + matching = 1:2 + )) }) # 297. is_maximal_matching_impl @@ -4854,11 +7346,18 @@ test_that("is_matching_impl errors", { test_that("is_maximal_matching_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(is_maximal_matching_impl(g, matching = 1:2)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(is_maximal_matching_impl( + graph = g, + matching = 1:2 + )) expect_snapshot(is_maximal_matching_impl( - g, - types = c(TRUE, FALSE, TRUE), + graph = g, + types = c(TRUE, FALSE, + TRUE), matching = 1:2 )) }) @@ -4866,7 +7365,10 @@ test_that("is_maximal_matching_impl basic", { test_that("is_maximal_matching_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(is_maximal_matching_impl(NULL, matching = 1:2)) + expect_snapshot_igraph_error(is_maximal_matching_impl( + graph = NULL, + matching = 1:2 + )) }) # 298. maximum_bipartite_matching_impl @@ -4874,16 +7376,22 @@ test_that("is_maximal_matching_impl errors", { test_that("maximum_bipartite_matching_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) + g <- path_graph_impl( + n = 3 + ) + expect_snapshot(maximum_bipartite_matching_impl( - g, - types = c(TRUE, FALSE, TRUE) + graph = g, + types = c(TRUE, FALSE, + TRUE) )) expect_snapshot(maximum_bipartite_matching_impl( - g, - types = c(TRUE, FALSE, TRUE), - weights = c(1, 2), - eps = 1e-5 + graph = g, + types = c(TRUE, FALSE, + TRUE), + weights = c(1, + 2), + eps = 1e-05 )) }) @@ -4891,7 +7399,11 @@ test_that("maximum_bipartite_matching_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - maximum_bipartite_matching_impl(NULL, types = c(TRUE, FALSE, TRUE)) + maximum_bipartite_matching_impl( + graph = NULL, + types = c(TRUE, FALSE, + TRUE) + ) ) }) @@ -4900,15 +7412,23 @@ test_that("maximum_bipartite_matching_impl errors", { test_that("adjacency_spectral_embedding_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(adjacency_spectral_embedding_impl(g, no = 2)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(adjacency_spectral_embedding_impl( + graph = g, + no = 2 + )) expect_snapshot(adjacency_spectral_embedding_impl( - g, + graph = g, no = 2, - weights = c(1, 2), + weights = c(1, + 2), which = "la", scaled = FALSE, - cvec = c(1, 2, 3), + cvec = c(1, + 2, 3), options = list(maxiter = 10) )) }) @@ -4916,7 +7436,10 @@ test_that("adjacency_spectral_embedding_impl basic", { test_that("adjacency_spectral_embedding_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(adjacency_spectral_embedding_impl(NULL, no = 2)) + expect_snapshot_igraph_error(adjacency_spectral_embedding_impl( + graph = NULL, + no = 2 + )) }) # 300. laplacian_spectral_embedding_impl @@ -4924,14 +7447,23 @@ test_that("adjacency_spectral_embedding_impl errors", { test_that("laplacian_spectral_embedding_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(laplacian_spectral_embedding_impl(g, no = 2)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(laplacian_spectral_embedding_impl( + graph = g, + no = 2 + )) }) test_that("laplacian_spectral_embedding_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(laplacian_spectral_embedding_impl(NULL, no = 2)) + expect_snapshot_igraph_error(laplacian_spectral_embedding_impl( + graph = NULL, + no = 2 + )) }) # 301. eigen_adjacency_impl @@ -4939,11 +7471,16 @@ test_that("laplacian_spectral_embedding_impl errors", { test_that("eigen_adjacency_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(eigen_adjacency_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(eigen_adjacency_impl( + graph = g + )) expect_snapshot_igraph_error( eigen_adjacency_impl( - g, + graph = g, algorithm = "lapack", which = list(which = "LA"), options = list(maxiter = 10) @@ -4954,7 +7491,9 @@ test_that("eigen_adjacency_impl basic", { test_that("eigen_adjacency_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(eigen_adjacency_impl(NULL)) + expect_snapshot_igraph_error(eigen_adjacency_impl( + graph = NULL + )) }) # 302. power_law_fit_impl @@ -4962,9 +7501,13 @@ test_that("eigen_adjacency_impl errors", { test_that("power_law_fit_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(power_law_fit_impl(c(1, 2, 3))) expect_snapshot(power_law_fit_impl( - c(1, 2, 3), + data = c(1, + 2, 3) + )) + expect_snapshot(power_law_fit_impl( + data = c(1, + 2, 3), xmin = 1, force.continuous = TRUE )) @@ -4973,7 +7516,9 @@ test_that("power_law_fit_impl basic", { test_that("power_law_fit_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(power_law_fit_impl("a")) + expect_snapshot_igraph_error(power_law_fit_impl( + data = "a" + )) }) # 303. sir_impl @@ -4981,15 +7526,31 @@ test_that("power_law_fit_impl errors", { test_that("sir_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(sir_impl(g, beta = 0.1, gamma = 0.1)) - expect_snapshot(sir_impl(g, beta = 0.1, gamma = 0.1, no.sim = 2)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(sir_impl( + graph = g, + beta = 0.1, + gamma = 0.1 + )) + expect_snapshot(sir_impl( + graph = g, + beta = 0.1, + gamma = 0.1, + no.sim = 2 + )) }) test_that("sir_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(sir_impl(NULL, beta = 0.1, gamma = 0.1)) + expect_snapshot_igraph_error(sir_impl( + graph = NULL, + beta = 0.1, + gamma = 0.1 + )) }) # 304. convex_hull_2d_impl @@ -4997,13 +7558,18 @@ test_that("sir_impl errors", { test_that("convex_hull_2d_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(convex_hull_2d_impl(matrix(1:6, ncol = 2))) + expect_snapshot(convex_hull_2d_impl( + data = matrix(1:6, + ncol = 2) + )) }) test_that("convex_hull_2d_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(convex_hull_2d_impl("a")) + expect_snapshot_igraph_error(convex_hull_2d_impl( + data = "a" + )) }) # 305. dim_select_impl @@ -5011,13 +7577,18 @@ test_that("convex_hull_2d_impl errors", { test_that("dim_select_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(dim_select_impl(c(1, 2, 3))) + expect_snapshot(dim_select_impl( + sv = c(1, + 2, 3) + )) }) test_that("dim_select_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(dim_select_impl(NULL)) + expect_snapshot_igraph_error(dim_select_impl( + sv = NULL + )) }) # 306. solve_lsap_impl @@ -5025,13 +7596,20 @@ test_that("dim_select_impl errors", { test_that("solve_lsap_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(solve_lsap_impl(matrix(1:4, ncol = 2), n = 2)) + expect_snapshot(solve_lsap_impl( + c = matrix(1:4, + ncol = 2), + n = 2 + )) }) test_that("solve_lsap_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(solve_lsap_impl("a", n = 2)) + expect_snapshot_igraph_error(solve_lsap_impl( + c = "a", + n = 2 + )) }) # 307. find_cycle_impl @@ -5039,15 +7617,25 @@ test_that("solve_lsap_impl errors", { test_that("find_cycle_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(find_cycle_impl(g)) - expect_snapshot(find_cycle_impl(g, mode = "in")) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(find_cycle_impl( + graph = g + )) + expect_snapshot(find_cycle_impl( + graph = g, + mode = "in" + )) }) test_that("find_cycle_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(find_cycle_impl(NULL)) + expect_snapshot_igraph_error(find_cycle_impl( + graph = NULL + )) }) # 308. simple_cycles_impl @@ -5055,10 +7643,15 @@ test_that("find_cycle_impl errors", { test_that("simple_cycles_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(simple_cycles_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(simple_cycles_impl( + graph = g + )) expect_snapshot(simple_cycles_impl( - g, + graph = g, mode = "in", min.cycle.length = 2, max.cycle.length = 3 @@ -5068,7 +7661,9 @@ test_that("simple_cycles_impl basic", { test_that("simple_cycles_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(simple_cycles_impl(NULL)) + expect_snapshot_igraph_error(simple_cycles_impl( + graph = NULL + )) }) # 309. is_eulerian_impl @@ -5076,14 +7671,21 @@ test_that("simple_cycles_impl errors", { test_that("is_eulerian_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(is_eulerian_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(is_eulerian_impl( + graph = g + )) }) test_that("is_eulerian_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(is_eulerian_impl(NULL)) + expect_snapshot_igraph_error(is_eulerian_impl( + graph = NULL + )) }) # 310. eulerian_path_impl @@ -5091,14 +7693,21 @@ test_that("is_eulerian_impl errors", { test_that("eulerian_path_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(eulerian_path_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(eulerian_path_impl( + graph = g + )) }) test_that("eulerian_path_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(eulerian_path_impl(NULL)) + expect_snapshot_igraph_error(eulerian_path_impl( + graph = NULL + )) }) # 311. eulerian_cycle_impl @@ -5106,16 +7715,28 @@ test_that("eulerian_path_impl errors", { test_that("eulerian_cycle_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g1 <- path_graph_impl(3) - expect_snapshot_igraph_error(eulerian_cycle_impl(g1)) - g2 <- cycle_graph_impl(4) - expect_snapshot(eulerian_cycle_impl(g2)) + g1 <- path_graph_impl( + n = 3 + ) + + expect_snapshot_igraph_error(eulerian_cycle_impl( + graph = g1 + )) + g2 <- cycle_graph_impl( + n = 4 + ) + + expect_snapshot(eulerian_cycle_impl( + graph = g2 + )) }) test_that("eulerian_cycle_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(eulerian_cycle_impl(NULL)) + expect_snapshot_igraph_error(eulerian_cycle_impl( + graph = NULL + )) }) # 312. fundamental_cycles_impl @@ -5123,10 +7744,16 @@ test_that("eulerian_cycle_impl errors", { test_that("fundamental_cycles_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(fundamental_cycles_impl(g, start = 1)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(fundamental_cycles_impl( + graph = g, + start = 1 + )) expect_snapshot(fundamental_cycles_impl( - g, + graph = g, start = 1, bfs.cutoff = 2, weights = c(1, 2) @@ -5136,7 +7763,10 @@ test_that("fundamental_cycles_impl basic", { test_that("fundamental_cycles_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(fundamental_cycles_impl(NULL, start = 1)) + expect_snapshot_igraph_error(fundamental_cycles_impl( + graph = NULL, + start = 1 + )) }) # 313. minimum_cycle_basis_impl @@ -5144,10 +7774,15 @@ test_that("fundamental_cycles_impl errors", { test_that("minimum_cycle_basis_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(minimum_cycle_basis_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(minimum_cycle_basis_impl( + graph = g + )) expect_snapshot(minimum_cycle_basis_impl( - g, + graph = g, bfs.cutoff = 2, complete = FALSE, use.cycle.order = FALSE, @@ -5158,7 +7793,9 @@ test_that("minimum_cycle_basis_impl basic", { test_that("minimum_cycle_basis_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(minimum_cycle_basis_impl(NULL)) + expect_snapshot_igraph_error(minimum_cycle_basis_impl( + graph = NULL + )) }) # 314. is_tree_impl @@ -5166,15 +7803,26 @@ test_that("minimum_cycle_basis_impl errors", { test_that("is_tree_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(is_tree_impl(g)) - expect_snapshot(is_tree_impl(g, mode = "in", details = TRUE)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(is_tree_impl( + graph = g + )) + expect_snapshot(is_tree_impl( + graph = g, + mode = "in", + details = TRUE + )) }) test_that("is_tree_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(is_tree_impl(NULL)) + expect_snapshot_igraph_error(is_tree_impl( + graph = NULL + )) }) # 315. is_forest_impl @@ -5182,15 +7830,26 @@ test_that("is_tree_impl errors", { test_that("is_forest_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(is_forest_impl(g)) - expect_snapshot(is_forest_impl(g, mode = "in", details = TRUE)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(is_forest_impl( + graph = g + )) + expect_snapshot(is_forest_impl( + graph = g, + mode = "in", + details = TRUE + )) }) test_that("is_forest_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(is_forest_impl(NULL)) + expect_snapshot_igraph_error(is_forest_impl( + graph = NULL + )) }) # 316. from_prufer_impl @@ -5198,13 +7857,17 @@ test_that("is_forest_impl errors", { test_that("from_prufer_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(from_prufer_impl(1:2)) + expect_snapshot(from_prufer_impl( + prufer = 1:2 + )) }) test_that("from_prufer_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(from_prufer_impl("a")) + expect_snapshot_igraph_error(from_prufer_impl( + prufer = "a" + )) }) # 317. to_prufer_impl @@ -5212,14 +7875,21 @@ test_that("from_prufer_impl errors", { test_that("to_prufer_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(to_prufer_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(to_prufer_impl( + graph = g + )) }) test_that("to_prufer_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(to_prufer_impl(NULL)) + expect_snapshot_igraph_error(to_prufer_impl( + graph = NULL + )) }) # 318. tree_from_parent_vector_impl @@ -5227,14 +7897,23 @@ test_that("to_prufer_impl errors", { test_that("tree_from_parent_vector_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(tree_from_parent_vector_impl(c(-1, 1, 2, 3))) - expect_snapshot(tree_from_parent_vector_impl(c(-1, 1, 2, 3), type = "in")) + expect_snapshot(tree_from_parent_vector_impl( + parents = c(-1, + 1, 2, 3) + )) + expect_snapshot(tree_from_parent_vector_impl( + parents = c(-1, + 1, 2, 3), + type = "in" + )) }) test_that("tree_from_parent_vector_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(tree_from_parent_vector_impl("a")) + expect_snapshot_igraph_error(tree_from_parent_vector_impl( + parents = "a" + )) }) # 319. is_complete_impl @@ -5242,14 +7921,21 @@ test_that("tree_from_parent_vector_impl errors", { test_that("is_complete_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(is_complete_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(is_complete_impl( + graph = g + )) }) test_that("is_complete_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(is_complete_impl(NULL)) + expect_snapshot_igraph_error(is_complete_impl( + graph = NULL + )) }) # 320. random_spanning_tree_impl @@ -5257,14 +7943,23 @@ test_that("is_complete_impl errors", { test_that("random_spanning_tree_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(random_spanning_tree_impl(g, vid = 1)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(random_spanning_tree_impl( + graph = g, + vid = 1 + )) }) test_that("random_spanning_tree_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(random_spanning_tree_impl(NULL, vid = 1)) + expect_snapshot_igraph_error(random_spanning_tree_impl( + graph = NULL, + vid = 1 + )) }) # 321. tree_game_impl @@ -5272,14 +7967,22 @@ test_that("random_spanning_tree_impl errors", { test_that("tree_game_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot(tree_game_impl(3)) - expect_snapshot(tree_game_impl(3, directed = TRUE, method = "lerw")) + expect_snapshot(tree_game_impl( + n = 3 + )) + expect_snapshot(tree_game_impl( + n = 3, + directed = TRUE, + method = "lerw" + )) }) test_that("tree_game_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(tree_game_impl("a")) + expect_snapshot_igraph_error(tree_game_impl( + n = "a" + )) }) # 322. vertex_coloring_greedy_impl @@ -5287,15 +7990,25 @@ test_that("tree_game_impl errors", { test_that("vertex_coloring_greedy_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(vertex_coloring_greedy_impl(g)) - expect_snapshot(vertex_coloring_greedy_impl(g, heuristic = "dsatur")) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(vertex_coloring_greedy_impl( + graph = g + )) + expect_snapshot(vertex_coloring_greedy_impl( + graph = g, + heuristic = "dsatur" + )) }) test_that("vertex_coloring_greedy_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(vertex_coloring_greedy_impl(NULL)) + expect_snapshot_igraph_error(vertex_coloring_greedy_impl( + graph = NULL + )) }) # 323. is_vertex_coloring_impl @@ -5303,15 +8016,24 @@ test_that("vertex_coloring_greedy_impl errors", { test_that("is_vertex_coloring_impl basic", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(is_vertex_coloring_impl(g, types = c(1, 2, 3))) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(is_vertex_coloring_impl( + graph = g, + types = c(1, 2, 3) + )) }) test_that("is_vertex_coloring_impl errors", { withr::local_seed(20250909) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - is_vertex_coloring_impl(NULL, types = c(1, 2, 3)) + is_vertex_coloring_impl( + graph = NULL, + types = c(1, 2, 3) + ) ) }) @@ -5330,15 +8052,26 @@ test_that("is_vertex_coloring_impl errors", { test_that("is_bipartite_coloring_impl basic", { withr::local_seed(12345) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(is_bipartite_coloring_impl(g, types = c(TRUE, FALSE, TRUE))) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(is_bipartite_coloring_impl( + graph = g, + types = c(TRUE, FALSE, + TRUE) + )) }) test_that("is_bipartite_coloring_impl errors", { withr::local_seed(12345) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - is_bipartite_coloring_impl(NULL, types = c(TRUE, FALSE, TRUE)) + is_bipartite_coloring_impl( + graph = NULL, + types = c(TRUE, FALSE, + TRUE) + ) ) }) @@ -5347,16 +8080,27 @@ test_that("is_bipartite_coloring_impl errors", { test_that("is_edge_coloring_impl basic", { withr::local_seed(12345) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) + g <- path_graph_impl( + n = 3 + ) + E(g)$color <- c(1, 2) - expect_snapshot(is_edge_coloring_impl(g, types = c(1, 2))) - expect_snapshot(is_edge_coloring_impl(g)) + expect_snapshot(is_edge_coloring_impl( + graph = g, + types = c(1, 2) + )) + expect_snapshot(is_edge_coloring_impl( + graph = g + )) }) test_that("is_edge_coloring_impl errors", { withr::local_seed(12345) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(is_edge_coloring_impl(NULL, types = c(1, 2))) + expect_snapshot_igraph_error(is_edge_coloring_impl( + graph = NULL, + types = c(1, 2) + )) }) # 327. deterministic_optimal_imitation_impl @@ -5364,19 +8108,26 @@ test_that("is_edge_coloring_impl errors", { test_that("deterministic_optimal_imitation_impl basic", { withr::local_seed(12345) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) + g <- path_graph_impl( + n = 3 + ) + expect_snapshot(deterministic_optimal_imitation_impl( - g, - 1, - quantities = c(1, 2, 3), - strategies = c(1, 2, 3) + graph = g, + vid = 1, + quantities = c(1, + 2, 3), + strategies = c(1, + 2, 3) )) expect_snapshot(deterministic_optimal_imitation_impl( - g, - 1, + graph = g, + vid = 1, optimality = "minimum", - quantities = c(1, 2, 3), - strategies = c(1, 2, 3), + quantities = c(1, + 2, 3), + strategies = c(1, + 2, 3), mode = "in" )) }) @@ -5386,10 +8137,12 @@ test_that("deterministic_optimal_imitation_impl errors", { local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( deterministic_optimal_imitation_impl( - NULL, - 1, - quantities = c(1, 2, 3), - strategies = c(1, 2, 3) + graph = NULL, + vid = 1, + quantities = c(1, + 2, 3), + strategies = c(1, + 2, 3) ) ) }) @@ -5399,12 +8152,17 @@ test_that("deterministic_optimal_imitation_impl errors", { test_that("moran_process_impl basic", { withr::local_seed(12345) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) + g <- path_graph_impl( + n = 3 + ) + expect_snapshot(moran_process_impl( - g, + graph = g, weights = c(1, 1), - quantities = c(1, 2, 3), - strategies = c(1, 2, 3), + quantities = c(1, + 2, 3), + strategies = c(1, + 2, 3), mode = "in" )) }) @@ -5413,7 +8171,13 @@ test_that("moran_process_impl errors", { withr::local_seed(12345) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - moran_process_impl(NULL, quantities = c(1, 2, 3), strategies = c(1, 2, 3)) + moran_process_impl( + graph = NULL, + quantities = c(1, + 2, 3), + strategies = c(1, + 2, 3) + ) ) }) @@ -5422,20 +8186,27 @@ test_that("moran_process_impl errors", { test_that("roulette_wheel_imitation_impl basic", { withr::local_seed(12345) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) + g <- path_graph_impl( + n = 3 + ) + expect_snapshot(roulette_wheel_imitation_impl( - g, - 1, - TRUE, - quantities = c(1, 2, 3), - strategies = c(1, 2, 3) + graph = g, + vid = 1, + is.local = TRUE, + quantities = c(1, + 2, 3), + strategies = c(1, + 2, 3) )) expect_snapshot(roulette_wheel_imitation_impl( - g, - 1, - FALSE, - quantities = c(1, 2, 3), - strategies = c(1, 2, 3), + graph = g, + vid = 1, + is.local = FALSE, + quantities = c(1, + 2, 3), + strategies = c(1, + 2, 3), mode = "in" )) }) @@ -5445,11 +8216,13 @@ test_that("roulette_wheel_imitation_impl errors", { local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( roulette_wheel_imitation_impl( - NULL, - 1, - TRUE, - quantities = c(1, 2, 3), - strategies = c(1, 2, 3) + graph = NULL, + vid = 1, + is.local = TRUE, + quantities = c(1, + 2, 3), + strategies = c(1, + 2, 3) ) ) }) @@ -5459,20 +8232,27 @@ test_that("roulette_wheel_imitation_impl errors", { test_that("stochastic_imitation_impl basic", { withr::local_seed(12345) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) + g <- path_graph_impl( + n = 3 + ) + expect_snapshot(stochastic_imitation_impl( - g, - 1, + graph = g, + vid = 1, algo = 1, - quantities = c(1, 2, 3), - strategies = c(1, 2, 3) + quantities = c(1, + 2, 3), + strategies = c(1, + 2, 3) )) expect_snapshot(stochastic_imitation_impl( - g, - 1, + graph = g, + vid = 1, algo = 2, - quantities = c(1, 2, 3), - strategies = c(1, 2, 3), + quantities = c(1, + 2, 3), + strategies = c(1, + 2, 3), mode = "in" )) }) @@ -5482,11 +8262,13 @@ test_that("stochastic_imitation_impl errors", { local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( stochastic_imitation_impl( - NULL, - 1, + graph = NULL, + vid = 1, algo = 1, - quantities = c(1, 2, 3), - strategies = c(1, 2, 3) + quantities = c(1, + 2, 3), + strategies = c(1, + 2, 3) ) ) }) @@ -5496,14 +8278,21 @@ test_that("stochastic_imitation_impl errors", { test_that("invalidate_cache_impl basic", { withr::local_seed(12345) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) - expect_snapshot(invalidate_cache_impl(g)) + g <- path_graph_impl( + n = 3 + ) + + expect_snapshot(invalidate_cache_impl( + graph = g + )) }) test_that("invalidate_cache_impl errors", { withr::local_seed(12345) local_igraph_options(print.id = FALSE) - expect_snapshot_igraph_error(invalidate_cache_impl(NULL)) + expect_snapshot_igraph_error(invalidate_cache_impl( + graph = NULL + )) }) # 332. vertex_path_from_edge_path_impl @@ -5511,14 +8300,18 @@ test_that("invalidate_cache_impl errors", { test_that("vertex_path_from_edge_path_impl basic", { withr::local_seed(12345) local_igraph_options(print.id = FALSE) - g <- path_graph_impl(3) + g <- path_graph_impl( + n = 3 + ) + expect_snapshot(vertex_path_from_edge_path_impl( - g, + graph = g, start = 1, - edge.path = c(1, 2) + edge.path = c(1, + 2) )) expect_snapshot(vertex_path_from_edge_path_impl( - g, + graph = g, start = 1, edge.path = c(1), mode = "in" @@ -5529,7 +8322,12 @@ test_that("vertex_path_from_edge_path_impl errors", { withr::local_seed(12345) local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( - vertex_path_from_edge_path_impl(NULL, start = 1, edge.path = c(1, 2)) + vertex_path_from_edge_path_impl( + graph = NULL, + start = 1, + edge.path = c(1, + 2) + ) ) }) @@ -5539,6 +8337,7 @@ test_that("version_impl basic", { withr::local_seed(12345) version_impl_clean <- function() { v <- version_impl() + paste(v$major, v$minor, v$subminor, sep = ".") } expect_snapshot(version_impl_clean()) @@ -5547,5 +8346,7 @@ test_that("version_impl basic", { test_that("version_impl errors", { withr::local_seed(12345) # version_impl() has no parameters, so testing with invalid arguments - expect_snapshot_igraph_error(version_impl("invalid")) + expect_snapshot_igraph_error(version_impl( + "invalid" + )) }) diff --git a/tools/ensure-impl-named.R b/tools/ensure-impl-named.R new file mode 100644 index 00000000000..a9a8eb7905a --- /dev/null +++ b/tools/ensure-impl-named.R @@ -0,0 +1,74 @@ +source_files <- + fs::dir_ls("R", glob = "*.R") |> + setdiff("R/aaa-auto.R") + +test_file <- "tests/testthat/test-aaa-auto.R" + +all_files <- c(source_files, test_file) + +# all_files <- test_file + +# all_files <- all_files[1:10] + +pkgload::load_all() +library(tidyverse) + +for (file in all_files) { + cat(sprintf("Processing %s...\n", file)) + + text <- readLines(file) + + data <- + parse(text = text, keep.source = TRUE) |> + utils::getParseData(includeText = TRUE) |> + as_tibble() + + parents <- + data |> + filter(token == "expr", str_detect(text, "_impl$")) |> + filter(row_number() == 1, .by = line1) + + repl_data <- + data[match(parents$parent, data$id), ] |> + mutate(fun = !!parents$text) |> + arrange(desc(line2), desc(col2)) + + for (i in seq_len(nrow(repl_data))) { + repl_line <- repl_data[i, ] + + sub_expr <- parse(text = repl_line$text)[[1]] + print(sub_expr) + + func_def <- get(repl_line$fun, envir = asNamespace("igraph")) + + matched_call <- tryCatch( + rlang::call_match( + sub_expr, + func_def, + dots_expand = FALSE + ), + error = function(e) { + cat("Failed to match call for ", repl_line$fun, "\n") + cat("Original call:\n") + print(sub_expr) + cat("Function definition:\n") + print(func_def) + sub_expr + } + ) + + deparsed <- deparse(matched_call, width.cutoff = 20) + deparsed[[1]] <- sub("(", "(\n ", deparsed[[1]], fixed = TRUE) + print(deparsed) + + # Splice + text <- c( + text[seq2(1, repl_line$line1 - 1)], + paste0(str_sub(text[repl_line$line1], 1, repl_line$col1 - 1), paste(deparsed, collapse = "\n")), + str_sub(text[repl_line$line2], repl_line$col2 + 1), + text[seq2(repl_line$line2 + 1, length(text))] + ) + } + + writeLines(text, con = file) +}