Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 118 additions & 0 deletions R/aaa-auto.R
Original file line number Diff line number Diff line change
Expand Up @@ -2160,6 +2160,16 @@ hsbm_list_game_impl <- function(
# Argument checks
n <- as.numeric(n)
mlist <- as.numeric(mlist)
if (!is.list(Clist)) {
cli::cli_abort("{.arg Clist} must be a list of matrices")
}
Clist <- lapply(Clist, function(m) {
if (!is.matrix(m)) {
cli::cli_abort("{.arg Clist} must be a list of matrices")
}
m[] <- as.numeric(m)
m
})
p <- as.numeric(p)

on.exit(.Call(R_igraph_finalizer))
Expand Down Expand Up @@ -8193,6 +8203,42 @@ layout_drl_3d_impl <- function(
res
}

layout_merge_dla_impl <- function(
graphs,
coords
) {
# Argument checks
if (!is.list(graphs)) {
cli::cli_abort("{.arg graphs} must be a list of igraph objects")
}
graphs <- lapply(graphs, function(g) {
if (!inherits(g, "igraph")) {
cli::cli_abort("{.arg graphs} must be a list of igraph objects")
}
g
})
if (!is.list(coords)) {
cli::cli_abort("{.arg coords} must be a list of matrices")
}
coords <- lapply(coords, function(m) {
if (!is.matrix(m)) {
cli::cli_abort("{.arg coords} must be a list of matrices")
}
m[] <- as.numeric(m)
m
})

on.exit(.Call(R_igraph_finalizer))
# Function call
res <- .Call(
R_igraph_layout_merge_dla,
graphs,
coords
)

res
}

layout_sugiyama_impl <- function(
graph,
layers = NULL,
Expand Down Expand Up @@ -10720,6 +10766,30 @@ disjoint_union_impl <- function(
res
}

disjoint_union_many_impl <- function(
graphs
) {
# Argument checks
if (!is.list(graphs)) {
cli::cli_abort("{.arg graphs} must be a list of igraph objects")
}
graphs <- lapply(graphs, function(g) {
if (!inherits(g, "igraph")) {
cli::cli_abort("{.arg graphs} must be a list of igraph objects")
}
g
})

on.exit(.Call(R_igraph_finalizer))
# Function call
res <- .Call(
R_igraph_disjoint_union_many,
graphs
)

res
}

join_impl <- function(
left,
right
Expand Down Expand Up @@ -10758,6 +10828,30 @@ union_impl <- function(
res
}

union_many_impl <- function(
graphs
) {
# Argument checks
if (!is.list(graphs)) {
cli::cli_abort("{.arg graphs} must be a list of igraph objects")
}
graphs <- lapply(graphs, function(g) {
if (!inherits(g, "igraph")) {
cli::cli_abort("{.arg graphs} must be a list of igraph objects")
}
g
})

on.exit(.Call(R_igraph_finalizer))
# Function call
res <- .Call(
R_igraph_union_many,
graphs
)

res
}

intersection_impl <- function(
left,
right
Expand All @@ -10777,6 +10871,30 @@ intersection_impl <- function(
res
}

intersection_many_impl <- function(
graphs
) {
# Argument checks
if (!is.list(graphs)) {
cli::cli_abort("{.arg graphs} must be a list of igraph objects")
}
graphs <- lapply(graphs, function(g) {
if (!inherits(g, "igraph")) {
cli::cli_abort("{.arg graphs} must be a list of igraph objects")
}
g
})

on.exit(.Call(R_igraph_finalizer))
# Function call
res <- .Call(
R_igraph_intersection_many,
graphs
)

res
}

difference_impl <- function(
orig,
sub
Expand Down
20 changes: 8 additions & 12 deletions src/cpp11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ extern SEXP R_igraph_diameter_dijkstra(SEXP, SEXP, SEXP, SEXP);
extern SEXP R_igraph_difference(SEXP, SEXP);
extern SEXP R_igraph_dim_select(SEXP);
extern SEXP R_igraph_disjoint_union(SEXP, SEXP);
extern SEXP R_igraph_disjoint_union_many(SEXP);
extern SEXP R_igraph_distances(SEXP, SEXP, SEXP, SEXP);
extern SEXP R_igraph_distances_bellman_ford(SEXP, SEXP, SEXP, SEXP, SEXP);
extern SEXP R_igraph_distances_cutoff(SEXP, SEXP, SEXP, SEXP, SEXP);
Expand Down Expand Up @@ -252,6 +253,7 @@ extern SEXP R_igraph_independent_vertex_sets(SEXP, SEXP, SEXP);
extern SEXP R_igraph_induced_subgraph(SEXP, SEXP, SEXP);
extern SEXP R_igraph_induced_subgraph_map(SEXP, SEXP, SEXP);
extern SEXP R_igraph_intersection(SEXP, SEXP);
extern SEXP R_igraph_intersection_many(SEXP);
extern SEXP R_igraph_invalidate_cache(SEXP);
extern SEXP R_igraph_is_acyclic(SEXP);
extern SEXP R_igraph_is_biconnected(SEXP);
Expand Down Expand Up @@ -315,6 +317,7 @@ extern SEXP R_igraph_layout_kamada_kawai(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEX
extern SEXP R_igraph_layout_kamada_kawai_3d(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP);
extern SEXP R_igraph_layout_lgl(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP);
extern SEXP R_igraph_layout_mds(SEXP, SEXP, SEXP);
extern SEXP R_igraph_layout_merge_dla(SEXP, SEXP);
extern SEXP R_igraph_layout_random(SEXP);
extern SEXP R_igraph_layout_random_3d(SEXP);
extern SEXP R_igraph_layout_reingold_tilford(SEXP, SEXP, SEXP, SEXP);
Expand Down Expand Up @@ -471,6 +474,7 @@ extern SEXP R_igraph_trussness(SEXP);
extern SEXP R_igraph_turan(SEXP, SEXP);
extern SEXP R_igraph_unfold_tree(SEXP, SEXP, SEXP);
extern SEXP R_igraph_union(SEXP, SEXP);
extern SEXP R_igraph_union_many(SEXP);
extern SEXP R_igraph_vcount(SEXP);
extern SEXP R_igraph_version(void);
extern SEXP R_igraph_vertex_coloring_greedy(SEXP, SEXP);
Expand Down Expand Up @@ -499,7 +503,6 @@ extern SEXP Rx_igraph_add_env(SEXP);
extern SEXP Rx_igraph_add_myid_to_env(SEXP);
extern SEXP Rx_igraph_add_version_to_env(SEXP);
extern SEXP Rx_igraph_address(SEXP);
extern SEXP Rx_igraph_adjacency(SEXP, SEXP, SEXP);
extern SEXP Rx_igraph_adjacent_vertices(SEXP, SEXP, SEXP);
extern SEXP Rx_igraph_arpack(SEXP, SEXP, SEXP, SEXP, SEXP);
extern SEXP Rx_igraph_arpack_unpack_complex(SEXP, SEXP, SEXP);
Expand All @@ -514,19 +517,16 @@ extern SEXP Rx_igraph_community_edge_betweenness(SEXP, SEXP, SEXP, SEXP, SEXP, S
extern SEXP Rx_igraph_community_fastgreedy(SEXP, SEXP, SEXP, SEXP, SEXP);
extern SEXP Rx_igraph_community_leading_eigenvector(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP);
extern SEXP Rx_igraph_community_to_membership2(SEXP, SEXP, SEXP);
extern SEXP Rx_igraph_complementer(SEXP, SEXP);
extern SEXP Rx_igraph_compose(SEXP, SEXP, SEXP);
extern SEXP Rx_igraph_connect_neighborhood(SEXP, SEXP, SEXP);
extern SEXP Rx_igraph_copy_env(SEXP);
extern SEXP Rx_igraph_copy_from(SEXP);
extern SEXP Rx_igraph_copy_to(SEXP);
extern SEXP Rx_igraph_create(SEXP, SEXP, SEXP);
extern SEXP Rx_igraph_create_bipartite(SEXP, SEXP, SEXP);
extern SEXP Rx_igraph_decompose(SEXP, SEXP, SEXP, SEXP);
extern SEXP Rx_igraph_degree_sequence_game(SEXP, SEXP, SEXP);
extern SEXP Rx_igraph_dfs(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP);
extern SEXP Rx_igraph_diameter(SEXP, SEXP, SEXP, SEXP);
extern SEXP Rx_igraph_difference(SEXP, SEXP);
extern SEXP Rx_igraph_disjoint_union(SEXP);
extern SEXP Rx_igraph_edge_disjoint_paths(SEXP, SEXP, SEXP);
extern SEXP Rx_igraph_es_adj(SEXP, SEXP, SEXP, SEXP);
Expand All @@ -542,7 +542,6 @@ extern SEXP Rx_igraph_get_adjlist(SEXP, SEXP, SEXP, SEXP);
extern SEXP Rx_igraph_get_all_simple_paths_pp(SEXP);
extern SEXP Rx_igraph_get_attr_mode(SEXP, SEXP);
extern SEXP Rx_igraph_get_diameter(SEXP, SEXP, SEXP, SEXP);
extern SEXP Rx_igraph_get_edgelist(SEXP, SEXP);
extern SEXP Rx_igraph_get_eids(SEXP, SEXP, SEXP, SEXP);
extern SEXP Rx_igraph_get_graph_id(SEXP);
extern SEXP Rx_igraph_get_shortest_paths(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP);
Expand Down Expand Up @@ -610,7 +609,6 @@ extern SEXP Rx_igraph_watts_strogatz_game(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP);
extern SEXP Rx_igraph_weak_ref_key(SEXP);
extern SEXP Rx_igraph_weak_ref_run_finalizer(SEXP);
extern SEXP Rx_igraph_weak_ref_value(SEXP);
extern SEXP Rx_igraph_weighted_adjacency(SEXP, SEXP, SEXP);
extern SEXP Rx_igraph_write_graph_dimacs(SEXP, SEXP, SEXP, SEXP, SEXP);
extern SEXP Rx_igraph_write_graph_lgl(SEXP, SEXP, SEXP, SEXP, SEXP);
extern SEXP Rx_igraph_write_graph_ncol(SEXP, SEXP, SEXP, SEXP);
Expand Down Expand Up @@ -734,6 +732,7 @@ static const R_CallMethodDef CallEntries[] = {
{"R_igraph_difference", (DL_FUNC) &R_igraph_difference, 2},
{"R_igraph_dim_select", (DL_FUNC) &R_igraph_dim_select, 1},
{"R_igraph_disjoint_union", (DL_FUNC) &R_igraph_disjoint_union, 2},
{"R_igraph_disjoint_union_many", (DL_FUNC) &R_igraph_disjoint_union_many, 1},
{"R_igraph_distances", (DL_FUNC) &R_igraph_distances, 4},
{"R_igraph_distances_bellman_ford", (DL_FUNC) &R_igraph_distances_bellman_ford, 5},
{"R_igraph_distances_cutoff", (DL_FUNC) &R_igraph_distances_cutoff, 5},
Expand Down Expand Up @@ -847,6 +846,7 @@ static const R_CallMethodDef CallEntries[] = {
{"R_igraph_induced_subgraph", (DL_FUNC) &R_igraph_induced_subgraph, 3},
{"R_igraph_induced_subgraph_map", (DL_FUNC) &R_igraph_induced_subgraph_map, 3},
{"R_igraph_intersection", (DL_FUNC) &R_igraph_intersection, 2},
{"R_igraph_intersection_many", (DL_FUNC) &R_igraph_intersection_many, 1},
{"R_igraph_invalidate_cache", (DL_FUNC) &R_igraph_invalidate_cache, 1},
{"R_igraph_is_acyclic", (DL_FUNC) &R_igraph_is_acyclic, 1},
{"R_igraph_is_biconnected", (DL_FUNC) &R_igraph_is_biconnected, 1},
Expand Down Expand Up @@ -910,6 +910,7 @@ static const R_CallMethodDef CallEntries[] = {
{"R_igraph_layout_kamada_kawai_3d", (DL_FUNC) &R_igraph_layout_kamada_kawai_3d, 13},
{"R_igraph_layout_lgl", (DL_FUNC) &R_igraph_layout_lgl, 8},
{"R_igraph_layout_mds", (DL_FUNC) &R_igraph_layout_mds, 3},
{"R_igraph_layout_merge_dla", (DL_FUNC) &R_igraph_layout_merge_dla, 2},
{"R_igraph_layout_random", (DL_FUNC) &R_igraph_layout_random, 1},
{"R_igraph_layout_random_3d", (DL_FUNC) &R_igraph_layout_random_3d, 1},
{"R_igraph_layout_reingold_tilford", (DL_FUNC) &R_igraph_layout_reingold_tilford, 4},
Expand Down Expand Up @@ -1066,6 +1067,7 @@ static const R_CallMethodDef CallEntries[] = {
{"R_igraph_turan", (DL_FUNC) &R_igraph_turan, 2},
{"R_igraph_unfold_tree", (DL_FUNC) &R_igraph_unfold_tree, 3},
{"R_igraph_union", (DL_FUNC) &R_igraph_union, 2},
{"R_igraph_union_many", (DL_FUNC) &R_igraph_union_many, 1},
{"R_igraph_vcount", (DL_FUNC) &R_igraph_vcount, 1},
{"R_igraph_version", (DL_FUNC) &R_igraph_version, 0},
{"R_igraph_vertex_coloring_greedy", (DL_FUNC) &R_igraph_vertex_coloring_greedy, 2},
Expand Down Expand Up @@ -1094,7 +1096,6 @@ static const R_CallMethodDef CallEntries[] = {
{"Rx_igraph_add_myid_to_env", (DL_FUNC) &Rx_igraph_add_myid_to_env, 1},
{"Rx_igraph_add_version_to_env", (DL_FUNC) &Rx_igraph_add_version_to_env, 1},
{"Rx_igraph_address", (DL_FUNC) &Rx_igraph_address, 1},
{"Rx_igraph_adjacency", (DL_FUNC) &Rx_igraph_adjacency, 3},
{"Rx_igraph_adjacent_vertices", (DL_FUNC) &Rx_igraph_adjacent_vertices, 3},
{"Rx_igraph_arpack", (DL_FUNC) &Rx_igraph_arpack, 5},
{"Rx_igraph_arpack_unpack_complex", (DL_FUNC) &Rx_igraph_arpack_unpack_complex, 3},
Expand All @@ -1109,19 +1110,16 @@ static const R_CallMethodDef CallEntries[] = {
{"Rx_igraph_community_fastgreedy", (DL_FUNC) &Rx_igraph_community_fastgreedy, 5},
{"Rx_igraph_community_leading_eigenvector", (DL_FUNC) &Rx_igraph_community_leading_eigenvector, 9},
{"Rx_igraph_community_to_membership2", (DL_FUNC) &Rx_igraph_community_to_membership2, 3},
{"Rx_igraph_complementer", (DL_FUNC) &Rx_igraph_complementer, 2},
{"Rx_igraph_compose", (DL_FUNC) &Rx_igraph_compose, 3},
{"Rx_igraph_connect_neighborhood", (DL_FUNC) &Rx_igraph_connect_neighborhood, 3},
{"Rx_igraph_copy_env", (DL_FUNC) &Rx_igraph_copy_env, 1},
{"Rx_igraph_copy_from", (DL_FUNC) &Rx_igraph_copy_from, 1},
{"Rx_igraph_copy_to", (DL_FUNC) &Rx_igraph_copy_to, 1},
{"Rx_igraph_create", (DL_FUNC) &Rx_igraph_create, 3},
{"Rx_igraph_create_bipartite", (DL_FUNC) &Rx_igraph_create_bipartite, 3},
{"Rx_igraph_decompose", (DL_FUNC) &Rx_igraph_decompose, 4},
{"Rx_igraph_degree_sequence_game", (DL_FUNC) &Rx_igraph_degree_sequence_game, 3},
{"Rx_igraph_dfs", (DL_FUNC) &Rx_igraph_dfs, 12},
{"Rx_igraph_diameter", (DL_FUNC) &Rx_igraph_diameter, 4},
{"Rx_igraph_difference", (DL_FUNC) &Rx_igraph_difference, 2},
{"Rx_igraph_disjoint_union", (DL_FUNC) &Rx_igraph_disjoint_union, 1},
{"Rx_igraph_edge_disjoint_paths", (DL_FUNC) &Rx_igraph_edge_disjoint_paths, 3},
{"Rx_igraph_es_adj", (DL_FUNC) &Rx_igraph_es_adj, 4},
Expand All @@ -1137,7 +1135,6 @@ static const R_CallMethodDef CallEntries[] = {
{"Rx_igraph_get_all_simple_paths_pp", (DL_FUNC) &Rx_igraph_get_all_simple_paths_pp, 1},
{"Rx_igraph_get_attr_mode", (DL_FUNC) &Rx_igraph_get_attr_mode, 2},
{"Rx_igraph_get_diameter", (DL_FUNC) &Rx_igraph_get_diameter, 4},
{"Rx_igraph_get_edgelist", (DL_FUNC) &Rx_igraph_get_edgelist, 2},
{"Rx_igraph_get_eids", (DL_FUNC) &Rx_igraph_get_eids, 4},
{"Rx_igraph_get_graph_id", (DL_FUNC) &Rx_igraph_get_graph_id, 1},
{"Rx_igraph_get_shortest_paths", (DL_FUNC) &Rx_igraph_get_shortest_paths, 10},
Expand Down Expand Up @@ -1205,7 +1202,6 @@ static const R_CallMethodDef CallEntries[] = {
{"Rx_igraph_weak_ref_key", (DL_FUNC) &Rx_igraph_weak_ref_key, 1},
{"Rx_igraph_weak_ref_run_finalizer", (DL_FUNC) &Rx_igraph_weak_ref_run_finalizer, 1},
{"Rx_igraph_weak_ref_value", (DL_FUNC) &Rx_igraph_weak_ref_value, 1},
{"Rx_igraph_weighted_adjacency", (DL_FUNC) &Rx_igraph_weighted_adjacency, 3},
{"Rx_igraph_write_graph_dimacs", (DL_FUNC) &Rx_igraph_write_graph_dimacs, 5},
{"Rx_igraph_write_graph_lgl", (DL_FUNC) &Rx_igraph_write_graph_lgl, 5},
{"Rx_igraph_write_graph_ncol", (DL_FUNC) &Rx_igraph_write_graph_ncol, 4},
Expand Down
Loading