parallelDist icon indicating copy to clipboard operation
parallelDist copied to clipboard

Possible extension to allow using distance functions within other packages?

Open peekxc opened this issue 4 years ago • 1 comments

There are a growing number of packages that include header-only C++ libraries in the inst/ folder to allow methods to be linked and used on the C++ side of a package (for example: the progress package )

It would be nice to be able to do that with this package to access the distance functions. Something like (pseudo-code)

#include "Rcpp.h"

// [[Rcpp::depends(parallelDist)]]
#include "parallelDist.h"

void my_rcpp_func(std::string method){
    std::shared_ptr<IDistance> distanceFunction = choose_distance(method);
    // ...
}

Alternatively, the ability to capture a given distance function in R and pass as a SEXP similar to the custom distance example might do the trick.

peekxc avatar Aug 22 '19 17:08 peekxc