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
15 changes: 13 additions & 2 deletions R/assortativity.R
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,13 @@ assortativity <- function(
values.in <- types2
}

assortativity_impl(graph, values, values.in, directed, normalized)
assortativity_impl(
graph = graph,
values = values,
values.in = values.in,
directed = directed,
normalized = normalized
)
}

assortativity_legacy <- function(
Expand All @@ -221,7 +227,12 @@ assortativity_legacy <- function(
types2 = NULL,
directed = TRUE
) {
assortativity_impl(graph, types1, types2, directed)
assortativity_impl(
graph = graph,
values = types1,
values.in = types2,
directed = directed
)
}

#' @param types Vector giving the vertex types. They as assumed to be integer
Expand Down
2 changes: 1 addition & 1 deletion R/centrality.R
Original file line number Diff line number Diff line change
Expand Up @@ -1245,7 +1245,7 @@ spectrum <- function(
}

eigen_adjacency_impl(
graph,
graph = graph,
algorithm = algorithm,
which = which,
options = options
Expand Down
6 changes: 3 additions & 3 deletions R/centralization.R
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ centr_degree_tmax <- function(

# Function call
res <- centralization_degree_tmax_impl(
graph,
graph = graph,
nodes = nodes,
mode = mode,
loops = loops
Expand Down Expand Up @@ -676,9 +676,9 @@ centr_eigen <- function(
centralization_eigenvector_centrality_impl(
graph = graph,
directed = directed,
scale = TRUE,
options = options,
normalized = normalized,
scale = TRUE
normalized = normalized
)
}

Expand Down
12 changes: 10 additions & 2 deletions R/cliques.R
Original file line number Diff line number Diff line change
Expand Up @@ -611,9 +611,17 @@ independence_number <- ivs_size
#' @cdocs igraph_clique_size_hist
clique_size_counts <- function(graph, min = 0, max = 0, maximal = FALSE) {
if (maximal) {
maximal_cliques_hist_impl(graph, min, max)
maximal_cliques_hist_impl(
graph = graph,
min.size = min,
max.size = max
)
} else {
clique_size_hist_impl(graph, min, max)
clique_size_hist_impl(
graph = graph,
min.size = min,
max.size = max
)
}
}

Expand Down
15 changes: 8 additions & 7 deletions R/community.R
Original file line number Diff line number Diff line change
Expand Up @@ -1698,33 +1698,33 @@ cluster_leiden <- function(
membership <- initial_membership
if (n_iterations > 0) {
res <- community_leiden_impl(
graph,
graph = graph,
weights = weights,
# FIXME: Also check below, might not be covered by tests
vertex.weights = vertex_weights,
resolution = resolution,
beta = beta,
start = !is.null(membership),
n.iterations = n_iterations,
membership = membership
)

membership <- res$membership
} else {
prev_quality <- -Inf
quality <- 0.0
while (prev_quality < quality) {
prev_quality <- quality
res <- community_leiden_impl(
graph,
graph = graph,
weights = weights,
# FIXME: Also check above, might not be covered by tests
vertex.weights = vertex_weights,
resolution = resolution,
beta = beta,
start = !is.null(membership),
n.iterations = 1,
membership = membership
)

membership <- res$membership
quality <- res$quality
}
Expand Down Expand Up @@ -2413,12 +2413,13 @@ cluster_label_prop0 <- function(

# Function call
membership <- community_label_propagation_impl(
graph,
graph = graph,
mode = mode,
weights = weights,
initial = initial,
fixed = fixed
)

res <- list()
if (igraph_opt("add.vertex.names") && is_named(graph)) {
res$names <- V(graph)$name
Expand Down Expand Up @@ -2605,9 +2606,10 @@ cluster_optimal <- function(graph, weights = NULL) {

# Function call
res <- community_optimal_modularity_impl(
graph,
graph = graph,
weights = weights
)

if (igraph_opt("add.vertex.names") && is_named(graph)) {
res$names <- V(graph)$name
}
Expand Down Expand Up @@ -3304,7 +3306,6 @@ voronoi_cells <- function(
voronoi_impl(
graph = graph,
generators = generators,
...,
weights = weights,
mode = mode,
tiebreaker = tiebreaker
Expand Down
16 changes: 12 additions & 4 deletions R/components.R
Original file line number Diff line number Diff line change
Expand Up @@ -258,14 +258,18 @@ decompose <- function(
#' @export
#' @cdocs igraph_articulation_points
articulation_points <- function(graph) {
articulation_points_impl(graph = graph)
articulation_points_impl(
graph = graph
)
}

#' @rdname articulation_points
#' @export
#' @cdocs igraph_bridges
bridges <- function(graph) {
bridges_impl(graph = graph)
bridges_impl(
graph = graph
)
}


Expand Down Expand Up @@ -319,7 +323,9 @@ bridges <- function(graph) {
#' @cdocs igraph_biconnected_components
biconnected_components <- function(graph) {
# Function call
res <- biconnected_components_impl(graph)
res <- biconnected_components_impl(
graph = graph
)

# TODO: Clean up after fixing "." / "_" problem.
# See https://github.com/igraph/rigraph/issues/1203
Expand Down Expand Up @@ -388,7 +394,9 @@ biconnected_components <- function(graph) {
#' @export
#' @cdocs igraph_is_biconnected
is_biconnected <- function(graph) {
is_biconnected_impl(graph = graph)
is_biconnected_impl(
graph = graph
)
}


Expand Down
5 changes: 4 additions & 1 deletion R/conversion.R
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,10 @@ get.incidence.dense <- function(
) {
if (is.null(attr)) {
## Function call
res <- get_biadjacency_impl(graph, types)
res <- get_biadjacency_impl(
graph = graph,
types = types
)

if (names && "name" %in% vertex_attr_names(graph)) {
rownames(res$res) <- V(graph)$name[res$row_ids]
Expand Down
9 changes: 8 additions & 1 deletion R/cycles.R
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,12 @@ simple_cycles <- function(
# Argument checks
ensure_igraph(graph)

simple_cycles_impl(graph, mode, min %||% -1, max %||% -1)
simple_cycles_impl(
graph = graph,
mode = mode,
min.cycle.length = min %||%
-1,
max.cycle.length = max %||%
-1
)
}
9 changes: 7 additions & 2 deletions R/embedding.R
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,9 @@ embed_adjacency_matrix <- function(
#' @export
#' @cdocs igraph_dim_select
dim_select <- function(sv) {
dim_select_impl(sv = sv)
dim_select_impl(
sv = sv
)
}


Expand Down Expand Up @@ -398,5 +400,8 @@ sample_sphere_volume <- function(dim, n = 1, radius = 1, positive = TRUE) {
#' colSums(lpvs.dir)
sample_dirichlet <- function(n, alpha) {
# Use the _impl function
sample_dirichlet_impl(n = n, alpha = alpha)
sample_dirichlet_impl(
n = n,
alpha = alpha
)
}
10 changes: 8 additions & 2 deletions R/eulerian.R
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,20 @@
#' @export
#' @cdocs igraph_is_eulerian
has_eulerian_path <- function(graph) {
is_eulerian_impl(graph)$has_path
res <- is_eulerian_impl(
graph = graph
)
res$has_path
}

#' @rdname has_eulerian_path
#' @export
#' @cdocs igraph_is_eulerian
has_eulerian_cycle <- function(graph) {
is_eulerian_impl(graph)$has_cycle
res <- is_eulerian_impl(
graph = graph
)
res$has_cycle
}

#' @rdname has_eulerian_path
Expand Down
8 changes: 6 additions & 2 deletions R/flow.R
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,9 @@ dominator_tree <- function(graph, root, mode = c("out", "in", "all", "total")) {
#' @family flow
#' @cdocs igraph_all_minimal_st_separators
min_st_separators <- function(graph) {
all_minimal_st_separators_impl(graph = graph)
all_minimal_st_separators_impl(
graph = graph
)
}


Expand Down Expand Up @@ -1214,5 +1216,7 @@ is_min_separator <- function(graph, candidate) {
#' min_separators(camp)
#' @cdocs igraph_minimum_size_separators
min_separators <- function(graph) {
minimum_size_separators_impl(graph = graph)
minimum_size_separators_impl(
graph = graph
)
}
18 changes: 14 additions & 4 deletions R/games.R
Original file line number Diff line number Diff line change
Expand Up @@ -1469,7 +1469,6 @@ sample_growing <- function(n, m = 1, ..., directed = TRUE, citation = FALSE) {
growing_random_game_impl(
n = n,
m = m,
...,
directed = directed,
citation = citation
)
Expand Down Expand Up @@ -2576,7 +2575,13 @@ sample_hierarchical_sbm <- function(n, m, rho, C, p) {
commonlen <- unique(c(mlen, rholen, Clen))

if (length(commonlen) == 1 && commonlen == 1) {
hsbm_game_impl(n, m, rho, C, p)
hsbm_game_impl(
n = n,
m = m,
rho = rho,
C = C,
p = p
)
} else {
commonlen <- setdiff(commonlen, 1)
if (length(commonlen) != 1) {
Expand All @@ -2593,7 +2598,13 @@ sample_hierarchical_sbm <- function(n, m, rho, C, p) {
} else {
rep(list(C), length.out = commonlen)
}
hsbm_list_game_impl(n, m, rho, C, p)
hsbm_list_game_impl(
n = n,
mlist = m,
rholist = rho,
Clist = C,
p = p
)
}
}

Expand Down Expand Up @@ -2900,7 +2911,6 @@ sample_chung_lu <- function(
chung_lu_game_impl(
out.weights = out.weights,
in.weights = in.weights,
...,
loops = loops,
variant = variant
)
Expand Down
8 changes: 6 additions & 2 deletions R/hrg.R
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,9 @@ hrg_tree <- function(hrg) {
)
}

out <- from_hrg_dendrogram_impl(hrg)
out <- from_hrg_dendrogram_impl(
hrg = hrg
)

g <- out$graph
set_vertex_attr(g, "probability", value = out$prob)
Expand All @@ -382,7 +384,9 @@ sample_hrg <- function(hrg) {
)
}

hrg_game_impl(hrg)
hrg_game_impl(
hrg = hrg
)
}
#' Predict edges based on a hierarchical random graph model
#'
Expand Down
10 changes: 8 additions & 2 deletions R/interface.R
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,11 @@ neighbors <- function(graph, v, mode = c("out", "in", "all", "total")) {
stop("No vertex was specified")
}

neighbors_impl(graph, vid = v, mode = mode)
neighbors_impl(
graph = graph,
vid = v,
mode = mode
)
}

#' Incident edges of a vertex in a graph
Expand Down Expand Up @@ -613,7 +617,9 @@ get.edge.ids <- function(
#' vcount(g)
#' @cdocs igraph_vcount
vcount <- function(graph) {
as.numeric(vcount_impl(graph))
as.numeric(vcount_impl(
graph = graph
))
}

#' @export
Expand Down
Loading
Loading