I am trying to define a function using Rcpp for speedup. The situation is as follows:
- I have a package FOO with a lot of C++ code (my own package and currently not using Rcpp) which have defined a set of functions e.g. foo_a and foo_b.
- In another package BAR (using Rcpp) I am defining a function (using Rcpp Attributes) where I want to call functions foo_a and foo_b.
How do I solve this? Looking a bit in other posts I get that I have in some way to include header files in FOO and use attribute // [[Rcpp::depends(FOO)]]
in BAR, but I seem to miss some points. Any hints on how to do it?
Best Lars
EDIT: Thanks for the comments I liked Kevin Usheys approach and tried to implement it. However, after some coding I realized that I actually don't need functions from FOO but a class and its public functions. I guess that I cannot do the tricks you suggested for a class. I ended up putting the source files of the class from FOO in the BAR src dir (not the best approach since I now have 2 versions of the same code). However for the moment this hack work for me.