Re: [R-pkg-devel] R_orderVector1 - algo: radix, shell, or another?

2023-09-24 Thread Simon Urbanek
I think the logic Jeff had in mind is that R order() uses C do_order() for method="shell" and since do_order() uses orderVector1() by induction it is the shell-sort implementation. order() itself uses whatever you specify in method=. Cheers, Simon > On Sep 25, 2023, at 7:10 AM, Jan Gorecki w

Re: [R-pkg-devel] R_orderVector1 - algo: radix, shell, or another?

2023-09-24 Thread Jeff Newmiller via R-package-devel
You asked how order works. From the R source you can follow which C functions are executed, and since you seem familiar with C you can answer your own question. On September 24, 2023 11:10:53 AM PDT, Jan Gorecki wrote: >Hi Jeff, > >Yes I did. My question is about R_orderVector1 which is part of

Re: [R-pkg-devel] R_orderVector1 - algo: radix, shell, or another?

2023-09-24 Thread Jan Gorecki
Hi Jeff, Yes I did. My question is about R_orderVector1 which is part of public R C api. Should I notice something relevant in the source of R's order? Best Jan On Sun, Sep 24, 2023, 17:27 Jeff Newmiller wrote: > Have you read the output of > > order > > entered at the R console? > > > On Sept

Re: [R-pkg-devel] R_orderVector1 - algo: radix, shell, or another?

2023-09-24 Thread Jeff Newmiller via R-package-devel
Have you read the output of order entered at the R console? On September 24, 2023 1:38:41 AM PDT, Jan Gorecki wrote: >Dear pkg developers, > >Are there any ways to check which sorting algorithm is being used when >calling `order` function? Documentation at >https://stat.ethz.ch/R-manual/R-deve

[R-pkg-devel] R_orderVector1 - algo: radix, shell, or another?

2023-09-24 Thread Jan Gorecki
Dear pkg developers, Are there any ways to check which sorting algorithm is being used when calling `order` function? Documentation at https://stat.ethz.ch/R-manual/R-devel/library/base/html/sort.html says it is radix for length < 2^31 On the other hand, I am using R_orderVector1, passing in doub