@@ -411,18 +411,9 @@ min_cut <- function(
411411
412412 if (is.null(target ) && is.null(source )) {
413413 if (value.only ) {
414- res <- .Call( Rx_igraph_mincut_value , graph , capacity )
414+ res <- mincut_value_impl( graph = graph , capacity = capacity )
415415 } else {
416- res <- .Call(Rx_igraph_mincut , graph , capacity )
417- res $ cut <- res $ cut + 1
418- res $ partition1 <- res $ partition1 + 1
419- res $ partition2 <- res $ partition2 + 1
420-
421- if (igraph_opt(" return.vs.es" )) {
422- res $ cut <- create_es(graph , res $ cut )
423- res $ partition1 <- create_vs(graph , res $ partition1 )
424- res $ partition2 <- create_vs(graph , res $ partition2 )
425- }
416+ res <- mincut_impl(graph = graph , capacity = capacity )
426417 }
427418 } else {
428419 if (value.only ) {
@@ -533,8 +524,7 @@ vertex_connectivity <- function(
533524 ensure_igraph(graph )
534525
535526 if (is.null(source ) && is.null(target )) {
536- on.exit(.Call(R_igraph_finalizer ))
537- .Call(Rx_igraph_vertex_connectivity , graph , as.logical(checks ))
527+ vertex_connectivity_impl(graph = graph , checks = checks )
538528 } else if (! is.null(source ) && ! is.null(target )) {
539529 on.exit(.Call(R_igraph_finalizer ))
540530 .Call(
@@ -639,8 +629,7 @@ edge_connectivity <- function(
639629 ensure_igraph(graph )
640630
641631 if (is.null(source ) && is.null(target )) {
642- on.exit(.Call(R_igraph_finalizer ))
643- .Call(Rx_igraph_edge_connectivity , graph , as.logical(checks ))
632+ edge_connectivity_impl(graph = graph , checks = checks )
644633 } else if (! is.null(source ) && ! is.null(target )) {
645634 on.exit(.Call(R_igraph_finalizer ))
646635 .Call(
@@ -693,20 +682,20 @@ vertex_disjoint_paths <- function(graph, source = NULL, target = NULL) {
693682# ' @rdname edge_connectivity
694683# ' @export
695684adhesion <- function (graph , checks = TRUE ) {
696- ensure_igraph( graph )
697-
698- on.exit(.Call( R_igraph_finalizer ))
699- .Call( Rx_igraph_adhesion , graph , as.logical( checks ) )
685+ adhesion_impl(
686+ graph = graph ,
687+ checks = checks
688+ )
700689}
701690
702691# ' @rdname vertex_connectivity
703692# ' @method cohesion igraph
704693# ' @export
705694cohesion.igraph <- function (x , checks = TRUE , ... ) {
706- ensure_igraph( x )
707-
708- on.exit(.Call( R_igraph_finalizer ))
709- .Call( Rx_igraph_cohesion , x , as.logical( checks ) )
695+ cohesion_impl(
696+ graph = x ,
697+ checks = checks
698+ )
710699}
711700
712701# ' List all (s,t)-cuts of a graph
0 commit comments