Skip to content

Commit

Permalink
More renaming, #553
Browse files Browse the repository at this point in the history
  • Loading branch information
gaborcsardi committed Oct 1, 2014
1 parent 2e2ec2c commit cbd5dec
Show file tree
Hide file tree
Showing 172 changed files with 1,644 additions and 1,338 deletions.
116 changes: 113 additions & 3 deletions interfaces/R/NAMESPACE.in
Expand Up @@ -292,9 +292,17 @@ S3method(time_bins, sir)
export(add_edges)
export(add_shape)
export(add_vertices)
export(adhesion)
export(adj)
export(adj_edge_list)
export(adj_eigen)
export(adj_list)
export(any_multiple)
export(arpack_defaults)
export(articulation_points)
export(avg_path_len)
export(automorphisms)

export(bfs)
export(biconn_comps)
export(bip_map)
export(bip_proj)
Expand All @@ -303,24 +311,52 @@ export(bip_proj_size)
export(canon_perm)
export(clique_num)
export(code_len)
export(cohesion)
S3method(cohesion, igraph)
S3method(cohesion, cohesiveBlocks)
export(cohesive_blocks)
export(comp_dist)
export(complementer)
export(compose)
export(comps)
export(console)
export(connect)
export(contract)
export(convex_hull)
export(coreness)
export(count_comps)
export(count_motifs)
export(count_multiple)
export(count_triangles)
export(cut_at)

export(decompose)
export(delete_edge_attr)
export(delete_graph_attr)
export(delete_vertex_attr)
export(delete_edges)
export(delete_vertices)
export(dend_plot)
S3method(dend_plot, communities)
S3method(dend_plot, igraphHRG)
export(dfs)
export(difference)
export(disjoint_union)
export(distance_table)
export(distances)
export(diversity)
export(dominator_tree)
export(dyad_census)

export(edge_attr)
export(edge_attr_names)
export(edge_conn)
export(edge_disjoint_paths)
export(edgelist)
export(ego)
export(ego_size)
export(eigen_defaults)

export(g_adj_matrix)
export(g_atlas)
export(g_bip)
Expand All @@ -343,7 +379,7 @@ export(g_grg)
export(g_growing)
export(g_incidence)
export(g_islands)
export(g_isoclass)
export(g_iso_class)
export(g_k_reg)
export(g_kautz)
export(g_last_cit)
Expand All @@ -364,8 +400,22 @@ export(g_star)
export(g_traits)
export(g_traits_callaway)
export(g_tree)

export(graph_attr)
export(graph_attr_names)
export(graphlet_basis)
export(graphlet_proj)

export(igraph_demo)
export(igraph_test)
export(igraph_version)
export(incidence)
export(ivs)
export(ivs_size)
export(induced_subgraph)
export(is_connected_to)
export(iso_class)

export(knn)

export(l_auto)
export(l_bip)
Expand All @@ -387,7 +437,67 @@ export(l_sphere)
export(l_star)
export(l_sugiyama)
export(l_tree)
export(laplacian)
export(largest_cliques)
export(largest_ivs)

export(make_curves)
export(max_bip_match)
export(max_cardinality)
export(max_cliques)
export(max_flow)
export(maximal_ivs)
export(mean_distance)
export(min_cut)
export(min_size_sep)
export(min_st_sep)
export(motifs)
export(mst)

export(num_max_cliques)

export(permute)
export(pl_fit)
export(plot_hierarchy)

export(read_graph)
export(running_mean)

export(sample_motifs)
export(sample_seq)
export(scg_group)
export(scg_eps)
export(scg_semi_proj)
export(set_edge_attr)
export(set_graph_attr)
export(set_vertex_attr)
export(show_trace)
export(st_cuts)
export(st_min_cuts)
export(stochastic)
export(strength)

export(tk_canvas)
export(tk_center)
export(tk_close)
export(tk_postscript)
export(tk_fit)
export(tk_coords)
export(tk_off)
export(tk_reshape)
export(tk_rotate)
export(tk_set_coords)
export(topo_sort)
export(triad_census)

export(unfold_tree)
export(union)

export(vertex_attr)
export(vertex_attr_names)
export(vertex_conn)
export(vertex_disjoint_paths)

export(write_graph)

######################## REST IS GENERATED BY stimulus
36 changes: 18 additions & 18 deletions interfaces/R/igraph/R/attributes.R
Expand Up @@ -33,15 +33,15 @@
## e(graph)$weight[1:10] # get edge attribute
##

