@@ -267,8 +267,7 @@ line.graph <- function(graph) {
267267 lifecycle :: deprecate_soft(" 2.1.0" , " line.graph()" , " make_line_graph()" )
268268 ensure_igraph(graph )
269269
270- on.exit(.Call(R_igraph_finalizer ))
271- res <- .Call(R_igraph_linegraph , graph )
270+ res <- linegraph_impl(graph = graph )
272271 if (igraph_opt(" add.params" )) {
273272 res $ name <- " Line graph"
274273 }
@@ -473,8 +472,7 @@ graph.lattice <- function(
473472graph.kautz <- function (m , n ) {
474473 # nocov start
475474 lifecycle :: deprecate_soft(" 2.1.0" , " graph.kautz()" , " make_kautz_graph()" )
476- on.exit(.Call(R_igraph_finalizer ))
477- res <- .Call(R_igraph_kautz , as.numeric(m ), as.numeric(n ))
475+ res <- kautz_impl(m = m , n = n )
478476 if (igraph_opt(" add.params" )) {
479477 res $ name <- sprintf(" Kautz graph %i-%i" , m , n )
480478 res $ m <- m
@@ -500,13 +498,8 @@ graph.full.citation <- function(n, directed = TRUE) {
500498 " graph.full.citation()" ,
501499 " make_full_citation_graph()"
502500 )
503- # Argument checks
504- n <- as.numeric(n )
505- directed <- as.logical(directed )
506-
507- on.exit(.Call(R_igraph_finalizer ))
508501 # Function call
509- res <- .Call( R_igraph_full_citation , n , directed )
502+ res <- full_citation_impl( n = n , directed = directed )
510503
511504 res <- set_graph_attr(res , " name" , " Full citation graph" )
512505 res
@@ -545,8 +538,7 @@ graph.full.bipartite <- function(
545538 " total" = 3
546539 )
547540
548- on.exit(.Call(R_igraph_finalizer ))
549- res <- .Call(R_igraph_full_bipartite , n1 , n2 , as.logical(directed ), mode1 )
541+ res <- full_bipartite_impl(n1 = n1 , n2 = n2 , directed = directed , mode = mode )
550542 if (igraph_opt(" add.params" )) {
551543 res $ graph $ name <- " Full bipartite graph"
552544 res $ n1 <- n1
@@ -644,13 +636,8 @@ graph.extended.chordal.ring <- function(n, w, directed = FALSE) {
644636graph.empty <- function (n = 0 , directed = TRUE ) {
645637 # nocov start
646638 lifecycle :: deprecate_soft(" 2.1.0" , " graph.empty()" , " make_empty_graph()" )
647- # Argument checks
648- n <- as.numeric(n )
649- directed <- as.logical(directed )
650-
651- on.exit(.Call(R_igraph_finalizer ))
652639 # Function call
653- res <- .Call( R_igraph_empty , n , directed )
640+ res <- empty_impl( n = n , directed = directed )
654641
655642 res
656643} # nocov end
@@ -672,8 +659,7 @@ graph.de.bruijn <- function(m, n) {
672659 " graph.de.bruijn()" ,
673660 " make_de_bruijn_graph()"
674661 )
675- on.exit(.Call(R_igraph_finalizer ))
676- res <- .Call(R_igraph_de_bruijn , as.numeric(m ), as.numeric(n ))
662+ res <- de_bruijn_impl(m = m , n = n )
677663 if (igraph_opt(" add.params" )) {
678664 res $ name <- sprintf(" De-Bruijn graph %i-%i" , m , n )
679665 res $ m <- m
@@ -743,8 +729,7 @@ graph.bipartite <- function(types, edges, directed = FALSE) {
743729graph.atlas <- function (n ) {
744730 # nocov start
745731 lifecycle :: deprecate_soft(" 2.1.0" , " graph.atlas()" , " graph_from_atlas()" )
746- on.exit(.Call(R_igraph_finalizer ))
747- res <- .Call(R_igraph_atlas , as.numeric(n ))
732+ res <- atlas_impl(number = n )
748733 if (igraph_opt(" add.params" )) {
749734 res $ name <- sprintf(" Graph from the Atlas #%i" , n )
750735 res $ n <- n
@@ -2214,8 +2199,7 @@ from_prufer <- function(...) constructor_spec(make_from_prufer, ...)
22142199# ' graph_from_atlas(sample(0:1252, 1))
22152200# ' graph_from_atlas(sample(0:1252, 1))
22162201graph_from_atlas <- function (n ) {
2217- on.exit(.Call(R_igraph_finalizer ))
2218- res <- .Call(R_igraph_atlas , as.numeric(n ))
2202+ res <- atlas_impl(number = n )
22192203 if (igraph_opt(" add.params" )) {
22202204 res $ name <- sprintf(" Graph from the Atlas #%i" , n )
22212205 res $ n <- n
@@ -2311,8 +2295,7 @@ chordal_ring <- function(...) constructor_spec(make_chordal_ring, ...)
23112295make_line_graph <- function (graph ) {
23122296 ensure_igraph(graph )
23132297
2314- on.exit(.Call(R_igraph_finalizer ))
2315- res <- .Call(R_igraph_linegraph , graph )
2298+ res <- linegraph_impl(graph = graph )
23162299 if (igraph_opt(" add.params" )) {
23172300 res $ name <- " Line graph"
23182301 }
@@ -2358,8 +2341,7 @@ line_graph <- function(...) constructor_spec(make_line_graph, ...)
23582341# ' make_de_bruijn_graph(2, 2)
23592342# ' make_line_graph(g)
23602343make_de_bruijn_graph <- function (m , n ) {
2361- on.exit(.Call(R_igraph_finalizer ))
2362- res <- .Call(R_igraph_de_bruijn , as.numeric(m ), as.numeric(n ))
2344+ res <- de_bruijn_impl(m = m , n = n )
23632345 if (igraph_opt(" add.params" )) {
23642346 res $ name <- sprintf(" De-Bruijn graph %i-%i" , m , n )
23652347 res $ m <- m
@@ -2403,8 +2385,7 @@ de_bruijn_graph <- function(...) constructor_spec(make_de_bruijn_graph, ...)
24032385# ' make_kautz_graph(2, 2)
24042386# '
24052387make_kautz_graph <- function (m , n ) {
2406- on.exit(.Call(R_igraph_finalizer ))
2407- res <- .Call(R_igraph_kautz , as.numeric(m ), as.numeric(n ))
2388+ res <- kautz_impl(m = m , n = n )
24082389 if (igraph_opt(" add.params" )) {
24092390 res $ name <- sprintf(" Kautz graph %i-%i" , m , n )
24102391 res $ m <- m
@@ -2466,8 +2447,7 @@ make_full_bipartite_graph <- function(
24662447 " total" = 3
24672448 )
24682449
2469- on.exit(.Call(R_igraph_finalizer ))
2470- res <- .Call(R_igraph_full_bipartite , n1 , n2 , as.logical(directed ), mode1 )
2450+ res <- full_bipartite_impl(n1 = n1 , n2 = n2 , directed = directed , mode = mode )
24712451 if (igraph_opt(" add.params" )) {
24722452 res $ graph $ name <- " Full bipartite graph"
24732453 res $ n1 <- n1
@@ -2581,13 +2561,8 @@ bipartite_graph <- function(...) constructor_spec(make_bipartite_graph, ...)
25812561# ' @examples
25822562# ' print_all(make_full_citation_graph(10))
25832563make_full_citation_graph <- function (n , directed = TRUE ) {
2584- # Argument checks
2585- n <- as.numeric(n )
2586- directed <- as.logical(directed )
2587-
2588- on.exit(.Call(R_igraph_finalizer ))
25892564 # Function call
2590- res <- .Call( R_igraph_full_citation , n , directed )
2565+ res <- full_citation_impl( n = n , directed = directed )
25912566
25922567 res <- set_graph_attr(res , " name" , " Full citation graph" )
25932568 res
0 commit comments