@@ -304,6 +304,48 @@ edges_impl <- function(
304304 res
305305}
306306
307+ get_eid_impl <- function (
308+ graph ,
309+ from ,
310+ to ,
311+ directed = TRUE ,
312+ error = TRUE
313+ ) {
314+ # Argument checks
315+ ensure_igraph(graph )
316+ from <- as_igraph_vs(graph , from )
317+ if (length(from ) != 1 ) {
318+ cli :: cli_abort(
319+ " {.arg from} must specify exactly one vertex" ,
320+ call = rlang :: caller_env()
321+ )
322+ }
323+ to <- as_igraph_vs(graph , to )
324+ if (length(to ) != 1 ) {
325+ cli :: cli_abort(
326+ " {.arg to} must specify exactly one vertex" ,
327+ call = rlang :: caller_env()
328+ )
329+ }
330+ directed <- as.logical(directed )
331+ error <- as.logical(error )
332+
333+ on.exit(.Call(R_igraph_finalizer ))
334+ # Function call
335+ res <- .Call(
336+ R_igraph_get_eid ,
337+ graph ,
338+ from - 1 ,
339+ to - 1 ,
340+ directed ,
341+ error
342+ )
343+ if (igraph_opt(" return.vs.es" )) {
344+ res <- create_es(graph , res )
345+ }
346+ res
347+ }
348+
307349get_eids_impl <- function (
308350 graph ,
309351 pairs ,
@@ -9454,6 +9496,53 @@ community_infomap_impl <- function(
94549496 res
94559497}
94569498
9499+ community_voronoi_impl <- function (
9500+ graph ,
9501+ lengths = NULL ,
9502+ weights = NULL ,
9503+ mode = c(" out" , " in" , " all" , " total" ),
9504+ radius = - 1
9505+ ) {
9506+ # Argument checks
9507+ ensure_igraph(graph )
9508+ if (! is.null(lengths ) && ! all(is.na(lengths ))) {
9509+ lengths <- as.numeric(lengths )
9510+ } else {
9511+ lengths <- NULL
9512+ }
9513+ if (is.null(weights ) && " weight" %in% edge_attr_names(graph )) {
9514+ weights <- E(graph )$ weight
9515+ }
9516+ if (! is.null(weights ) && ! all(is.na(weights ))) {
9517+ weights <- as.numeric(weights )
9518+ } else {
9519+ weights <- NULL
9520+ }
9521+ mode <- switch_igraph_arg(
9522+ mode ,
9523+ " out" = 1L ,
9524+ " in" = 2L ,
9525+ " all" = 3L ,
9526+ " total" = 3L
9527+ )
9528+ radius <- as.numeric(radius )
9529+
9530+ on.exit(.Call(R_igraph_finalizer ))
9531+ # Function call
9532+ res <- .Call(
9533+ R_igraph_community_voronoi ,
9534+ graph ,
9535+ lengths ,
9536+ weights ,
9537+ mode ,
9538+ radius
9539+ )
9540+ if (igraph_opt(" return.vs.es" )) {
9541+ res $ generators <- create_vs(graph , res $ generators )
9542+ }
9543+ res
9544+ }
9545+
94579546graphlets_impl <- function (
94589547 graph ,
94599548 weights = NULL ,
@@ -9531,6 +9620,12 @@ graphlets_project_impl <- function(
95319620 } else {
95329621 weights <- NULL
95339622 }
9623+ if (! is.null(cliques ) && ! is.list(cliques )) {
9624+ cli :: cli_abort(
9625+ " {.arg cliques} must be a list or NULL" ,
9626+ call = rlang :: caller_env()
9627+ )
9628+ }
95349629 Muc <- as.numeric(Muc )
95359630 startMu <- as.logical(startMu )
95369631 niter <- as.numeric(niter )
@@ -9541,7 +9636,7 @@ graphlets_project_impl <- function(
95419636 R_igraph_graphlets_project ,
95429637 graph ,
95439638 weights ,
9544- lapply(cliques , function (.x ) .x - 1 ),
9639+ if ( ! is.null( cliques )) lapply(cliques , function (.x ) .x - 1 ),
95459640 Muc ,
95469641 startMu ,
95479642 niter
@@ -10777,14 +10872,20 @@ local_scan_neighborhood_ecount_impl <- function(
1077710872 } else {
1077810873 weights <- NULL
1077910874 }
10875+ if (! is.null(neighborhoods ) && ! is.list(neighborhoods )) {
10876+ cli :: cli_abort(
10877+ " {.arg neighborhoods} must be a list or NULL" ,
10878+ call = rlang :: caller_env()
10879+ )
10880+ }
1078010881
1078110882 on.exit(.Call(R_igraph_finalizer ))
1078210883 # Function call
1078310884 res <- .Call(
1078410885 R_igraph_local_scan_neighborhood_ecount ,
1078510886 graph ,
1078610887 weights ,
10787- lapply(neighborhoods , function (.x ) .x - 1 )
10888+ if ( ! is.null( neighborhoods )) lapply(neighborhoods , function (.x ) .x - 1 )
1078810889 )
1078910890
1079010891 res
@@ -10805,14 +10906,20 @@ local_scan_subset_ecount_impl <- function(
1080510906 } else {
1080610907 weights <- NULL
1080710908 }
10909+ if (! is.null(subsets ) && ! is.list(subsets )) {
10910+ cli :: cli_abort(
10911+ " {.arg subsets} must be a list or NULL" ,
10912+ call = rlang :: caller_env()
10913+ )
10914+ }
1080810915
1080910916 on.exit(.Call(R_igraph_finalizer ))
1081010917 # Function call
1081110918 res <- .Call(
1081210919 R_igraph_local_scan_subset_ecount ,
1081310920 graph ,
1081410921 weights ,
10815- lapply(subsets , function (.x ) .x - 1 )
10922+ if ( ! is.null( subsets )) lapply(subsets , function (.x ) .x - 1 )
1081610923 )
1081710924
1081810925 res
@@ -12652,6 +12759,39 @@ automorphism_group_impl <- function(
1265212759 res
1265312760}
1265412761
12762+ subisomorphic_lad_impl <- function (
12763+ pattern ,
12764+ target ,
12765+ domains = NULL ,
12766+ induced ,
12767+ time_limit
12768+ ) {
12769+ # Argument checks
12770+ ensure_igraph(pattern )
12771+ ensure_igraph(target )
12772+ if (! is.null(domains ) && ! is.list(domains )) {
12773+ cli :: cli_abort(
12774+ " {.arg domains} must be a list or NULL" ,
12775+ call = rlang :: caller_env()
12776+ )
12777+ }
12778+ induced <- as.logical(induced )
12779+ time_limit <- as.numeric(time_limit )
12780+
12781+ on.exit(.Call(R_igraph_finalizer ))
12782+ # Function call
12783+ res <- .Call(
12784+ R_igraph_subisomorphic_lad ,
12785+ pattern ,
12786+ target ,
12787+ if (! is.null(domains )) lapply(domains , function (.x ) .x - 1 ),
12788+ induced ,
12789+ time_limit
12790+ )
12791+
12792+ res
12793+ }
12794+
1265512795simplify_and_colorize_impl <- function (
1265612796 graph
1265712797) {
@@ -13051,6 +13191,94 @@ cmp_epsilon_impl <- function(
1305113191 res
1305213192}
1305313193
13194+ eigen_matrix_impl <- function (
13195+ A ,
13196+ sA ,
13197+ fun ,
13198+ n ,
13199+ algorithm ,
13200+ which ,
13201+ options = arpack_defaults()
13202+ ) {
13203+ # Argument checks
13204+ A [] <- as.numeric(A )
13205+ requireNamespace(" Matrix" , quietly = TRUE )
13206+ sA <- as(as(as(sA , " dMatrix" ), " generalMatrix" ), " CsparseMatrix" )
13207+ n <- as.integer(n )
13208+ algorithm <- switch_igraph_arg(
13209+ algorithm ,
13210+ " auto" = 0L ,
13211+ " lapack" = 1L ,
13212+ " arpack" = 2L ,
13213+ " comp_auto" = 3L ,
13214+ " comp_lapack" = 4L ,
13215+ " comp_arpack" = 5L
13216+ )
13217+ which.tmp <- eigen_defaults()
13218+ which.tmp [names(which )] <- which
13219+ which <- which.tmp
13220+ options <- modify_list(arpack_defaults(), options )
13221+
13222+ on.exit(.Call(R_igraph_finalizer ))
13223+ # Function call
13224+ res <- .Call(
13225+ R_igraph_eigen_matrix ,
13226+ A ,
13227+ sA ,
13228+ fun ,
13229+ n ,
13230+ algorithm ,
13231+ which ,
13232+ options
13233+ )
13234+
13235+ res
13236+ }
13237+
13238+ eigen_matrix_symmetric_impl <- function (
13239+ A ,
13240+ sA ,
13241+ fun ,
13242+ n ,
13243+ algorithm ,
13244+ which ,
13245+ options = arpack_defaults()
13246+ ) {
13247+ # Argument checks
13248+ A [] <- as.numeric(A )
13249+ requireNamespace(" Matrix" , quietly = TRUE )
13250+ sA <- as(as(as(sA , " dMatrix" ), " generalMatrix" ), " CsparseMatrix" )
13251+ n <- as.integer(n )
13252+ algorithm <- switch_igraph_arg(
13253+ algorithm ,
13254+ " auto" = 0L ,
13255+ " lapack" = 1L ,
13256+ " arpack" = 2L ,
13257+ " comp_auto" = 3L ,
13258+ " comp_lapack" = 4L ,
13259+ " comp_arpack" = 5L
13260+ )
13261+ which.tmp <- eigen_defaults()
13262+ which.tmp [names(which )] <- which
13263+ which <- which.tmp
13264+ options <- modify_list(arpack_defaults(), options )
13265+
13266+ on.exit(.Call(R_igraph_finalizer ))
13267+ # Function call
13268+ res <- .Call(
13269+ R_igraph_eigen_matrix_symmetric ,
13270+ A ,
13271+ sA ,
13272+ fun ,
13273+ n ,
13274+ algorithm ,
13275+ which ,
13276+ options
13277+ )
13278+
13279+ res
13280+ }
13281+
1305413282solve_lsap_impl <- function (
1305513283 c ,
1305613284 n
0 commit comments