You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ryan’s C implementation is included as-is. In order for C++ code in other packages to use the C implementation, it must be exported by Rcpp using the // [[Rcpp::export]] attribute. This directs Rcpp to build the necessary header files, which are made available to other R packages via “LinkingTo”.
However Rcpp doesn't play well with points as function parameters (it needs to map each parameter to its R equivalent, and doesn't know what to do with pointers). This doesn’t work even if we ask only for a C++ interface (i.e., using the Rcpp::interfaces attribute).
Solution: Rewrite tf_dp.c to use modern C++ structures (i.e., vectors and reference semantics), and make that available through an Rcpp header. This is the preferred solution (and can be implemented without changing the R frontend).
Alternative solution: Leave the implementation as-is and distribute a copy of the C code with each R package that requires it (e.g., trendfilter).
The text was updated successfully, but these errors were encountered:
Ryan’s C implementation is included as-is. In order for C++ code in other packages to use the C implementation, it must be exported by Rcpp using the
// [[Rcpp::export]]
attribute. This directs Rcpp to build the necessary header files, which are made available to other R packages via “LinkingTo
”.However Rcpp doesn't play well with points as function parameters (it needs to map each parameter to its R equivalent, and doesn't know what to do with pointers). This doesn’t work even if we ask only for a C++ interface (i.e., using the
Rcpp::interfaces
attribute).Solution: Rewrite tf_dp.c to use modern C++ structures (i.e., vectors and reference semantics), and make that available through an Rcpp header. This is the preferred solution (and can be implemented without changing the R frontend).
Alternative solution: Leave the implementation as-is and distribute a copy of the C code with each R package that requires it (e.g.,
trendfilter
).The text was updated successfully, but these errors were encountered: