Skip to content

Commit

Permalink
fix: add DOUBLE type
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonov548 committed Jan 16, 2024
1 parent 8cd6529 commit d5a61d1
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/rinterface.c
Original file line number Diff line number Diff line change
Expand Up @@ -10735,7 +10735,12 @@ SEXP R_igraph_almost_equals(SEXP a, SEXP b, SEXP eps) {
igraph_bool_t c_result;
SEXP r_result;
/* Convert input */

IGRAPH_R_CHECK_REAL(a);
c_a = REAL(a)[0];
IGRAPH_R_CHECK_REAL(b);
c_b = REAL(b)[0];
IGRAPH_R_CHECK_REAL(eps);
c_eps = REAL(eps)[0];
/* Call igraph */
c_result=igraph_almost_equals(c_a, c_b, c_eps);

Expand All @@ -10759,7 +10764,12 @@ SEXP R_igraph_cmp_epsilon(SEXP a, SEXP b, SEXP eps) {
int c_result;
SEXP r_result;
/* Convert input */

IGRAPH_R_CHECK_REAL(a);
c_a = REAL(a)[0];
IGRAPH_R_CHECK_REAL(b);
c_b = REAL(b)[0];
IGRAPH_R_CHECK_REAL(eps);
c_eps = REAL(eps)[0];
/* Call igraph */
c_result=igraph_cmp_epsilon(c_a, c_b, c_eps);

Expand Down
15 changes: 15 additions & 0 deletions tools/stimulus/types-RC.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,21 @@ CSTRING:
OUT: |-
PROTECT(%I% = Rf_mkCharLenCE(%C%, strlen(%C%), CE_UTF8));
DOUBLE:
CTYPE: double
CALL:
IN: '%C%'
OUT: '&%C%'
INOUT: '&%C%'
INCONV:
IN: |-
IGRAPH_R_CHECK_REAL(%I%);
%C% = REAL(%I%)[0];
OUTCONV:
OUT: |-
PROTECT(%I%=NEW_NUMERIC(1));
REAL(%I%)[0]=%C%;
REAL:
CTYPE: igraph_real_t
CALL:
Expand Down

0 comments on commit d5a61d1

Please sign in to comment.