dirkschumacher / rcbc

COIN-OR branch and cut (CBC) bindings for R
https://dirkschumacher.github.io/rcbc/
Other
19 stars 5 forks source link

Test PR to verify rcpp-less implementation #44

Closed jeffreyhanson closed 2 years ago

jeffreyhanson commented 3 years ago

This PR is a test to provide an example of a Rcpp-less implementation of this package. It should not be merged. If dropping the Rcpp dependency is still required, I'll submit a new PR after the documentation PR has been merged (to avoid merge conflict hell).

dirkschumacher commented 3 years ago

Thanks a lot for testing that idea. A pure C interface is indeed quite complex. A middle-way would be to use R's data structures and have a function with the same signature as before (the Rcpp one) but instead of Rcpp datatypes it takes and returns SEXPs. But please only go down that route if you really want to :)

For example, given an integer vector you can get its lengths (LENGTH()) and data pointer (INTEGER()). Also, it is not too verbose to construct a named list (VECSXP) as a return value. There is an example here.

jeffreyhanson commented 3 years ago

Interesting - thanks for the info! Yeah, I personally don't think it's worth the hassle to drop Rcpp, so I'm not really as motivated to work on an Rcpp-less implementation. That said, if you feel that an Rcpp-less version is critically important, I can look further into it? Does the package need to drop Rcpp as a dependency to be ready for CRAN submission?

dirkschumacher commented 2 years ago

I would close this in favour of #59. Thanks a lot for investigating a Rcpp-less implementation!