Closed maelle closed 1 week ago
In some cases the result needs to be annotated with additional information. One common example is graph generators. For example, static_fitness_game_impl
has:
if (igraph_opt("add.params")) {
res$name <- 'Static fitness model'
res$loops <- loops
res$multiple <- multiple
}
Another example is adding vertex names to vertex quantities, which is very common. For example eigenvector_centrality_impl
has:
res <- .Call(R_igraph_eigenvector_centrality, graph, directed, scale, weights, options)
if (igraph_opt("add.vertex.names") && is_named(graph)) {
names(res$vector) <- vertex_attr(graph, "name", V(graph))
}
You might find other examples by browsing the generated code.
Thanks, it makes sense!
rather than just having the
.Call
at the end of the function