Skip to content

Commit

Permalink
Satisfy Stimulus
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Dec 11, 2024
1 parent 239e03b commit c89fee0
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/vendor/cigraph/interfaces/functions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2524,7 +2524,7 @@ igraph_eulerian_path:
DEPS: edge_res ON graph, vertex_res ON graph

igraph_eulerian_cycle:
PARAMS: GRAPH graph, OPTIONAL OUT EDGE_INDICES edge_res, OPTIONAL OUT VERTEX_INDICES vertex_res
PARAMS: GRAPH graph, OPTIONAL OUT EDGE_INDICES edge_res, OPTIONAL OUT VERTEX_INDICES_PV vertex_res
DEPS: edge_res ON graph, vertex_res ON graph

#######################################
Expand Down
5 changes: 5 additions & 0 deletions src/vendor/cigraph/interfaces/types.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@ VERTEX_INDICES:
CTYPE: igraph_vector_int_t
FLAGS: BY_REF

VERTEX_INDICES_PV:
# An integer vector containing vertex indices.
CTYPE: igraph_vector_int_t
FLAGS: BY_REF

VERTEX_INDEX_PAIRS:
# An integer vector containing pairs of vertex indices, in a flattened
# representation
Expand Down
21 changes: 21 additions & 0 deletions tools/stimulus/types-RC.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,27 @@ VERTEX_INDICES:
igraph_vector_int_destroy(&%C%);
IGRAPH_FINALLY_CLEAN(1);
VERTEX_INDICES_PV:
CALL: '&%C%'
CTYPE: igraph_vector_int_t
INCONV:
IN: |-
R_SEXP_to_vector_int_copy(%I%, &%C%);
IGRAPH_FINALLY_PV(igraph_vector_int_destroy, &%C%);
OUT: |-
if (0 != igraph_vector_int_init(&%C%, 0)) {
igraph_error("", __FILE__, __LINE__, IGRAPH_ENOMEM);
}
IGRAPH_FINALLY_PV(igraph_vector_int_destroy, &%C%);
OUTCONV:
IN: |-
igraph_vector_int_destroy(&%C%);
IGRAPH_FINALLY_CLEAN(1);
OUT: |-
PROTECT(%I%=R_igraph_vector_int_to_SEXPp1(&%C%));
igraph_vector_int_destroy(&%C%);
IGRAPH_FINALLY_CLEAN(1);
VERTEX_INDEX_PAIRS:
CALL: '&%C%'
CTYPE: igraph_vector_int_t
Expand Down
11 changes: 11 additions & 0 deletions tools/stimulus/types-RR.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,17 @@ VERTEX_INDICES:
%I% <- create_vs(%I1%, %I%)
}
VERTEX_INDICES_PV:
CALL: '%I%-1'
DEFAULT:
ALL: V(%I1%)
INCONV: '%I% <- as_igraph_vs(%I1%, %I%)'
OUTCONV:
OUT: |-
if (igraph_opt("return.vs.es")) {
%I% <- create_vs(%I1%, %I%)
}
EDGE_INDICES:
CALL: '%I%-1'
DEFAULT:
Expand Down

0 comments on commit c89fee0

Please sign in to comment.