search for: annkd_tree

Displaying 2 results from an estimated 2 matches for "annkd_tree".

2007 Jul 10
1
How to preserve data across function calls in a library package
...; SEXP retlist; PROTECT(ans=allocMatrix(INTSXP,nrow,k)); //The 2nd argument gives the number of rows, and the last the number of cols see http://cran.r- project.org/doc/manuals/R-exts.html PROTECT(distance=allocMatrix(REALSXP,nrow,k)); ANNpointArray datapoints; ANNpoint qpoint; ANNkd_tree* kdTree; book=Calloc(1,ANN*); foot=Calloc(1,int); book=kdTree; *foot=10; ....... } extern "C" { void do_foo(void){ foo(); } SEXP do_kNN_e(SEXP data, SEXP Nrow, SEXP Ncol,SEXP k,SEXP eps) { return kNN_e(data,Nrow, Ncol, k,eps); } [[alternative HTML...
2007 Jul 10
1
How to preserve data across function calls in a library package
...; SEXP retlist; PROTECT(ans=allocMatrix(INTSXP,nrow,k)); //The 2nd argument gives the number of rows, and the last the number of cols see http://cran.r- project.org/doc/manuals/R-exts.html PROTECT(distance=allocMatrix(REALSXP,nrow,k)); ANNpointArray datapoints; ANNpoint qpoint; ANNkd_tree* kdTree; book=Calloc(1,ANN*); foot=Calloc(1,int); book=kdTree; *foot=10; ....... } extern "C" { void do_foo(void){ foo(); } SEXP do_kNN_e(SEXP data, SEXP Nrow, SEXP Ncol,SEXP k,SEXP eps) { return kNN_e(data,Nrow, Ncol, k,eps); } [[alternative HTML...