Skip to content

Commit

Permalink
[R-package] Use R standard routines to access numeric and integer arr…
Browse files Browse the repository at this point in the history
…ay data in C++ (#4247)

* real pointer for matrix

* remove R_REAL_PTR

* remove R_INT_PTR

* add test
  • Loading branch information
jameslamb committed May 3, 2021
1 parent aedfdd0 commit bb88d92
Show file tree
Hide file tree
Showing 4 changed files with 124 additions and 96 deletions.
4 changes: 0 additions & 4 deletions R-package/src/R_object_helper.h
Expand Up @@ -98,10 +98,6 @@ typedef union { VECTOR_SER s; double align; } SEXPREC_ALIGN;

#define R_CHAR_PTR(x) (reinterpret_cast<char*>DATAPTR(x))

#define R_INT_PTR(x) (reinterpret_cast<int*> DATAPTR(x))

#define R_REAL_PTR(x) (reinterpret_cast<double*> DATAPTR(x))

#define R_IS_NULL(x) ((*reinterpret_cast<LGBM_SE>(x)).sxpinfo.type == 0)

// 64bit pointer
Expand Down

0 comments on commit bb88d92

Please sign in to comment.