get.graph.attribute <- function(graph, name) {
graph_attr <- function(graph, name) {
if (!is.igraph(graph)) {
stop("Not a graph object")
}
.Call("R_igraph_mybracket2", graph, 9L, 2L,
PACKAGE="igraph")[[as.character(name)]]
}

set.graph.attribute <- function(graph, name, value) {
set_graph_attr <- function(graph, name, value) {
if (!is.igraph(graph)) {
stop("Not a graph object")
}
Expand Down Expand Up @@ -71,7 +71,7 @@ graph.attributes <- function(graph) {
PACKAGE="igraph")
}

get.vertex.attribute <- function(graph, name, index=V(graph)) {
vertex_attr <- function(graph, name, index=V(graph)) {
if (!is.igraph(graph)) {
stop("Not a graph object")
}
Expand All @@ -81,7 +81,7 @@ get.vertex.attribute <- function(graph, name, index=V(graph)) {
myattr[index]
}

set.vertex.attribute <- function(graph, name, index=V(graph), value) {
set_vertex_attr <- function(graph, name, index=V(graph), value) {
if (!is.igraph(graph)) {
stop("Not a graph object")
}
Expand Down Expand Up @@ -124,7 +124,7 @@ vertex.attributes <- function(graph) {
PACKAGE="igraph")
}

get.edge.attribute <- function(graph, name, index=E(graph)) {
edge_attr <- function(graph, name, index=E(graph)) {
if (!is.igraph(graph)) {
stop("Not a graph object")
}
Expand All @@ -135,7 +135,7 @@ get.edge.attribute <- function(graph, name, index=E(graph)) {
myattr[index]
}

set.edge.attribute <- function(graph, name, index=E(graph), value) {
set_edge_attr <- function(graph, name, index=E(graph), value) {
if (!is.igraph(graph)) {
stop("Not a graph object")
}
Expand Down Expand Up @@ -179,7 +179,7 @@ edge.attributes <- function(graph) {
PACKAGE="igraph")
}

list.graph.attributes <- function(graph) {
graph_attr_names <- function(graph) {
if (!is.igraph(graph)) {
stop("Not a graph object")
}
Expand All @@ -188,7 +188,7 @@ list.graph.attributes <- function(graph) {
res
}

list.vertex.attributes <- function(graph) {
vertex_attr_names <- function(graph) {
if (!is.igraph(graph)) {
stop("Not a graph object")
}
Expand All @@ -198,7 +198,7 @@ list.vertex.attributes <- function(graph) {
res
}

list.edge.attributes <- function(graph) {
edge_attr_names <- function(graph) {
if (!is.igraph(graph)) {
stop("Not a graph object")
}
Expand All @@ -207,12 +207,12 @@ list.edge.attributes <- function(graph) {
res
}

remove.graph.attribute <- function(graph, name) {
delete_graph_attr <- function(graph, name) {
if (!is.igraph(graph)) {
stop("Not a graph object")
}
name <- as.character(name)
if (!name %in% list.graph.attributes(graph)) {
if (!name %in% graph_attr_names(graph)) {
stop("No such graph attribute: ", name)
}

Expand All @@ -222,12 +222,12 @@ remove.graph.attribute <- function(graph, name) {
.Call("R_igraph_mybracket2_set", graph, 9L, 2L, gattr, PACKAGE="igraph")
}

remove.vertex.attribute <- function(graph, name) {
delete_vertex_attr <- function(graph, name) {
if (!is.igraph(graph)) {
stop("Not a graph object")
}
name <- as.character(name)
if (!name %in% list.vertex.attributes(graph)) {
if (!name %in% vertex_attr_names(graph)) {
stop("No such vertex attribute: ", name)
}

Expand All @@ -237,12 +237,12 @@ remove.vertex.attribute <- function(graph, name) {
.Call("R_igraph_mybracket2_set", graph, 9L, 3L, vattr, PACKAGE="igraph")
}

remove.edge.attribute <- function(graph, name) {
delete_edge_attr <- function(graph, name) {
if (!is.igraph(graph)) {
stop("Not a graph object")
}
name <- as.character(name)
if (!name %in% list.edge.attributes(graph)) {
if (!name %in% edge_attr_names(graph)) {
stop("No such edge attribute: ", name)
}

Expand Down Expand Up @@ -289,7 +289,7 @@ is.named <- function(graph) {
if (!is.igraph(graph)) {
stop("Not a graph object")
}
"name" %in% list.vertex.attributes(graph)
"name" %in% vertex_attr_names(graph)
}


Expand Down Expand Up @@ -325,7 +325,7 @@ is.weighted <- function(graph) {
if (!is.igraph(graph)) {
stop("Not a graph object")
}
"weight" %in% list.edge.attributes(graph)
"weight" %in% edge_attr_names(graph)
}

#' @rdname g_bip
Expand All @@ -334,7 +334,7 @@ is.bipartite <- function(graph) {
if (!is.igraph(graph)) {
stop("Not a graph object")
}
"type" %in% list.vertex.attributes(graph)
"type" %in% vertex_attr_names(graph)
}

#############
Expand Down
6 changes: 3 additions & 3 deletions interfaces/R/igraph/R/bipartite.R
Expand Up @@ -92,7 +92,7 @@ bip_proj <- function(graph, types=NULL,
remove.type=TRUE) {
# Argument checks
if (!is.igraph(graph)) { stop("Not a graph object") }
if (is.null(types) && "type" %in% list.vertex.attributes(graph)) {
if (is.null(types) && "type" %in% vertex_attr_names(graph)) {
types <- V(graph)$type
}
if (!is.null(types)) {
Expand Down Expand Up @@ -123,10 +123,10 @@ bip_proj <- function(graph, types=NULL,
as.integer(probe1), which, PACKAGE="igraph")
if (remove.type) {
if (is.igraph(res[[1]])) {
res[[1]] <- remove.vertex.attribute(res[[1]], "type")
res[[1]] <- delete_vertex_attr(res[[1]], "type")
}
if (is.igraph(res[[2]])) {
res[[2]] <- remove.vertex.attribute(res[[2]], "type")
res[[2]] <- delete_vertex_attr(res[[2]], "type")
}
}
if (which == 0L) {
Expand Down
16 changes: 8 additions & 8 deletions interfaces/R/igraph/R/centrality.R
Expand Up @@ -19,11 +19,11 @@
#
###################################################################

igraph.arpack.default <- list(bmat="I", n=0, which="XX", nev=1, tol=0.0,
arpack_defaults <- list(bmat="I", n=0, which="XX", nev=1, tol=0.0,
ncv=3, ldv=0, ishift=1, maxiter=3000, nb=1,
mode=1, start=0, sigma=0.0, sigmai=0.0)

arpack <- function(func, extra=NULL, sym=FALSE, options=igraph.arpack.default,
arpack <- function(func, extra=NULL, sym=FALSE, options=arpack_defaults,
env=parent.frame(), complex=!sym) {

if (!is.list(options) ||
Expand All @@ -33,13 +33,13 @@ arpack <- function(func, extra=NULL, sym=FALSE, options=igraph.arpack.default,
if (any(names(options) == "")) {
stop("all options must be named")
}
if (any(! names(options) %in% names(igraph.arpack.default))) {
if (any(! names(options) %in% names(arpack_defaults))) {
stop("unkown ARPACK option(s): ",
paste(setdiff(names(options), names(igraph.arpack.default)),
paste(setdiff(names(options), names(arpack_defaults)),
collapse=", "))
}

options.tmp <- igraph.arpack.default
options.tmp <- arpack_defaults
options.tmp[ names(options) ] <- options
options <- options.tmp

Expand Down Expand Up @@ -111,16 +111,16 @@ arpack <- function(func, extra=NULL, sym=FALSE, options=igraph.arpack.default,
#' cor(degree(g), sc)
#'
subgraph.centrality <- function(graph, diag=FALSE) {
A <- get.adjacency(graph)
A <- adj(graph)
if (!diag) { diag(A) <- 0 }
eig <- eigen(A)
res <- as.vector(eig$vectors^2 %*% exp(eig$values))
if (getIgraphOpt("add.vertex.names") && is.named(graph)) {
names(res) <- get.vertex.attribute(graph, "name")
names(res) <- vertex_attr(graph, "name")
}
res
}

igraph.eigen.default <- list(pos="LM", howmany=1L, il=-1L, iu=-1L,
eigen_defaults <- list(pos="LM", howmany=1L, il=-1L, iu=-1L,
vl=-Inf, vu=Inf, vestimate=0L,
balance="none")

0 comments on commit cbd5dec

Please sign in to comment.