Skip to content

Commit ff0b313

Browse files
szhorvatkrlmlr
authored andcommitted
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.
1 parent a12fe8c commit ff0b313

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

R/aaa-auto.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ get_k_shortest_paths_impl <- function(graph, from, to, ..., k, weights=NULL, mod
793793
res
794794
}
795795

796-
get_widest_path_impl <- function(graph, from, to, weights, mode=c("out", "in", "all", "total")) {
796+
get_widest_path_impl <- function(graph, from, to, weights=NULL, mode=c("out", "in", "all", "total")) {
797797
# Argument checks
798798
ensure_igraph(graph)
799799
from <- as_igraph_vs(graph, from)
@@ -826,7 +826,7 @@ get_widest_path_impl <- function(graph, from, to, weights, mode=c("out", "in", "
826826
res
827827
}
828828

829-
get_widest_paths_impl <- function(graph, from, to=V(graph), weights, mode=c("out", "in", "all", "total")) {
829+
get_widest_paths_impl <- function(graph, from, to=V(graph), weights=NULL, mode=c("out", "in", "all", "total")) {
830830
# Argument checks
831831
ensure_igraph(graph)
832832
from <- as_igraph_vs(graph, from)
@@ -856,7 +856,7 @@ get_widest_paths_impl <- function(graph, from, to=V(graph), weights, mode=c("out
856856
res
857857
}
858858

859-
widest_path_widths_dijkstra_impl <- function(graph, from=V(graph), to=V(graph), weights, mode=c("out", "in", "all", "total")) {
859+
widest_path_widths_dijkstra_impl <- function(graph, from=V(graph), to=V(graph), weights=NULL, mode=c("out", "in", "all", "total")) {
860860
# Argument checks
861861
ensure_igraph(graph)
862862
from <- as_igraph_vs(graph, from)
@@ -878,7 +878,7 @@ widest_path_widths_dijkstra_impl <- function(graph, from=V(graph), to=V(graph),
878878
res
879879
}
880880

881-
widest_path_widths_floyd_warshall_impl <- function(graph, from=V(graph), to=V(graph), weights, mode=c("out", "in", "all", "total")) {
881+
widest_path_widths_floyd_warshall_impl <- function(graph, from=V(graph), to=V(graph), weights=NULL, mode=c("out", "in", "all", "total")) {
882882
# Argument checks
883883
ensure_igraph(graph)
884884
from <- as_igraph_vs(graph, from)

tools/stimulus/functions-R.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,12 +400,35 @@ igraph_get_k_shortest_paths:
400400
edge_paths: epaths
401401

402402
igraph_get_widest_path:
403+
PARAMS: |-
404+
GRAPH graph,
405+
OPTIONAL OUT VERTEX_INDICES vertices, OPTIONAL OUT EDGE_INDICES edges,
406+
VERTEX from, VERTEX to, EDGEWEIGHTS weights=NULL, NEIMODE mode=OUT
407+
DEPS: |-
408+
from ON graph, to ON graph, weights ON graph, vertices ON graph, edges ON graph
403409
404410
igraph_get_widest_paths:
411+
PARAMS: |-
412+
GRAPH graph,
413+
OPTIONAL OUT VERTEXSET_LIST vertices, OPTIONAL OUT EDGESET_LIST edges,
414+
VERTEX from, VERTEX_SELECTOR to=ALL, EDGEWEIGHTS weights=NULL,
415+
NEIMODE mode=OUT, OPTIONAL OUT VECTOR_INT parents,
416+
OPTIONAL OUT VECTOR_INT inbound_edges
417+
DEPS: |-
418+
from ON graph, to ON graph, weights ON graph, vertices ON graph,
419+
edges ON graph
405420
406421
igraph_widest_path_widths_dijkstra:
422+
PARAMS: |-
423+
GRAPH graph, OUT MATRIX res, VERTEX_SELECTOR from=ALL,
424+
VERTEX_SELECTOR to=ALL, EDGEWEIGHTS weights=NULL, NEIMODE mode=OUT
425+
DEPS: from ON graph, to ON graph, weights ON graph
407426

408427
igraph_widest_path_widths_floyd_warshall:
428+
PARAMS: |-
429+
GRAPH graph, OUT MATRIX res, VERTEX_SELECTOR from=ALL,
430+
VERTEX_SELECTOR to=ALL, EDGEWEIGHTS weights=NULL, NEIMODE mode=OUT
431+
DEPS: from ON graph, to ON graph, weights ON graph
409432

410433
igraph_spanner:
411434
DEPS: weights ON graph, spanner ON graph

0 commit comments

Comments
 (0)