> On 24 Jul 2015, at 17:22 , Martin Tully <[email protected]> wrote:
>
> Hi I am using RCPP to build a C++ function for quicksort called qsort.
> This function is compiled and loaded through the cxxfunction in R
> I am getting the message in R error: no matching function for call to
> 'qsort(int*&)' The code is below.
> It will not run for me and I was wondering if you could help?
I'm too old to be good at C++, but this looks wrong:
>
>
>
> library(Rcpp)
> library(inline)
>
>
> incl <- 'int qsort(int xx[], int left, int right) {
>
> ......
> return (qsort(xx));
> }
> '
It looks wrong on two counts: qsort() calls itself with no conditioning, and
even if that is intentional, the call doesn't match the definition. Shouldn't
it just be return(xx); ?
-pd
--
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: [email protected] Priv: [email protected]
______________________________________________
[email protected] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.