@@ -984,9 +984,13 @@ modularity_matrix <- function(
984984 resolution <- as.numeric(resolution )
985985 directed <- as.logical(directed )
986986
987- on.exit(.Call(R_igraph_finalizer ))
988987 # Function call
989- res <- .Call(R_igraph_modularity_matrix , graph , weights , resolution , directed )
988+ res <- modularity_matrix_impl(
989+ graph = graph ,
990+ weights = weights ,
991+ resolution = resolution ,
992+ directed = directed
993+ )
990994
991995 res
992996}
@@ -2524,9 +2528,12 @@ cluster_louvain <- function(graph, weights = NULL, resolution = 1) {
25242528 }
25252529 resolution <- as.numeric(resolution )
25262530
2527- on.exit(.Call(R_igraph_finalizer ))
25282531 # Function call
2529- res <- .Call(R_igraph_community_multilevel , graph , weights , resolution )
2532+ res <- community_multilevel_impl(
2533+ graph = graph ,
2534+ weights = weights ,
2535+ resolution = resolution
2536+ )
25302537 if (igraph_opt(" add.vertex.names" ) && is_named(graph )) {
25312538 res $ names <- V(graph )$ name
25322539 }
@@ -3055,16 +3062,12 @@ i_compare <- function(
30553062 } else {
30563063 as.numeric(as.factor(comm2 ))
30573064 }
3058- method <- switch (
3059- igraph.match.arg(method ),
3060- vi = 0L ,
3061- nmi = 1L ,
3062- split.join = 2L ,
3063- rand = 3L ,
3064- adjusted.rand = 4L
3065+ method <- igraph.match.arg(method )
3066+ res <- compare_communities_impl(
3067+ comm1 = comm1 ,
3068+ comm2 = comm2 ,
3069+ method = method
30653070 )
3066- on.exit(.Call(R_igraph_finalizer ))
3067- res <- .Call(R_igraph_compare_communities , comm1 , comm2 , method )
30683071 res
30693072}
30703073
@@ -3112,8 +3115,10 @@ split_join_distance <- function(comm1, comm2) {
31123115 } else {
31133116 as.numeric(comm2 )
31143117 }
3115- on.exit(.Call(R_igraph_finalizer ))
3116- res <- .Call(R_igraph_split_join_distance , comm1 , comm2 )
3118+ res <- split_join_distance_impl(
3119+ comm1 = comm1 ,
3120+ comm2 = comm2
3121+ )
31173122 unlist(res )
31183123}
31193124
0 commit comments