Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
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
46 changes: 23 additions & 23 deletions R/attributes.R
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ graph_attr <- function(graph, name) {

check_string(name)

.Call(Rx_igraph_mybracket2, graph, igraph_t_idx_attr, igraph_attr_idx_graph)[[
.Call(Rx_igraph_mybracket2, graph, igraph_t_idx_attr, igraph_attr_idx_graph)[[ # internal, no _impl
name
]]
}
Expand Down Expand Up @@ -388,7 +388,7 @@ set_graph_attr <- function(graph, name, value) {

ensure_igraph(graph)

.Call(
.Call( # internal, no _impl
Rx_igraph_mybracket3_set,
graph,
igraph_t_idx_attr,
Expand All @@ -401,7 +401,7 @@ set_graph_attr <- function(graph, name, value) {
#' @export
graph.attributes <- function(graph) {
ensure_igraph(graph)
.Call(
.Call( # internal, no _impl
Rx_igraph_mybracket2_copy,
graph,
igraph_t_idx_attr,
Expand All @@ -417,7 +417,7 @@ graph.attributes <- function(graph) {
value <- as.list(value)
}

.Call(
.Call( # internal, no _impl
Rx_igraph_mybracket2_set,
graph,
igraph_t_idx_attr,
Expand Down Expand Up @@ -459,7 +459,7 @@ vertex_attr <- function(graph, name, index = V(graph)) {

check_string(name)
myattr <-
.Call(
.Call( # internal, no _impl
Rx_igraph_mybracket2,
graph,
igraph_t_idx_attr,
Expand Down Expand Up @@ -609,7 +609,7 @@ i_set_vertex_attr <- function(
index <- as_igraph_vs(graph, index)
}

vattrs <- .Call(
vattrs <- .Call( # internal, no _impl
Rx_igraph_mybracket2,
graph,
igraph_t_idx_attr,
Expand Down Expand Up @@ -643,7 +643,7 @@ i_set_vertex_attr <- function(
}
}

.Call(
.Call( # internal, no _impl
Rx_igraph_mybracket2_set,
graph,
igraph_t_idx_attr,
Expand All @@ -660,7 +660,7 @@ vertex.attributes <- function(graph, index = V(graph)) {
index <- as_igraph_vs(graph, index)
}

res <- .Call(
res <- .Call( # internal, no _impl
Rx_igraph_mybracket2_copy,
graph,
igraph_t_idx_attr,
Expand Down Expand Up @@ -720,7 +720,7 @@ set_value_at <- function(value, idx, length_out) {
)
}

.Call(
.Call( # internal, no _impl
Rx_igraph_mybracket2_set,
graph,
igraph_t_idx_attr,
Expand Down Expand Up @@ -761,7 +761,7 @@ edge_attr <- function(graph, name, index = E(graph)) {
}
} else {
check_string(name)
myattr <- .Call(
myattr <- .Call( # internal, no _impl
Rx_igraph_mybracket2,
graph,
igraph_t_idx_attr,
Expand Down Expand Up @@ -865,7 +865,7 @@ i_set_edge_attr <- function(
index <- as_igraph_es(graph, index)
}

eattrs <- .Call(
eattrs <- .Call( # internal, no _impl
Rx_igraph_mybracket2,
graph,
igraph_t_idx_attr,
Expand Down Expand Up @@ -896,7 +896,7 @@ i_set_edge_attr <- function(
}
}

.Call(
.Call( # internal, no _impl
Rx_igraph_mybracket2_set,
graph,
igraph_t_idx_attr,
Expand All @@ -913,7 +913,7 @@ edge.attributes <- function(graph, index = E(graph)) {
index <- as_igraph_es(graph, index)
}

res <- .Call(
res <- .Call( # internal, no _impl
Rx_igraph_mybracket2_copy,
graph,
igraph_t_idx_attr,
Expand Down Expand Up @@ -963,7 +963,7 @@ edge.attributes <- function(graph, index = E(graph)) {
)
}

.Call(
.Call( # internal, no _impl
Rx_igraph_mybracket2_set,
graph,
igraph_t_idx_attr,
Expand All @@ -986,7 +986,7 @@ edge.attributes <- function(graph, index = E(graph)) {
#' graph_attr_names(g)
graph_attr_names <- function(graph) {
ensure_igraph(graph)
res <- .Call(
res <- .Call( # internal, no _impl
Rx_igraph_mybracket2_names,
graph,
igraph_t_idx_attr,
Expand Down Expand Up @@ -1015,7 +1015,7 @@ graph_attr_names <- function(graph) {
vertex_attr_names <- function(graph) {
ensure_igraph(graph)

res <- .Call(
res <- .Call( # internal, no _impl
Rx_igraph_mybracket2_names,
graph,
igraph_t_idx_attr,
Expand Down Expand Up @@ -1043,7 +1043,7 @@ vertex_attr_names <- function(graph) {
#' plot(g)
edge_attr_names <- function(graph) {
ensure_igraph(graph)
res <- .Call(
res <- .Call( # internal, no _impl
Rx_igraph_mybracket2_names,
graph,
igraph_t_idx_attr,
Expand Down Expand Up @@ -1077,15 +1077,15 @@ delete_graph_attr <- function(graph, name) {
cli::cli_abort("No graph attribute {.arg {name}} found.")
}

gattr <- .Call(
gattr <- .Call( # internal, no _impl
Rx_igraph_mybracket2,
graph,
igraph_t_idx_attr,
igraph_attr_idx_graph
)
gattr[[name]] <- NULL

.Call(
.Call( # internal, no _impl
Rx_igraph_mybracket2_set,
graph,
igraph_t_idx_attr,
Expand Down Expand Up @@ -1117,15 +1117,15 @@ delete_vertex_attr <- function(graph, name) {
cli::cli_abort("No vertex attribute {.arg {name}} found.")
}

vattr <- .Call(
vattr <- .Call( # internal, no _impl
Rx_igraph_mybracket2,
graph,
igraph_t_idx_attr,
igraph_attr_idx_vertex
)
vattr[[name]] <- NULL

.Call(
.Call( # internal, no _impl
Rx_igraph_mybracket2_set,
graph,
igraph_t_idx_attr,
Expand Down Expand Up @@ -1157,15 +1157,15 @@ delete_edge_attr <- function(graph, name) {
cli::cli_abort("No edge attribute {.arg {name}} found.")
}

eattr <- .Call(
eattr <- .Call( # internal, no _impl
Rx_igraph_mybracket2,
graph,
igraph_t_idx_attr,
igraph_attr_idx_edge
)
eattr[[name]] <- NULL

.Call(
.Call( # internal, no _impl
Rx_igraph_mybracket2_set,
graph,
igraph_t_idx_attr,
Expand Down
2 changes: 1 addition & 1 deletion R/bipartite.R
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ bipartite_projection <- function(

on.exit(.Call(Rx_igraph_finalizer))
# Function call
res <- .Call(
res <- .Call( # bipartite_projection_impl lacks which/multiplicity parameters
Rx_igraph_bipartite_projection,
graph,
types,
Expand Down
4 changes: 2 additions & 2 deletions R/centrality.R
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,7 @@ arpack <- function(
}

on.exit(.Call(Rx_igraph_finalizer))
res <- .Call(Rx_igraph_arpack, func, extra, options, env, sym)
res <- .Call(Rx_igraph_arpack, func, extra, options, env, sym) # ARPACK, no _impl

if (complex) {
rew <- arpack.unpack.complex(
Expand Down Expand Up @@ -1030,7 +1030,7 @@ arpack.unpack.complex <- function(vectors, values, nev) {

on.exit(.Call(Rx_igraph_finalizer))
# Function call
res <- .Call(Rx_igraph_arpack_unpack_complex, vectors, values, nev)
res <- .Call(Rx_igraph_arpack_unpack_complex, vectors, values, nev) # ARPACK, no _impl

res
}
Expand Down
33 changes: 7 additions & 26 deletions R/cliques.R
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ max_cliques <- function(
tmpfile <- FALSE
}
on.exit(.Call(Rx_igraph_finalizer))
res <- .Call(
res <- .Call( # maximal_cliques_file_impl doesn't support subset
Rx_igraph_maximal_cliques_file,
graph,
subset,
Expand All @@ -350,7 +350,7 @@ max_cliques <- function(
}

on.exit(.Call(Rx_igraph_finalizer))
res <- .Call(
res <- .Call( # maximal_cliques_impl doesn't support subset
Rx_igraph_maximal_cliques,
graph,
subset_arg,
Expand Down Expand Up @@ -403,7 +403,7 @@ count_max_cliques <- function(graph, min = NULL, max = NULL, subset = NULL) {

on.exit(.Call(Rx_igraph_finalizer))
# Function call
res <- .Call(Rx_igraph_maximal_cliques_count, graph, subset, min, max)
res <- .Call(Rx_igraph_maximal_cliques_count, graph, subset, min, max) # _impl lacks subset

res
}
Expand Down Expand Up @@ -568,30 +568,11 @@ weighted_clique_num <- function(graph, vertex.weights = NULL) {
#'
#' length(max_ivs(g))
ivs <- function(graph, min = NULL, max = NULL) {
ensure_igraph(graph)

if (is.null(min)) {
min <- 0
}

if (is.null(max)) {
max <- 0
}

on.exit(.Call(Rx_igraph_finalizer))
res <- .Call(
Rx_igraph_independent_vertex_sets,
graph,
as.numeric(min),
as.numeric(max)
independent_vertex_sets_impl(
graph = graph,
min_size = min %||% 0,
max_size = max %||% 0
)
res <- lapply(res, `+`, 1)

if (igraph_opt("return.vs.es")) {
res <- lapply(res, unsafe_create_vs, graph = graph, verts = V(graph))
}

res
}

#' @rdname ivs
Expand Down
24 changes: 12 additions & 12 deletions R/community.R
Original file line number Diff line number Diff line change
Expand Up @@ -1311,12 +1311,12 @@ show_trace <- function(communities) {
#####################################################################

community.to.membership2 <- function(merges, vcount, steps) {
mode(merges) <- "numeric"
mode(vcount) <- "numeric"
mode(steps) <- "numeric"
on.exit(.Call(Rx_igraph_finalizer))
res <- .Call(Rx_igraph_community_to_membership2, merges - 1, vcount, steps)
res + 1
res <- community_to_membership_impl(
merges = merges - 1,
nodes = vcount,
steps = steps
)
res$membership + 1
}

#####################################################################
Expand Down Expand Up @@ -1480,7 +1480,7 @@ cluster_spinglass <- function(

on.exit(.Call(Rx_igraph_finalizer))
if (is.null(vertex) || length(vertex) == 0) {
res <- .Call(
res <- .Call( # community_spinglass_impl uses different parameter names
Rx_igraph_spinglass_community,
graph,
weights,
Expand All @@ -1502,7 +1502,7 @@ cluster_spinglass <- function(
}
class(res) <- "communities"
} else {
res <- .Call(
res <- .Call( # community_spinglass_single_impl has different API
Rx_igraph_spinglass_my_community,
graph,
weights,
Expand Down Expand Up @@ -1858,7 +1858,7 @@ cluster_walktrap <- function(
}

on.exit(.Call(Rx_igraph_finalizer))
res <- .Call(
res <- .Call( # community_walktrap_impl lacks output control parameters
Rx_igraph_walktrap_community,
graph,
weights,
Expand Down Expand Up @@ -1986,7 +1986,7 @@ cluster_edge_betweenness <- function(
}

on.exit(.Call(Rx_igraph_finalizer))
res <- .Call(
res <- .Call( # community_edge_betweenness_impl lacks output control parameters
Rx_igraph_community_edge_betweenness,
graph,
weights,
Expand Down Expand Up @@ -2078,7 +2078,7 @@ cluster_fast_greedy <- function(
}

on.exit(.Call(Rx_igraph_finalizer))
res <- .Call(
res <- .Call( # community_fastgreedy_impl lacks output control parameters
Rx_igraph_community_fastgreedy,
graph,
as.logical(merges),
Expand All @@ -2100,7 +2100,7 @@ cluster_fast_greedy <- function(
igraph.i.levc.arp <- function(externalP, externalE) {
f <- function(v) {
v <- as.numeric(v)
.Call(R_igraph_levc_arpack_multiplier, externalP, externalE, v)
.Call(R_igraph_levc_arpack_multiplier, externalP, externalE, v) # internal ARPACK, no _impl
}
f
}
Expand Down
Loading