diff --git a/R/aaa-auto.R b/R/aaa-auto.R index 82663c91404..addf46aad36 100644 --- a/R/aaa-auto.R +++ b/R/aaa-auto.R @@ -4066,29 +4066,3 @@ version_impl <- function() { res } -get_stochastic_sparsemat_impl <- function(graph, column.wise=FALSE) { - # Argument checks - ensure_igraph(graph) - column.wise <- as.logical(column.wise) - - on.exit( .Call(R_igraph_finalizer) ) - # Function call - res <- .Call(R_igraph_get_stochastic_sparsemat, graph, column.wise) - - res -} - -hrg_dendrogram_impl <- function(hrg) { - # Argument checks - if (is.null(hrg)) { - hrg <- list(left=c(), right=c(), prob=c(), edges=c(), vertices=c()) - } - hrg <- lapply(hrg[c("left","right","prob","edges","vertices")], as.numeric) - - on.exit( .Call(R_igraph_finalizer) ) - # Function call - res <- .Call(R_igraph_hrg_dendrogram, hrg) - - res -} - diff --git a/src/cpp11.cpp b/src/cpp11.cpp index 99f6804595d..e36f8780549 100644 --- a/src/cpp11.cpp +++ b/src/cpp11.cpp @@ -202,7 +202,6 @@ extern SEXP R_igraph_get_shortest_path_dijkstra(void *, void *, void *, void *, extern SEXP R_igraph_get_shortest_paths(void *, void *, void *, void *, void *, void *, void *, void *, void *, void *); extern SEXP R_igraph_get_stochastic(void *, void *); extern SEXP R_igraph_get_stochastic_sparse(void *, void *, void *); -extern SEXP R_igraph_get_stochastic_sparsemat(void *, void *); extern SEXP R_igraph_get_subisomorphisms_vf2(void *, void *, void *, void *, void *, void *); extern SEXP R_igraph_get_subisomorphisms_vf2_callback(void *, void *, void *, void *, void *, void *, void *); extern SEXP R_igraph_get_widest_path(void *, void *, void *, void *, void *); @@ -228,7 +227,6 @@ extern SEXP R_igraph_has_multiple(void *); extern SEXP R_igraph_has_mutual(void *, void *); extern SEXP R_igraph_hrg_consensus(void *, void *, void *, void *); extern SEXP R_igraph_hrg_create(void *, void *); -extern SEXP R_igraph_hrg_dendrogram(void *); extern SEXP R_igraph_hrg_fit(void *, void *, void *, void *); extern SEXP R_igraph_hrg_game(void *); extern SEXP R_igraph_hrg_predict(void *, void *, void *, void *, void *); @@ -679,7 +677,6 @@ static const R_CallMethodDef CallEntries[] = { {"R_igraph_get_shortest_paths", (DL_FUNC) &R_igraph_get_shortest_paths, 10}, {"R_igraph_get_stochastic", (DL_FUNC) &R_igraph_get_stochastic, 2}, {"R_igraph_get_stochastic_sparse", (DL_FUNC) &R_igraph_get_stochastic_sparse, 3}, - {"R_igraph_get_stochastic_sparsemat", (DL_FUNC) &R_igraph_get_stochastic_sparsemat, 2}, {"R_igraph_get_subisomorphisms_vf2", (DL_FUNC) &R_igraph_get_subisomorphisms_vf2, 6}, {"R_igraph_get_subisomorphisms_vf2_callback", (DL_FUNC) &R_igraph_get_subisomorphisms_vf2_callback, 7}, {"R_igraph_get_widest_path", (DL_FUNC) &R_igraph_get_widest_path, 5}, @@ -705,7 +702,6 @@ static const R_CallMethodDef CallEntries[] = { {"R_igraph_has_mutual", (DL_FUNC) &R_igraph_has_mutual, 2}, {"R_igraph_hrg_consensus", (DL_FUNC) &R_igraph_hrg_consensus, 4}, {"R_igraph_hrg_create", (DL_FUNC) &R_igraph_hrg_create, 2}, - {"R_igraph_hrg_dendrogram", (DL_FUNC) &R_igraph_hrg_dendrogram, 1}, {"R_igraph_hrg_fit", (DL_FUNC) &R_igraph_hrg_fit, 4}, {"R_igraph_hrg_game", (DL_FUNC) &R_igraph_hrg_game, 1}, {"R_igraph_hrg_predict", (DL_FUNC) &R_igraph_hrg_predict, 5}, diff --git a/src/rinterface.c b/src/rinterface.c index 43e3a0ad4ea..1dbee45eaf7 100644 --- a/src/rinterface.c +++ b/src/rinterface.c @@ -11811,56 +11811,3 @@ SEXP R_igraph_version() { UNPROTECT(1); return(r_result); } - -/*-------------------------------------------/ -/ igraph_get_stochastic_sparsemat / -/-------------------------------------------*/ -SEXP R_igraph_get_stochastic_sparsemat(SEXP graph, SEXP column_wise) { - /* Declarations */ - igraph_t c_graph; - igraph_sparsemat_t c_sparsemat; - igraph_bool_t c_column_wise; - SEXP sparsemat; - - SEXP r_result; - /* Convert input */ - R_SEXP_to_igraph(graph, &c_graph); - /* Don't need to init. */ - c_column_wise=LOGICAL(column_wise)[0]; - /* Call igraph */ - IGRAPH_R_CHECK(igraph_get_stochastic_sparsemat(&c_graph, &c_sparsemat, c_column_wise)); - - /* Convert output */ - PROTECT(sparsemat=R_igraph_sparsemat_to_SEXP(&c_sparsemat)); - igraph_sparsemat_destroy(&c_sparsemat); - r_result = sparsemat; - - UNPROTECT(1); - return(r_result); -} - -/*-------------------------------------------/ -/ igraph_hrg_dendrogram / -/-------------------------------------------*/ -SEXP R_igraph_hrg_dendrogram(SEXP hrg) { - /* Declarations */ - igraph_t c_graph; - igraph_hrg_t c_hrg; - SEXP graph; - - SEXP r_result; - /* Convert input */ - R_SEXP_to_hrg(hrg, &c_hrg); - /* Call igraph */ - IGRAPH_R_CHECK(igraph_hrg_dendrogram(&c_graph, &c_hrg)); - - /* Convert output */ - IGRAPH_FINALLY(igraph_destroy, &c_graph); - PROTECT(graph=R_igraph_to_SEXP(&c_graph)); - IGRAPH_I_DESTROY(&c_graph); - IGRAPH_FINALLY_CLEAN(1); - r_result = graph; - - UNPROTECT(1); - return(r_result); -} diff --git a/tools/stimulus/functions-R.yaml b/tools/stimulus/functions-R.yaml index 18d39862517..6aa30751409 100644 --- a/tools/stimulus/functions-R.yaml +++ b/tools/stimulus/functions-R.yaml @@ -19,12 +19,18 @@ igraph_add_edges: igraph_add_vertices: IGNORE: RR, RC, RInit +igraph_copy: + igraph_delete_edges: IGNORE: RR, RC igraph_delete_vertices: IGNORE: RR, RC +igraph_delete_vertices_idx: + +igraph_vcount: + igraph_ecount: IGNORE: RR, RC @@ -43,19 +49,31 @@ igraph_edge: igraph_edges: IGNORE: RR, RC +igraph_empty_attrs: + igraph_get_eid: IGNORE: RR, RC, RInit igraph_get_eids: IGNORE: RR, RC, RInit +igraph_get_all_eids_between: + # This is a temporary hack; we need to find a way to handle default values + # for dependencies. The problem is that the VERTEXINDEX type needs two + # dependencies: the graph and the vertex set, but we only have the graph + # in the argument list. + DEPS: from ON graph, to ON graph, eids ON graph + igraph_incident: IGNORE: RR, RC igraph_is_same_graph: + IGNORE: RR, RC, RInit # Not needed in R; we can simply compare things in the R layer without # calling into C - IGNORE: RR, RC, RInit + +igraph_create: + IGNORE: RR, RC ####################################### # Constructors, deterministic @@ -64,27 +82,32 @@ igraph_is_same_graph: igraph_adjacency: IGNORE: RR +igraph_sparse_adjacency: + +igraph_sparse_weighted_adjacency: + igraph_weighted_adjacency: IGNORE: RR -igraph_create: - IGNORE: RR, RC - igraph_star: IGNORE: RR, RC -igraph_lattice: - IGNORE: RR, RC +igraph_wheel: -igraph_ring: - IGNORE: RR, RC +igraph_square_lattice: + +igraph_triangular_lattice: -igraph_tree: +igraph_ring: IGNORE: RR, RC igraph_kary_tree: IGNORE: RR, RC +igraph_symmetric_tree: + +igraph_regular_tree: + igraph_full: IGNORE: RR, RC @@ -103,6 +126,8 @@ igraph_extended_chordal_ring: igraph_connect_neighborhood: IGNORE: RR, RC +igraph_graph_power: + igraph_linegraph: IGNORE: RR, RC @@ -120,9 +145,13 @@ igraph_lcf_vector: GATTR: name: LCF graph +igraph_adjlist: + igraph_full_bipartite: IGNORE: RR +igraph_full_multipartite: + igraph_realize_degree_sequence: PARAMS: |- OUT GRAPH graph, VECTOR_INT out_deg, OPTIONAL VECTOR_INT in_deg=NULL, @@ -132,6 +161,14 @@ igraph_realize_degree_sequence: name: Graph from degree sequence GATTR-PARAM: out_deg, in_deg, allowed_edge_types, method +igraph_circulant: + +igraph_generalized_petersen: + +igraph_turan: + +igraph_weighted_sparsemat: + ####################################### # Constructors, games ####################################### @@ -176,12 +213,12 @@ igraph_asymmetric_preference_game: IGNORE: RR igraph_rewire_edges: - # Handled by rewire() in the R interface and rewire_directed_edges() IGNORE: RR + # Handled by rewire() in the R interface and rewire_directed_edges() igraph_rewire_directed_edges: - # Handled by rewire() in the R interface IGNORE: RR + # Handled by rewire() in the R interface igraph_watts_strogatz_game: IGNORE: RR, RC @@ -252,6 +289,16 @@ igraph_correlated_game: name: Correlated random graph GATTR-PARAM: corr, p +igraph_correlated_pair_game: + +igraph_dot_product_game: + +igraph_sample_sphere_surface: + +igraph_sample_sphere_volume: + +igraph_sample_dirichlet: + ####################################### # Basic query functions ####################################### @@ -269,26 +316,24 @@ igraph_diameter: igraph_diameter_dijkstra: IGNORE: RR, RC, RInit -igraph_minimum_spanning_tree: - IGNORE: RR, RC, RInit - -igraph_minimum_spanning_tree_unweighted: - IGNORE: RR, RC - -igraph_minimum_spanning_tree_prim: - IGNORE: RR, RC - igraph_closeness: IGNORE: RR -igraph_expand_path_to_pairs: - IGNORE: RR - igraph_closeness_cutoff: IGNORE: RR -igraph_shortest_paths: - IGNORE: RR, RC, RInit +igraph_distances: + +igraph_distances_cutoff: + +igraph_get_shortest_path: + +igraph_get_shortest_path_bellman_ford: + +igraph_get_shortest_path_dijkstra: + +igraph_get_shortest_path_astar: + IGNORE: RR, RC, Rinit igraph_get_shortest_paths: IGNORE: RR, RC, RInit @@ -299,8 +344,9 @@ igraph_get_all_shortest_paths: vertices: vpaths edges: epaths -igraph_shortest_paths_dijkstra: - IGNORE: RR, RC, RInit +igraph_distances_dijkstra: + +igraph_distances_dijkstra_cutoff: igraph_get_shortest_paths_dijkstra: IGNORE: RR, RC, RInit @@ -314,17 +360,29 @@ igraph_get_all_shortest_paths_dijkstra: vertices: vpaths edges: epaths -igraph_shortest_paths_bellman_ford: - IGNORE: RR, RC, RInit +igraph_distances_bellman_ford: -igraph_shortest_paths_johnson: - IGNORE: RR, RC, RInit +igraph_distances_johnson: + +igraph_distances_floyd_warshall: + +igraph_voronoi: igraph_get_all_simple_paths: IGNORE: RR R: PP: get.all.simple.paths.pp +igraph_get_k_shortest_paths: + +igraph_get_widest_path: + +igraph_get_widest_paths: + +igraph_widest_path_widths_dijkstra: + +igraph_widest_path_widths_floyd_warshall: + igraph_spanner: DEPS: weights ON graph, spanner ON graph @@ -352,28 +410,44 @@ igraph_edge_betweenness_subset: eids ON graph, weights ON graph V(graph), res ON graph V(graph), sources ON graph, targets ON graph igraph_harmonic_centrality: - # This is handled by igraph_harmonic_centrality_cutoff IGNORE: RR, RC, RInit + # This is handled by igraph_harmonic_centrality_cutoff + +igraph_harmonic_centrality_cutoff: igraph_pagerank: IGNORE: RR, RC, RInit +igraph_personalized_pagerank: + +igraph_personalized_pagerank_vs: + DEPS: vids ON graph, weights ON graph, vector ON graph vids, + options ON algo, reset_vids ON graph + igraph_rewire: IGNORE: RR, RC igraph_induced_subgraph: IGNORE: RR +igraph_subgraph_from_edges: + +igraph_reverse_edges: + igraph_average_path_length: + IGNORE: RR, RC, RInit # No need for it, igraph_average_path_length_dijkstra takes care of the # unweighted case as well - IGNORE: RR, RC, RInit igraph_average_path_length_dijkstra: PARAM_NAMES: unconn_pairs: unconnected unconn: unconnected +igraph_path_length_hist: + +igraph_simplify: + igraph_transitivity_undirected: IGNORE: RR, RC @@ -386,6 +460,8 @@ igraph_transitivity_avglocal_undirected: igraph_transitivity_barrat: IGNORE: RR, RC +igraph_ecc: + igraph_reciprocity: IGNORE: RR, RC @@ -410,14 +486,26 @@ igraph_neighborhood_graphs: igraph_topological_sorting: IGNORE: RR, RC +igraph_feedback_arc_set: + igraph_is_loop: PARAM_NAMES: es: eids +igraph_is_dag: + +igraph_is_acyclic: + +igraph_is_simple: + igraph_is_multiple: PARAM_NAMES: es: eids +igraph_has_loop: + +igraph_has_multiple: + igraph_count_multiple: PARAM_NAMES: es: eids @@ -425,38 +513,11 @@ igraph_count_multiple: igraph_girth: IGNORE: RR, RC, RInit +igraph_is_perfect: + igraph_add_edge: IGNORE: RR, RC, RInit -igraph_personalized_pagerank_vs: - DEPS: vids ON graph, weights ON graph, vector ON graph vids, - options ON algo, reset_vids ON graph - -igraph_get_all_eids_between: - # This is a temporary hack; we need to find a way to handle default values - # for dependencies. The problem is that the VERTEXINDEX type needs two - # dependencies: the graph and the vertex set, but we only have the graph - # in the argument list. - DEPS: from ON graph, to ON graph, eids ON graph - -igraph_pseudo_diameter: - DEPS: start_vid ON graph - -igraph_pseudo_diameter_dijkstra: - DEPS: start_vid ON graph, weights ON graph - -igraph_bfs_simple: - DEPS: root ON graph, order ON graph - -igraph_is_bipartite: - DEPS: type ON graph V(graph) - -igraph_bipartite_game: - DEPS: types ON graph V(graph) - -igraph_vertex_path_from_edge_path: - DEPS: start ON graph, vertex_path ON graph, edge_path ON graph - igraph_eigenvector_centrality: # This is a temporary hack; we need to find a way to handle default values # for dependencies. The problem is that the VERTEXINDEX type needs two @@ -485,15 +546,6 @@ igraph_hub_and_authority_scores: # in the argument list. DEPS: weights ON graph, hub_vector ON graph V(graph), authority_vector ON graph V(graph) -igraph_arpack_rssolve: - IGNORE: RR, RC, RInit - -igraph_arpack_rnsolve: - IGNORE: RR, RC, RInit - -igraph_get_shortest_path_astar: - IGNORE: RR, RC, Rinit - igraph_unfold_tree: IGNORE: RR @@ -501,13 +553,73 @@ igraph_is_mutual: PARAM_NAMES: es: eids +igraph_has_mutual: + +igraph_maximum_cardinality_search: + igraph_is_chordal: IGNORE: RR, RC, RInit +igraph_avg_nearest_neighbor_degree: + +igraph_degree_correlation_vector: + +igraph_strength: + +igraph_centralization: + +igraph_centralization_degree: + igraph_centralization_degree_tmax: + IGNORE: RR # temporarily coded manually because we need to handle a deprecation # between igraph 1.3.0 and 1.4.0 - IGNORE: RR + +igraph_centralization_betweenness: + +igraph_centralization_betweenness_tmax: + +igraph_centralization_closeness: + +igraph_centralization_closeness_tmax: + +igraph_centralization_eigenvector_centrality: + +igraph_centralization_eigenvector_centrality_tmax: + +igraph_assortativity_nominal: + +igraph_assortativity: + +igraph_assortativity_degree: + +igraph_joint_degree_matrix: + +igraph_joint_degree_distribution: + +igraph_joint_type_distribution: + +igraph_contract_vertices: + +igraph_eccentricity: + +igraph_eccentricity_dijkstra: + +igraph_graph_center: + +igraph_graph_center_dijkstra: + +igraph_radius: + +igraph_radius_dijkstra: + +igraph_pseudo_diameter: + DEPS: start_vid ON graph + +igraph_pseudo_diameter_dijkstra: + DEPS: start_vid ON graph, weights ON graph + +igraph_diversity: igraph_random_walk: PARAM_ORDER: graph, start, steps, ... @@ -515,19 +627,25 @@ igraph_random_walk: igraph_random_edge_walk: PARAM_ORDER: graph, start, steps, ... +igraph_global_efficiency: + +igraph_local_efficiency: + +igraph_average_local_efficiency: + +igraph_transitive_closure_dag: + +igraph_trussness: + ####################################### # Degree sequences ####################################### -igraph_is_degree_sequence: - IGNORE: RR, RC, RInit - -igraph_is_graphical_degree_sequence: - IGNORE: RR, RC, RInit - igraph_is_bigraphical: IGNORE: RR, RC, RInit +igraph_is_graphical: + ####################################### # Visitors ####################################### @@ -535,6 +653,9 @@ igraph_is_bigraphical: igraph_bfs: IGNORE: RR, RC, RInit +igraph_bfs_simple: + DEPS: root ON graph, order ON graph + igraph_dfs: IGNORE: RR, RC, RInit @@ -542,6 +663,12 @@ igraph_dfs: # Bipartite graphs ####################################### +igraph_bipartite_projection_size: + +####################################### +# Bipartite graphs +####################################### + igraph_bipartite_projection: IGNORE: RR, RC, RInit @@ -551,18 +678,32 @@ igraph_create_bipartite: igraph_biadjacency: DEPS: types ON graph V(graph) +igraph_get_biadjacency: + +igraph_is_bipartite: + DEPS: type ON graph V(graph) + igraph_bipartite_game_gnp: IGNORE: RR igraph_bipartite_game_gnm: IGNORE: RR +igraph_bipartite_game: + DEPS: types ON graph V(graph) + + ####################################### # Spectral properties ####################################### -igraph_laplacian: - IGNORE: RR, RC, RInit +igraph_get_laplacian: + +igraph_get_laplacian_sparse: + +####################################### +# Spectral properties +####################################### ####################################### # Components @@ -571,9 +712,17 @@ igraph_laplacian: igraph_connected_components: IGNORE: RR +igraph_is_connected: + igraph_decompose: IGNORE: RR, RC +igraph_articulation_points: + +igraph_biconnected_components: + +igraph_bridges: + ####################################### # Cliques ####################################### @@ -586,9 +735,18 @@ igraph_cliques: igraph_cliques_callback: IGNORE: RR, RC, RInit +igraph_clique_size_hist: + # Wrapper function is hand-rolled in the R layer; the generated version + # is renamed and internal + INTERNAL: true + +igraph_largest_cliques: + igraph_maximal_cliques: IGNORE: RR, RC, RInit +igraph_maximal_cliques_subset: + igraph_maximal_cliques_callback: IGNORE: RR, RC, RInit @@ -598,18 +756,18 @@ igraph_maximal_cliques_count: igraph_maximal_cliques_file: IGNORE: RR, RC, RInit -igraph_clique_size_hist: - # Wrapper function is hand-rolled in the R layer; the generated version - # is renamed and internal - INTERNAL: true - igraph_maximal_cliques_hist: # Wrapper function is hand-rolled in the R layer; the generated version # is renamed and internal INTERNAL: true -igraph_weighted_cliques_callback: - IGNORE: RR, RC, RInit +igraph_clique_number: + +igraph_weighted_cliques: + +igraph_largest_weighted_cliques: + +igraph_weighted_clique_number: igraph_independent_vertex_sets: IGNORE: RR, RC @@ -634,8 +792,8 @@ igraph_layout_circle: IGNORE: RR, RC igraph_layout_star: - DEPS: center ON graph IGNORE: RR + DEPS: center ON graph igraph_layout_grid: IGNORE: RR @@ -658,6 +816,8 @@ igraph_layout_reingold_tilford: igraph_layout_reingold_tilford_circular: IGNORE: RR, RC, RInit +igraph_roots_for_tree_layout: + igraph_layout_random_3d: IGNORE: RR, RC @@ -697,6 +857,12 @@ igraph_layout_gem: igraph_layout_davidson_harel: IGNORE: RR +igraph_layout_umap: + +igraph_layout_umap_3d: + +igraph_layout_umap_compute_weights: + ####################################### # Cocitation and other similarity measures ####################################### @@ -707,6 +873,20 @@ igraph_cocitation: igraph_bibcoupling: IGNORE: RR, RC +igraph_similarity_dice: + +igraph_similarity_dice_es: + +igraph_similarity_dice_pairs: + +igraph_similarity_inverse_log_weighted: + +igraph_similarity_jaccard: + +igraph_similarity_jaccard_es: + +igraph_similarity_jaccard_pairs: + ####################################### # Community structure ####################################### @@ -758,28 +938,57 @@ igraph_community_fluid_communities: igraph_community_label_propagation: IGNORE: RR -igraph_community_leiden: - IGNORE: RR - igraph_community_multilevel: IGNORE: RR igraph_community_optimal_modularity: IGNORE: RR +igraph_community_leiden: + IGNORE: RR + igraph_split_join_distance: IGNORE: RR +igraph_community_infomap: + IGNORE: RR + +igraph_community_voronoi: + IGNORE: RR, RC, RInit + +####################################### +# Graphlets +####################################### + +igraph_graphlets: + IGNORE: RC + +igraph_graphlets_candidate_basis: + IGNORE: RR, RC + +igraph_graphlets_project: + IGNORE: RR, RC, RInit + +####################################### +# Hierarchical random graphs +####################################### + igraph_hrg_fit: IGNORE: RR R: CLASS: igraphHRG +igraph_hrg_sample: + +igraph_hrg_sample_many: + igraph_hrg_game: R: GATTR: name: Hierarchical random graph model +igraph_hrg_consensus: + igraph_hrg_predict: IGNORE: RR @@ -787,17 +996,11 @@ igraph_hrg_create: R: CLASS: igraphHRG -igraph_community_infomap: - IGNORE: RR - -igraph_graphlets: - IGNORE: RC +igraph_hrg_resize: -igraph_graphlets_candidate_basis: - IGNORE: RR, RC +igraph_hrg_size: -igraph_graphlets_project: - IGNORE: RR, RC, RInit +igraph_from_hrg_dendrogram: ####################################### # Conversion @@ -806,18 +1009,15 @@ igraph_graphlets_project: igraph_get_adjacency: IGNORE: RR, RC +igraph_get_adjacency_sparse: + igraph_get_edgelist: IGNORE: RR, RC -igraph_invalidate_cache: - PARAMS: INOUT GRAPH graph +igraph_get_stochastic: IGNORE: RR -igraph_write_graph_dimacs_flow: - PARAMS: |- - INOUT GRAPH graph, OUTFILE outstream, VERTEX source=0, VERTEX target=0, - VECTOR capacity - IGNORE: RR +igraph_get_stochastic_sparse: igraph_to_directed: PARAMS: INOUT GRAPH graph, TODIRECTED mode=MUTUAL @@ -825,9 +1025,6 @@ igraph_to_directed: igraph_to_undirected: IGNORE: RR -igraph_get_stochastic: - IGNORE: RR - ####################################### # Read and write foreign formats ####################################### @@ -847,8 +1044,7 @@ igraph_read_graph_pajek: igraph_read_graph_graphml: IGNORE: RR, RC -igraph_read_graph_dimacs: - IGNORE: RR, RC +igraph_read_graph_dimacs_flow: igraph_read_graph_graphdb: IGNORE: RR, RC @@ -877,8 +1073,11 @@ igraph_write_graph_graphml: igraph_write_graph_pajek: IGNORE: RR, RC -igraph_write_graph_dimacs: - IGNORE: RR, RC +igraph_write_graph_dimacs_flow: + IGNORE: RR + PARAMS: |- + INOUT GRAPH graph, OUTFILE outstream, VERTEX source=0, VERTEX target=0, + VECTOR capacity igraph_write_graph_gml: IGNORE: RR, RC @@ -899,6 +1098,12 @@ igraph_motifs_randesu_estimate: igraph_motifs_randesu_no: IGNORE: RR, RC +igraph_dyad_census: + +igraph_triad_census: + +igraph_adjacent_triangles: + igraph_local_scan_0: IGNORE: RR @@ -920,6 +1125,10 @@ igraph_local_scan_k_ecount_them: igraph_local_scan_neighborhood_ecount: IGNORE: RR +igraph_local_scan_subset_ecount: + +igraph_list_triangles: + ####################################### # Graph operators ####################################### @@ -951,25 +1160,35 @@ igraph_complementer: igraph_compose: IGNORE: RR, RC, RInit +igraph_induced_subgraph_map: + ####################################### # Maximum flows, minimum cuts ####################################### +igraph_gomory_hu_tree: + +igraph_maxflow: + igraph_maxflow_value: IGNORE: RR, RC, RInit -igraph_mincut_value: +igraph_mincut: IGNORE: RR, RC -igraph_st_mincut_value: +igraph_mincut_value: IGNORE: RR, RC -igraph_mincut: - IGNORE: RR, RC +igraph_residual_graph: + +igraph_reverse_residual_graph: igraph_st_mincut: IGNORE: RR +igraph_st_mincut_value: + IGNORE: RR, RC + igraph_st_vertex_connectivity: IGNORE: RR, RC, RInit @@ -998,6 +1217,22 @@ igraph_cohesion: # Listing s-t cuts, separators ####################################### +igraph_dominator_tree: + +igraph_all_st_cuts: + +igraph_all_st_mincuts: + +igraph_even_tarjan_reduction: + +igraph_is_separator: + +igraph_is_minimal_separator: + +igraph_all_minimal_st_separators: + +igraph_minimum_size_separators: + igraph_cohesive_blocks: IGNORE: RR, RC R: @@ -1014,47 +1249,55 @@ igraph_coreness: # Graph isomorphism ####################################### +igraph_isoclass: + +igraph_isomorphic: + igraph_isoclass_subgraph: IGNORE: RR +igraph_isoclass_create: + +igraph_isomorphic_vf2: + +igraph_count_isomorphisms_vf2: + igraph_get_isomorphisms_vf2: IGNORE: RR +igraph_subisomorphic: + +igraph_subisomorphic_vf2: + +igraph_get_subisomorphisms_vf2_callback: + +igraph_count_subisomorphisms_vf2: + igraph_get_subisomorphisms_vf2: IGNORE: RR +igraph_canonical_permutation: + +igraph_permute_vertices: + +igraph_isomorphic_bliss: + +igraph_count_automorphisms: + +igraph_automorphism_group: + igraph_subisomorphic_lad: IGNORE: RR, RC, RInit igraph_simplify_and_colorize: + IGNORE: RR + # R function is hand-rolled # Despite their names, vertex_color and edge_color are not really colors # but _multiplicities_, so we simply use VECTOR_INT there PARAMS: |- GRAPH graph, OUT GRAPH res, OUT VECTOR_INT vertex_color, OUT VECTOR_INT edge_color - # R function is hand-rolled - IGNORE: RR - -####################################### -# SCG -####################################### - -# TODO: define what to do with SCG -# scg is in separate repository from -# igraph_scg_grouping: -# IGNORE: RR - -# igraph_scg_semiprojectors: -# IGNORE: RR, RC, RInit - -# igraph_scg_adjacency: -# IGNORE: RR, RC, RInit - -# igraph_scg_stochastic: -# IGNORE: RR, RC, RInit - -# igraph_scg_laplacian: -# IGNORE: RR, RC, RInit +igraph_graph_count: ####################################### # Matching @@ -1083,6 +1326,8 @@ igraph_laplacian_spectral_embedding: # Eigensolvers ####################################### +igraph_eigen_adjacency: + ####################################### # Fitting power laws ####################################### @@ -1108,6 +1353,20 @@ igraph_running_mean: igraph_random_sample: IGNORE: RR, RC +igraph_convex_hull: + +igraph_dim_select: + +igraph_almost_equals: + +igraph_cmp_epsilon: + +igraph_eigen_matrix: + +igraph_eigen_matrix_symmetric: + +igraph_solve_lsap: + ####################################### # Eulerian functions ####################################### @@ -1125,42 +1384,67 @@ igraph_eulerian_cycle: edge_res: epath vertex_res: vpath +####################################### +# Cycle bases +####################################### + +igraph_fundamental_cycles: + +igraph_minimum_cycle_basis: + ####################################### # Trees ####################################### +igraph_is_tree: + PARAMS: GRAPH graph, PRIMARY OUT BOOLEAN res, OPTIONAL OUT VERTEX_ROOT root, NEIMODE mode=OUT + DEPS: root ON graph + +igraph_is_forest: + igraph_from_prufer: R: GATTR: name: Tree from Prufer sequence GATTR-PARAM: prufer -igraph_random_spanning_tree: - PARAMS: GRAPH graph, OUT EDGE_INDICES res, OPTIONAL VERTEX vid=0 +igraph_to_prufer: -igraph_get_stochastic_sparsemat: - PARAMS: |- - GRAPH graph, OUT SPARSEMATPTR sparsemat, - BOOLEAN column_wise=False +igraph_tree_from_parent_vector: -igraph_hrg_dendrogram: - PARAMS: OUT GRAPH graph, HRG hrg +igraph_minimum_spanning_tree: + IGNORE: RR, RC, RInit -igraph_is_tree: - PARAMS: GRAPH graph, PRIMARY OUT BOOLEAN res, OPTIONAL OUT VERTEX_ROOT root, NEIMODE mode=OUT - DEPS: root ON graph +igraph_minimum_spanning_tree_unweighted: + IGNORE: RR, RC + +igraph_minimum_spanning_tree_prim: + IGNORE: RR, RC + +igraph_random_spanning_tree: + PARAMS: GRAPH graph, OUT EDGE_INDICES res, OPTIONAL VERTEX vid=0 + +igraph_tree_game: ####################################### # Coloring ####################################### +igraph_vertex_coloring_greedy: + ####################################### # Microscopic update ####################################### +igraph_deterministic_optimal_imitation: + igraph_moran_process: DEPS: weights ON graph, quantities ON graph V(graph), strategies ON graph +igraph_roulette_wheel_imitation: + +igraph_stochastic_imitation: + ####################################### # Other, (yet) undocumented functions ####################################### @@ -1168,5 +1452,34 @@ igraph_moran_process: igraph_convergence_degree: IGNORE: RR, RC, RInit -igraph_community_voronoi: - IGNORE: RR, RC, RInit +igraph_has_attribute_table: + +####################################### +# Progress, status handling +####################################### + +igraph_progress: + +igraph_status: + +igraph_strerror: + +####################################### +# Other functions, documented, graph related +####################################### + +igraph_expand_path_to_pairs: + IGNORE: RR + +igraph_invalidate_cache: + IGNORE: RR + PARAMS: INOUT GRAPH graph + +igraph_vertex_path_from_edge_path: + DEPS: start ON graph, vertex_path ON graph, edge_path ON graph + +####################################### +# Meta info +####################################### + +igraph_version: diff --git a/tools/sync-yaml.R b/tools/sync-yaml.R new file mode 100644 index 00000000000..1cb83cb068c --- /dev/null +++ b/tools/sync-yaml.R @@ -0,0 +1,57 @@ +library(dplyr) +library(purrr) + +lines_r <- brio::read_file("tools/stimulus/functions-R.yaml") + +split_r <- strsplit(lines_r, "\n(?=((?:#.*|)\n)+igraph_.*:\n(?:(?:[ #].*|)\n)*\n+)", perl = TRUE)[[1]] + +proper_r <- grepl("^\nigraph_", split_r) + +r <- tibble(proper = proper_r, split = split_r) |> + mutate(id = cumsum(lag(proper, default = FALSE))) |> + summarize(.by = id, text_r = paste(split, collapse = "\n")) |> + transmute( + name = gsub(".*\n(igraph[^:]+):.*", "\\1", text_r), + text_r + ) + +map(r$text_r, grep, pattern = "\nigraph") |> + lengths() |> + unique() + +lines_c <- paste0(brio::read_file("src/vendor/cigraph/interfaces/functions.yaml"), "\n") + +split_c <- strsplit(lines_c, "\n(?=((?:#.*|)\n)+igraph_.*:\n(?:(?:[ #].*|)\n)*\n+)", perl = TRUE)[[1]] + +proper_c <- grepl("^\nigraph_", split_c) + +c <- tibble(proper = proper_c, split = split_c) |> + mutate(id = cumsum(lag(proper, default = FALSE))) |> + summarize(.by = id, text_c = paste(split, collapse = "\n")) |> + transmute( + name = gsub(".*\n(igraph[^:]+):.*", "\\1", text_c), + text_c + ) + +map(c$text_c, grep, pattern = "\nigraph") |> + lengths() |> + unique() + +# Remove unused +semi_join(r, c) |> + pull() |> + paste(collapse = "\n") |> + brio::write_file("tools/stimulus/functions-R.yaml") + +# Reorder in C order +inner_join(c, r) |> + pull() |> + paste(collapse = "\n") |> + brio::write_file("tools/stimulus/functions-R.yaml") + +# Add new +left_join(c, r) |> + mutate(text_r = coalesce(text_r, gsub("(:).*$", "\\1", text_c))) |> + pull() |> + paste(collapse = "\n") |> + brio::write_file("tools/stimulus/functions-R.yaml")