From c1d079119c3118345cfb2d5902519dbc4f1b005b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szabolcs=20Horva=CC=81t?= Date: Fri, 8 Nov 2024 10:50:09 +0000 Subject: [PATCH] interface: re-add `NULL` default value for the `weights` parameter of widest path functions This parameter is not optional in C, but it still needs a default in R to signify that weights should be taken from attributes. --- R/aaa-auto.R | 8 ++++---- tools/stimulus/functions-R.yaml | 23 +++++++++++++++++++++++ 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/R/aaa-auto.R b/R/aaa-auto.R index a04fa1f187..a0a4c5c571 100644 --- a/R/aaa-auto.R +++ b/R/aaa-auto.R @@ -793,7 +793,7 @@ get_k_shortest_paths_impl <- function(graph, from, to, ..., k, weights=NULL, mod res } -get_widest_path_impl <- function(graph, from, to, weights, mode=c("out", "in", "all", "total")) { +get_widest_path_impl <- function(graph, from, to, weights=NULL, mode=c("out", "in", "all", "total")) { # Argument checks ensure_igraph(graph) from <- as_igraph_vs(graph, from) @@ -826,7 +826,7 @@ get_widest_path_impl <- function(graph, from, to, weights, mode=c("out", "in", " res } -get_widest_paths_impl <- function(graph, from, to=V(graph), weights, mode=c("out", "in", "all", "total")) { +get_widest_paths_impl <- function(graph, from, to=V(graph), weights=NULL, mode=c("out", "in", "all", "total")) { # Argument checks ensure_igraph(graph) from <- as_igraph_vs(graph, from) @@ -856,7 +856,7 @@ get_widest_paths_impl <- function(graph, from, to=V(graph), weights, mode=c("out res } -widest_path_widths_dijkstra_impl <- function(graph, from=V(graph), to=V(graph), weights, mode=c("out", "in", "all", "total")) { +widest_path_widths_dijkstra_impl <- function(graph, from=V(graph), to=V(graph), weights=NULL, mode=c("out", "in", "all", "total")) { # Argument checks ensure_igraph(graph) from <- as_igraph_vs(graph, from) @@ -878,7 +878,7 @@ widest_path_widths_dijkstra_impl <- function(graph, from=V(graph), to=V(graph), res } -widest_path_widths_floyd_warshall_impl <- function(graph, from=V(graph), to=V(graph), weights, mode=c("out", "in", "all", "total")) { +widest_path_widths_floyd_warshall_impl <- function(graph, from=V(graph), to=V(graph), weights=NULL, mode=c("out", "in", "all", "total")) { # Argument checks ensure_igraph(graph) from <- as_igraph_vs(graph, from) diff --git a/tools/stimulus/functions-R.yaml b/tools/stimulus/functions-R.yaml index f46ea66aa0..6054072f11 100644 --- a/tools/stimulus/functions-R.yaml +++ b/tools/stimulus/functions-R.yaml @@ -400,12 +400,35 @@ igraph_get_k_shortest_paths: edge_paths: epaths igraph_get_widest_path: + PARAMS: |- + GRAPH graph, + OPTIONAL OUT VERTEX_INDICES vertices, OPTIONAL OUT EDGE_INDICES edges, + VERTEX from, VERTEX to, EDGEWEIGHTS weights=NULL, NEIMODE mode=OUT + DEPS: |- + from ON graph, to ON graph, weights ON graph, vertices ON graph, edges ON graph igraph_get_widest_paths: + PARAMS: |- + GRAPH graph, + OPTIONAL OUT VERTEXSET_LIST vertices, OPTIONAL OUT EDGESET_LIST edges, + VERTEX from, VERTEX_SELECTOR to=ALL, EDGEWEIGHTS weights=NULL, + NEIMODE mode=OUT, OPTIONAL OUT VECTOR_INT parents, + OPTIONAL OUT VECTOR_INT inbound_edges + DEPS: |- + from ON graph, to ON graph, weights ON graph, vertices ON graph, + edges ON graph igraph_widest_path_widths_dijkstra: + PARAMS: |- + GRAPH graph, OUT MATRIX res, VERTEX_SELECTOR from=ALL, + VERTEX_SELECTOR to=ALL, EDGEWEIGHTS weights=NULL, NEIMODE mode=OUT + DEPS: from ON graph, to ON graph, weights ON graph igraph_widest_path_widths_floyd_warshall: + PARAMS: |- + GRAPH graph, OUT MATRIX res, VERTEX_SELECTOR from=ALL, + VERTEX_SELECTOR to=ALL, EDGEWEIGHTS weights=NULL, NEIMODE mode=OUT + DEPS: from ON graph, to ON graph, weights ON graph igraph_spanner: DEPS: weights ON graph, spanner ON graph