Skip to content

Commit

Permalink
tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
edzer committed Apr 4, 2020
1 parent ab4f3d0 commit 8ebffe4
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion R/Intervals-class.R
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ setClass(
# Check 'closed' slot
if (
!is.logical( object@closed ) ||
dim( object@.Data ) != dim( object@closed ) ||
any( dim( object@.Data ) != dim( object@closed )) ||
any( is.na( object@closed ) )
)
return( "The 'closed' slot should be a logical matrix with the same dimensions as the main endpoints matrix. NA values are not permitted." )
Expand Down
26 changes: 26 additions & 0 deletions src/init.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#include <R.h>
#include <Rinternals.h>
#include <R_ext/Rdynload.h>


extern SEXP _which_nearest(SEXP qe, SEXP te, SEXP qc, SEXP tc, SEXP q_full, SEXP t_full);
extern SEXP _plot_overlap(SEXP e, SEXP c, SEXP full);
extern SEXP _reduce(SEXP e, SEXP c, SEXP full);

#define CALLDEF(name, n) {#name, (DL_FUNC) &name, n}

const static R_CallMethodDef R_CallDef[] = {
CALLDEF(_which_nearest, 6),
CALLDEF(_plot_overlap, 3),
CALLDEF(_reduce, 3),
{NULL, NULL, 0}
};

void
// attribute_visible // optional
R_init_intervals(DllInfo *dll)
{
R_registerRoutines(dll, NULL, R_CallDef, NULL, NULL);
R_useDynamicSymbols(dll, FALSE);
R_forceSymbols(dll, TRUE);
}

0 comments on commit 8ebffe4

Please sign in to comment.